Loading Common/Servers/HolographyBackend/src/DigitalXCorrelatorImpl/DigitalXCorrelator.py +13 −8 Original line number Diff line number Diff line Loading @@ -43,6 +43,8 @@ import ACSErrTypeFPGACommunicationImpl import ComponentErrorsImpl import Acspy.Util.ACSCorba import BackendsErrorsImpl from Acspy.Common.TimeHelper import getTimeStamp from Acspy.Clients.SimpleClient import PySimpleClient Loading Loading @@ -87,7 +89,8 @@ class DigitalXCorrelator(DXC__POA.DigitalXCorrelator, ACSComponent, ContainerSer ContainerServices.__init__(self) self.corr = corr2serial.Correlator() # self.name=ContainerServices.getName(self) # sc=PySimpleClient() # self.antennaBoss=sc.getComponent("ANTENNA/Boss") def initialize(self): """Retrieve the CDB parameters.""" # dal=Acspy.Util.ACSCorba.cdb() Loading @@ -104,7 +107,7 @@ class DigitalXCorrelator(DXC__POA.DigitalXCorrelator, ACSComponent, ContainerSer self.max_attempts =1 # self.samples==int(dao.get_double("SAMPLES")) self.port='/dev/ttyr00' self.port='/dev/ttyS0' self.baudrate=115200 self.samples=5000000 self.out_file_name="/home/spoppi/Holography/outfile" Loading Loading @@ -182,6 +185,7 @@ class DigitalXCorrelator(DXC__POA.DigitalXCorrelator, ACSComponent, ContainerSer """ try: if self.corr.isConnected: self.corr.disconnect() err = self.corr.connect(self.port, self.baudrate) Loading @@ -190,7 +194,7 @@ class DigitalXCorrelator(DXC__POA.DigitalXCorrelator, ACSComponent, ContainerSer except Exception: self.getLogger().logDebug("Error in save_coeff: cannot connect to FPGA") self.getLogger().logError("Error... cannot connect to FPGA") raise BackendErrorsImpl.NakExImpl() raise BackendsErrorsImpl.NakExImpl() # # Running Correlation try: Loading @@ -198,7 +202,7 @@ class DigitalXCorrelator(DXC__POA.DigitalXCorrelator, ACSComponent, ContainerSer except Exception: self.getLogger().logError("Error running correlation.") raise BackendErrorsImpl.BackendBusyImpl() raise BackendsErrorsImpl.BackendBusyImpl() # Getting coefficient Loading @@ -206,7 +210,7 @@ class DigitalXCorrelator(DXC__POA.DigitalXCorrelator, ACSComponent, ContainerSer self.corr.getCoeff() except Exception: raise BackendErrorsImpl.BackendBusyImpl() raise BackendsErrorsImpl.BackendBusyImpl() # module = sqrt(self.corr.get_real()**2 + self.corr.get_imm()**2) # phase_tmp = atan2(self.corr.get_imm() , self.corr.get_real()) Loading @@ -215,7 +219,8 @@ class DigitalXCorrelator(DXC__POA.DigitalXCorrelator, ACSComponent, ContainerSer try: full_res = self.corr.results.copy() self.corr.reset() # az,el=self.antennaBoss.getObservedHorizontal(getTimeStamp().value,0) # self.corr.reset() # full_res.update({'module': module, 'phase': phase}) # print full_res Loading @@ -233,7 +238,7 @@ class DigitalXCorrelator(DXC__POA.DigitalXCorrelator, ACSComponent, ContainerSer self.corr.disconnect() except Exception: print "disconnect exception" raise BackendErrorsImpl.BackendBusyImpl() raise BackendsErrorsImpl.BackendBusyImpl() def openFile(self,name): Loading Loading @@ -269,5 +274,5 @@ class DigitalXCorrelator(DXC__POA.DigitalXCorrelator, ACSComponent, ContainerSer self.corr.reset() except Exception: print "reset exception" raise BackendErrorsImpl.BackendBusyImpl() raise BackendsErrorsImpl.BackendBusyImpl() No newline at end of file Common/Servers/HolographyBackend/src/SenderThread.cpp +12 −8 Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ void CSenderThread::runLoop() double az,el; az=-99.; // DUMMY values el=-99.; double azimuth,elevation; if (CORBA::is_nil(m_antenna_boss)) { Loading @@ -53,22 +54,25 @@ void CSenderThread::runLoop() } else { cout <<"ABOSS REFERENCED " << endl; IRA::CIRATools::getTime(now); m_antenna_boss->getAllOffsets(azeloff,eloff,raoff,decoff,lonoff,latoff); // m_antenna_boss->getObservedHorizontal(now.value().value,0,az,el); // get az and el from bos // m_antenna_boss->getAllOffsets(azeloff,eloff,raoff,decoff,lonoff,latoff); // m_antenna_boss->getObservedHorizontal(now.value().value,200*10000,az,el); // get az and el from bos #define PI 3.14159265358979323846 cout <<"Azimuth and El:" << az/PI*180. <<" " <<el/PI*180. << endl; azimuth=az; elevation=el; } // removed IRA::CError err; try{ #define PI 3.14159265358979323846 // az=az/PI*180.0; // conversion to degrees made inside the correlator component // // el=el/PI*180.0; m_dxc_correlator->save_coeff(azeloff,eloff); m_dxc_correlator->save_coeff(azimuth,elevation); // AUTO_TRACE("CSenderThread::runLoop()"); } catch (ACSErrTypeFPGACommunication::ACSErrTypeFPGACommunicationExImpl &ex) { Loading Common/Servers/HolographyBackend/src/corr2serial.py +2 −0 Original line number Diff line number Diff line Loading @@ -88,6 +88,8 @@ class Correlator: if len(self.buffer) != buffer_size: return -1 else: self.ser.flushInput() return 0 def fixed2float(self,data, dim_data, q): Loading Loading
Common/Servers/HolographyBackend/src/DigitalXCorrelatorImpl/DigitalXCorrelator.py +13 −8 Original line number Diff line number Diff line Loading @@ -43,6 +43,8 @@ import ACSErrTypeFPGACommunicationImpl import ComponentErrorsImpl import Acspy.Util.ACSCorba import BackendsErrorsImpl from Acspy.Common.TimeHelper import getTimeStamp from Acspy.Clients.SimpleClient import PySimpleClient Loading Loading @@ -87,7 +89,8 @@ class DigitalXCorrelator(DXC__POA.DigitalXCorrelator, ACSComponent, ContainerSer ContainerServices.__init__(self) self.corr = corr2serial.Correlator() # self.name=ContainerServices.getName(self) # sc=PySimpleClient() # self.antennaBoss=sc.getComponent("ANTENNA/Boss") def initialize(self): """Retrieve the CDB parameters.""" # dal=Acspy.Util.ACSCorba.cdb() Loading @@ -104,7 +107,7 @@ class DigitalXCorrelator(DXC__POA.DigitalXCorrelator, ACSComponent, ContainerSer self.max_attempts =1 # self.samples==int(dao.get_double("SAMPLES")) self.port='/dev/ttyr00' self.port='/dev/ttyS0' self.baudrate=115200 self.samples=5000000 self.out_file_name="/home/spoppi/Holography/outfile" Loading Loading @@ -182,6 +185,7 @@ class DigitalXCorrelator(DXC__POA.DigitalXCorrelator, ACSComponent, ContainerSer """ try: if self.corr.isConnected: self.corr.disconnect() err = self.corr.connect(self.port, self.baudrate) Loading @@ -190,7 +194,7 @@ class DigitalXCorrelator(DXC__POA.DigitalXCorrelator, ACSComponent, ContainerSer except Exception: self.getLogger().logDebug("Error in save_coeff: cannot connect to FPGA") self.getLogger().logError("Error... cannot connect to FPGA") raise BackendErrorsImpl.NakExImpl() raise BackendsErrorsImpl.NakExImpl() # # Running Correlation try: Loading @@ -198,7 +202,7 @@ class DigitalXCorrelator(DXC__POA.DigitalXCorrelator, ACSComponent, ContainerSer except Exception: self.getLogger().logError("Error running correlation.") raise BackendErrorsImpl.BackendBusyImpl() raise BackendsErrorsImpl.BackendBusyImpl() # Getting coefficient Loading @@ -206,7 +210,7 @@ class DigitalXCorrelator(DXC__POA.DigitalXCorrelator, ACSComponent, ContainerSer self.corr.getCoeff() except Exception: raise BackendErrorsImpl.BackendBusyImpl() raise BackendsErrorsImpl.BackendBusyImpl() # module = sqrt(self.corr.get_real()**2 + self.corr.get_imm()**2) # phase_tmp = atan2(self.corr.get_imm() , self.corr.get_real()) Loading @@ -215,7 +219,8 @@ class DigitalXCorrelator(DXC__POA.DigitalXCorrelator, ACSComponent, ContainerSer try: full_res = self.corr.results.copy() self.corr.reset() # az,el=self.antennaBoss.getObservedHorizontal(getTimeStamp().value,0) # self.corr.reset() # full_res.update({'module': module, 'phase': phase}) # print full_res Loading @@ -233,7 +238,7 @@ class DigitalXCorrelator(DXC__POA.DigitalXCorrelator, ACSComponent, ContainerSer self.corr.disconnect() except Exception: print "disconnect exception" raise BackendErrorsImpl.BackendBusyImpl() raise BackendsErrorsImpl.BackendBusyImpl() def openFile(self,name): Loading Loading @@ -269,5 +274,5 @@ class DigitalXCorrelator(DXC__POA.DigitalXCorrelator, ACSComponent, ContainerSer self.corr.reset() except Exception: print "reset exception" raise BackendErrorsImpl.BackendBusyImpl() raise BackendsErrorsImpl.BackendBusyImpl() No newline at end of file
Common/Servers/HolographyBackend/src/SenderThread.cpp +12 −8 Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ void CSenderThread::runLoop() double az,el; az=-99.; // DUMMY values el=-99.; double azimuth,elevation; if (CORBA::is_nil(m_antenna_boss)) { Loading @@ -53,22 +54,25 @@ void CSenderThread::runLoop() } else { cout <<"ABOSS REFERENCED " << endl; IRA::CIRATools::getTime(now); m_antenna_boss->getAllOffsets(azeloff,eloff,raoff,decoff,lonoff,latoff); // m_antenna_boss->getObservedHorizontal(now.value().value,0,az,el); // get az and el from bos // m_antenna_boss->getAllOffsets(azeloff,eloff,raoff,decoff,lonoff,latoff); // m_antenna_boss->getObservedHorizontal(now.value().value,200*10000,az,el); // get az and el from bos #define PI 3.14159265358979323846 cout <<"Azimuth and El:" << az/PI*180. <<" " <<el/PI*180. << endl; azimuth=az; elevation=el; } // removed IRA::CError err; try{ #define PI 3.14159265358979323846 // az=az/PI*180.0; // conversion to degrees made inside the correlator component // // el=el/PI*180.0; m_dxc_correlator->save_coeff(azeloff,eloff); m_dxc_correlator->save_coeff(azimuth,elevation); // AUTO_TRACE("CSenderThread::runLoop()"); } catch (ACSErrTypeFPGACommunication::ACSErrTypeFPGACommunicationExImpl &ex) { Loading
Common/Servers/HolographyBackend/src/corr2serial.py +2 −0 Original line number Diff line number Diff line Loading @@ -88,6 +88,8 @@ class Correlator: if len(self.buffer) != buffer_size: return -1 else: self.ser.flushInput() return 0 def fixed2float(self,data, dim_data, q): Loading