Commit f9d08e6f authored by Andrea Orlat's avatar Andrea Orlat
Browse files

NoData fits file modifications (now the data column are not written) ported to...

NoData fits file modifications (now the data column are not written) ported to TAG. This should solve some of the issue arose when observing with the roach backend
parent b4b0887a
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -143,12 +143,13 @@ public:
	 * @param sourceFlux for each backend section it reports the estimated source flux computed with section parameters
	 * @param atts attenuation, one for each input of the backend
	 * @param name name of the sections table
	 * @param noData if true the data columns will not be added to the DATATable
	 * @param rfName name of the RF inputs table
	 * @return false if the operation is not successful
	 */
	bool addSectionTable(const ACS::longSeq &sectionID, const ACS::longSeq& feedsID, const ACS::longSeq& ifsID,const ACS::longSeq& pols,const ACS::doubleSeq& los,
			const ACS::doubleSeq& skyFreq,const ACS::doubleSeq& skyBandWidth,const ACS::doubleSeq& marks,
			const ACS::doubleSeq& sourceFlux,const ACS::doubleSeq& atts,const IRA::CString& name="SECTION TABLE",const IRA::CString& rfName="RF INPUTS");
			const ACS::doubleSeq& sourceFlux,const ACS::doubleSeq& atts,bool noData,const IRA::CString& name="SECTION TABLE",const IRA::CString& rfName="RF INPUTS");

	/**
	 * It allows to add the servo table to the file
+86 −74
Original line number Diff line number Diff line
@@ -313,6 +313,7 @@ bool CEngineThread::processData()
		}
#endif
	}  // m_config->getMinorServoBossComponent()!=""
	if (!m_data->getIsNoData()) {
		for (int i=0;i<m_data->getSectionsNumber();i++) {
			bins=m_data->getSectionBins(i);
			pol=m_data->getSectionStreamsNumber(i);
@@ -389,7 +390,10 @@ bool CEngineThread::processData()
	#endif
				}
			}
		} //end for
	}


#ifndef FW_DEBUG
	m_file->add_row();
#endif
@@ -637,7 +641,7 @@ void CEngineThread::runLoop()
					impl.log(LM_ERROR); // not filtered, because the user need to know about the problem immediately
					m_data->setStatus(Management::MNG_FAILURE);
				}
				else if (!m_file->setPrimaryHeaderKey("Beams",mH.beams,"Number of beams")) {
				else if (!m_file->setPrimaryHeaderKey("Beams",/*mH.beams*/m_info.getFeedNumber(),"Number of beams")) {
					_EXCPT(ManagementErrors::FitsCreationErrorExImpl,impl,"CEngineThread::runLoop()");
					impl.setFileName((const char *)m_data->getFileName());
					impl.setError(m_file->getLastError());
@@ -786,7 +790,7 @@ void CEngineThread::runLoop()
					impl.log(LM_ERROR); // not filtered, because the user need to know about the problem immediately
					m_data->setStatus(Management::MNG_FAILURE);
				}
				if (!m_file->addSectionTable(sectionsID,feedsID,ifsID,polarizations,LocalOscillator,skyFreq,skyBw,calib,fluxes,atts)) {
				if (!m_file->addSectionTable(sectionsID,feedsID,ifsID,polarizations,LocalOscillator,skyFreq,skyBw,calib,fluxes,atts,m_data->getIsNoData())) {
					_EXCPT(ManagementErrors::FitsCreationErrorExImpl,impl,"CEngineThread::runLoop()");
					impl.setFileName((const char *)m_data->getFileName());
					impl.setError(m_file->getLastError());
@@ -1185,7 +1189,15 @@ void CEngineThread::collectSchedulerData(FitsWriter_private::CFile* summaryFile)
		}
		restFreq=restFreqRef->get_sync(comp.out());
		std::list<double> va;
		va.clear();
		for (unsigned ii=0;ii<restFreq->length();ii++) {
			printf("valore precedente %lf\n",restFreq[ii]);
		}
		CCommonTools::map(restFreq,va);
		std::list<double>::const_iterator it;
		for (it=va.begin();it!=va.end();it++) {
			printf("valore convertito %lf\n",*it);
		}
		if (summaryFile) summaryFile->setKeyword("RESTFREQ",va);
		Management::TSubScanConfiguration_var conf;
		try {
+6 −4
Original line number Diff line number Diff line
@@ -482,7 +482,7 @@ bool CFitsWriter::addFeedTable(const IRA::CString& name)

bool CFitsWriter::addSectionTable(const ACS::longSeq &sectionID, const ACS::longSeq& feedsID, const ACS::longSeq& ifsID,const ACS::longSeq& pols,const ACS::doubleSeq& los,
		const ACS::doubleSeq& skyFreq,const ACS::doubleSeq& skyBandWidth,const ACS::doubleSeq& marks,const ACS::doubleSeq& sourceFlux,const ACS::doubleSeq& atts,
		const IRA::CString& name,const IRA::CString& rfName)
		bool noData,const IRA::CString& name,const IRA::CString& rfName)
{
	std::vector<long> id;
	std::vector<long> bins;
@@ -521,7 +521,6 @@ bool CFitsWriter::addSectionTable(const ACS::longSeq &sectionID, const ACS::long
		fluxIterator+=m_channels[i].inputs;
		// creation of the channels columns for the data table......
		colName << "Ch" << m_channels[i].id;
	    DataColName.push_back(colName.str());		
		if (m_channels[i].polarization==Backends::BKND_FULL_STOKES) {
			sect_type.push_back("stokes");
			type << (4 * bins[i]) << data_type; //full stokes
@@ -530,8 +529,11 @@ bool CFitsWriter::addSectionTable(const ACS::longSeq &sectionID, const ACS::long
			sect_type.push_back("simple");
			type <<  (1 * bins[i]) << data_type;
		}
		if (!noData) {
		    DataColName.push_back(colName.str());
			DataColForm.push_back(type.str());
			DataColUnit.push_back("");
		}

		if (m_channels[i].inputs>1) {
			tsysType << (m_channels[i].inputs) << "D";;
+1 −1
Original line number Diff line number Diff line
@@ -120,7 +120,7 @@ int main(int argc, char *argv[])
		printf("FITS Error: %s\n",(const char *)file->getLastError());
		exit(-1);
	}
	if (!file->addSectionTable(sectionsID,feedsID,ifsID,pols,los,skyFreq,skyBw,calib,flux,atts)) {
	if (!file->addSectionTable(sectionsID,feedsID,ifsID,pols,los,skyFreq,skyBw,calib,flux,atts,false)) {
		printf("FITS Error: %s\n",(const char *)file->getLastError());
		exit(-1);
	}