Commit 863b0668 authored by Sergio Poppi's avatar Sergio Poppi
Browse files

HolographyBE: azel offsets instead azimuth, minor patches, bug corrected, save...

HolographyBE: azel offsets instead azimuth, minor patches, bug corrected, save file each scan instead subscan
parent 1ac7d860
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -53,7 +53,7 @@ import corr2serial # The Giovanni's module defines an high level API to communic
__docformat__ = 'restructuredtext'

# A list of ordered keys of full_res dictionary in save_coeff method
ordered_key_list = ['x_2', 'y_2', 'y90_2', 'xy', 'xy90','modNrm','PwrInX2','PwrInY2']#, 'real', 'imm', 'module', 'phase']
ordered_key_list = ['x_2', 'y_2', 'y90_2', 'xy', 'xy90','modNrm','PwrInX2','PwrInY2','phase_deg']#, 'real', 'imm', 'module', 'phase']

class DigitalXCorrelator(DXC__POA.DigitalXCorrelator, ACSComponent, ContainerServices, ComponentLifecycle):
    """The DigitalXCorrelator ACS component uses the serial port to communicate with
@@ -221,8 +221,8 @@ class DigitalXCorrelator(DXC__POA.DigitalXCorrelator, ACSComponent, ContainerSer
#            print full_res
            # Write values (V. 051)
            self.out_file.write("\n")
            self.out_file.write(("%.4f" %azimuth).ljust(15))
            self.out_file.write(("%.4f" %elevation).ljust(15))
            self.out_file.write(("%.6f" %degrees(azimuth)).ljust(15))
            self.out_file.write(("%.6f" %degrees(elevation)).ljust(15))
            for item in ordered_key_list:
                self.out_file.write(("%.4f" %full_res[item]).ljust(15))
            self.out_file.write(("%s" %datetime.datetime.now()).ljust(30))
+26 −15
Original line number Diff line number Diff line
@@ -80,7 +80,7 @@
 */

#define FLOW_NUMBER 1 

#define HOLO_DEBUG
//using namespace SimpleParser;
//_IRA_LOGFILTER_DECLARE;
 
@@ -286,7 +286,7 @@ void HolographyImpl::sendHeader() throw (CORBA::SystemException, BackendsErrors:
         
        
        }
        
        #ifndef HOLO_DEBUG
	THeaderRecord bkd; //header for fitswriter
        bkd.header.sections=2;  
        bkd.header.beams=1;
@@ -314,14 +314,21 @@ void HolographyImpl::sendHeader() throw (CORBA::SystemException, BackendsErrors:
                                bkd.chHeader[index].feed=i;
                                bkd.chHeader[index].inputs=1;                           
                                index++;
                
                        }
                }
        #endif
               
     try {
     
                cout << "**Correlator OpenFile**"<< endl;
                m_correlator->openFile(m_filename.c_str());
                #ifndef HOLO_DEBUG

                getSender()->startSend(FLOW_NUMBER,(const char*)&bkd,
                                sizeof(Backends::TMainHeader)+bkd.header.sections*sizeof(Backends::TSectionHeader));
               #endif
         
        }
        catch (AVStartSendErrorExImpl& ex) {
                _ADD_BACKTRACE(BackendsErrors::TXErrorExImpl,impl,ex,"HolographyImpl::sendHeader()");
@@ -424,21 +431,14 @@ void HolographyImpl::sendStop() throw (CORBA::SystemException, BackendsErrors::B
		 	az=-0.69; 
			el=0.55;
		}
             try{
             
                   m_correlator->closeFile();
                } catch (ComponentErrors::ComponentErrorsExImpl& ex) 
                {
                     ex.log(LM_DEBUG);
                     throw ex.getComponentErrorsEx();
                }   catch (BackendsErrors::BackendsErrorsExImpl& ex)
                {
                    ex.log(LM_DEBUG);
                    throw ex.getBackendsErrorsEx(); 
                }     

	try {
             #ifndef HOLO_DEBUG

		getSender()->stopSend(FLOW_NUMBER);
             #endif
             
	}
	catch (AVStopSendErrorExImpl& ex) {
		_ADD_BACKTRACE(BackendsErrors::TXErrorExImpl,impl,ex,"HolographyImpl::sendStop()");
@@ -459,7 +459,18 @@ void HolographyImpl::terminate() throw (CORBA::SystemException, BackendsErrors::
			ComponentErrors::ComponentErrorsEx)
{
	AUTO_TRACE("HolographyImpl::terminate()");
        try{
                
                   m_correlator->closeFile();
                } catch (ComponentErrors::ComponentErrorsExImpl& ex) 
                {
                     ex.log(LM_DEBUG);
                     throw ex.getComponentErrorsEx();
                }   catch (BackendsErrors::BackendsErrorsExImpl& ex)
                {
                    ex.log(LM_DEBUG);
                    throw ex.getBackendsErrorsEx(); 
                }     
       
	
	 
+7 −10
Original line number Diff line number Diff line
@@ -55,10 +55,6 @@ void CSenderThread::runLoop()
	{
	  	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

@@ -69,8 +65,9 @@ void CSenderThread::runLoop()
	try{

#define PI 3.14159265358979323846
        az=az/PI*180.0;
        el=el/PI*180.0;
     //   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); 
	// AUTO_TRACE("CSenderThread::runLoop()");
	} catch (ACSErrTypeFPGACommunication::ACSErrTypeFPGACommunicationExImpl &ex)
+2 −1
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ from math import log10
####################
class Correlator:
    def __init__(self):
        self.results = { 'x_2' : 0, 'y_2' : 0, 'xy' : 0, 'xy90' : 0, 'y90_2' : 0, 'y_y90' : 0,'modNrm':0.,'PwrInX2':0.,'PwrInY2':0.}
        self.results = { 'x_2' : 0, 'y_2' : 0, 'xy' : 0, 'xy90' : 0, 'y90_2' : 0, 'y_y90' : 0,'modNrm':0.,'PwrInX2':0.,'PwrInY2':0.,'phase_deg':0.}
        self.coeff   = { 'real' : 0.00, 'imm' : 0.00 }
        self.buffer  = ""
        self.ser     = serial.Serial()
@@ -145,6 +145,7 @@ class Correlator:
        self.results['PwrInX2'] = 10 * log10 ( (1000/100) * ( sqrt ( self.results['x_2'] * (2**30) / (5000000) ) * (39.0625/1000000))**2)
        self.results['PwrInY2'] = 10 * log10 ( (1000/100) * ( sqrt ( self.results['y_2'] * (2**30) / (5000000) ) * (39.0625/1000000))**2)
	self.results['modNrm'] = sqrt(self.coeff['realNrm']**2 + self.coeff['immNrm']**2) 
        self.results['phase_deg']= self.coeff['phase_deg']

    def get_real(self):
        return self.coeff['real']