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

added new keyword in main header of subScan fits file. SIGNAL indicates if the...

added new keyword in main header of subScan fits file. SIGNAL indicates if the data aretaken onsource or data is a reference
parent 8069b92f
Loading
Loading
Loading
Loading
+31 −0
Original line number Diff line number Diff line
@@ -89,6 +89,37 @@ public:
			return "SKYDIP";
		}
	}

	static bool map(const char *strScan,TSubScanSignal& mode) {
		if (strcasecmp(strScan,"SIGNAL")==0) {
			mode=Management::MNG_SIGNAL_SIGNAL;
			return true;
		}
		else if (strcasecmp(strScan,"REFERENCE")==0) {
			mode=Management::MNG_SIGNAL_REFERENCE;
			return true;
		}
		else if (strcasecmp(strScan,"NONE")==0) {
			mode=Management::MNG_SIGNAL_NONE;
			return true;
		}
		else {
			return false;
		}
	}

	static const char *map(const TSubScanSignal& scan) {
		if (scan==Management::MNG_SIGNAL_SIGNAL) {
			return "SIGNAL";
		}
		if (scan==Management::MNG_SIGNAL_REFERENCE) {
			return "REFERENCE";
		}
		else { //Management::MNG_SIGNAL_REFERENCE
			return "NONE";
		}
	}

};

};
+15 −0
Original line number Diff line number Diff line
@@ -210,6 +210,17 @@ public:
		pos=m_dewarPos;
	}

	void setSubScanConf(const Management::TSubScanConfiguration& conf) {
		m_subScanConf=conf;
	}

	void setSubScanConf() {
		m_subScanConf.signal=Management::MNG_SIGNAL_NONE;
	}

	const Management::TSubScanConfiguration& getSubScanConf() {
		return m_subScanConf;
	}
private:

	/**
@@ -291,6 +302,10 @@ private:
	 * Initial position of the dewar, it depends on the mode.
	 */
	double m_dewarPos;
	/**
	 * Sub scan configuration
	 */
	Management::TSubScanConfiguration m_subScanConf;
};

};
+3 −2
Original line number Diff line number Diff line
@@ -18,8 +18,9 @@
#define FITS_VERSION6 "V.1.0"
#define FITS_VERSION7 "V.1.01"
#define FITS_VERSION8 "V.1.1"
#define FITS_VERSION9 "V.1.11"

#define CURRENT_VERSION FITS_VERSION8
#define CURRENT_VERSION FITS_VERSION9

#define DEFAULT_COMMENT CURRENT_VERSION" Created by  S. Righini, M. Bartolini  & A. Orlati"

@@ -31,7 +32,7 @@
#define HISTORY6 FITS_VERSION6" Added new table to store position of subriflector e primary focus receivers: SERVO TABLE"
#define HISTORY7 FITS_VERSION7" New keywords in FEED TABLE header to describe derotator configuration"
#define HISTORY8 FITS_VERSION8" Summary.fits file included in order to describe the scan configuration"

#define HISTORY9 FITS_VERSION9" added the keyword SIGNAL in main header of each sub scan fits"



+50 −0
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@
#include <DateTime.h>
#include <SkySource.h>
#include <ReceiversModule.h>
#include <ManagementModule.h>
#include <AntennaModule.h>
#include "CommonTools.h"

@@ -465,6 +466,11 @@ void CEngineThread::runLoop()
			//let's create the summary file, it should be created before the first subscan of the scan.......
			// the the summary will be valid for the duration of all the subscans.....
			if (!m_summaryOpened) {
			 	TIMEVALUE currentUT;
				IRA::CDateTime now;
				TIMEDIFFERENCE currentLST;
				IRA::CString lstStr;

				// now let's create the summary file.
				m_summary=new CSummaryWriter();
				m_summary->setBasePath("");
@@ -477,6 +483,13 @@ 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);
				}
				// compute the LST time for the scan
			 	IRA::CIRATools::getTime(currentUT); // get the current time
			 	now.setDateTime(currentUT,m_data->getDut1());  // transform the current time in a CDateTime object
			 	now.LST(m_data->getSite()).getDateTime(currentLST);  // get the current LST time
			 	currentLST.day(0);
			 	IRA::CIRATools::intervalToStr(currentLST.value().value,lstStr);
			 	m_summary->getFilePointer()->setKeyword("LST",lstStr);
				m_summaryOpened=true;
				ACS_LOG(LM_FULL_INFO, "CEngineThread::runLoop()",(LM_DEBUG,"SUMMARY_OPENED"));
			}
@@ -745,6 +758,13 @@ 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("Signal",(const char *)Management::Definitions::map(m_info.getSubScanConf().signal),"sub scan is reference or signal")) {
					_EXCPT(ManagementErrors::FitsCreationErrorExImpl,impl,"CEngineThread::runLoop()");
					impl.setFileName((const char *)m_data->getFileName());
					impl.setError(m_file->getLastError());
					impl.log(LM_ERROR); // not filtered, because the user need to know about the problem immediately
					m_data->setStatus(Management::MNG_FAILURE);
				}
				if (scanTag>=0) {
					if(!m_file->setPrimaryHeaderKey("Scan Tag",scanTag,"Scan tag identifier")) {
						_EXCPT(ManagementErrors::FitsCreationErrorExImpl,impl,"CEngineThread::runLoop()");
@@ -1156,6 +1176,36 @@ void CEngineThread::collectSchedulerData(FitsWriter_private::CFile* summaryFile)
		std::list<double> va;
		CCommonTools::map(restFreq,va);
		if (summaryFile) summaryFile->setKeyword("RESTFREQ",va);
		Management::TSubScanConfiguration_var conf;
		try {
			m_scheduler->getSubScanConfigruation(conf.out());
			m_info.setSubScanConf(conf.in());
		}
		catch (CORBA::SystemException& ex) {
			_EXCPT(ComponentErrors::CORBAProblemExImpl,impl,"CEngineThread::collectSchedulerdata()");
			impl.setName(ex._name());
			impl.setMinor(ex.minor());
			impl.log(LM_ERROR);
			m_data->setStatus(Management::MNG_WARNING);
			minorServoBossError=true;
			m_info.setSubScanConf();
		}
		catch (ManagementErrors::ManagementErrorsEx& ex) {
			_ADD_BACKTRACE(ComponentErrors::CouldntCallOperationExImpl,impl,ex,"CEngineThread::collectSchedulerdata()");
			impl.setOperationName("getSubScanConfigruation()");
			impl.setComponentName((const char *)m_config->getSchedulerComponent());
			impl.log(LM_ERROR);
			m_data->setStatus(Management::MNG_WARNING);
			m_info.setSubScanConf();
		}
		catch (ComponentErrors::ComponentErrorsEx& ex) {
			_ADD_BACKTRACE(ComponentErrors::CouldntCallOperationExImpl,impl,ex,"CEngineThread::collectSchedulerdata()");
			impl.setOperationName("getSubScanConfigruation()");
			impl.setComponentName((const char *)m_config->getSchedulerComponent());
			impl.log(LM_ERROR);
			m_data->setStatus(Management::MNG_WARNING);
			m_info.setSubScanConf();
		}
	}
}

+1 −0
Original line number Diff line number Diff line
@@ -222,6 +222,7 @@ bool CFitsWriter::create()
	if (!CFitsTools::primaryHeaderHistory(pFits,HISTORY6,m_lastError)) return false;
	if (!CFitsTools::primaryHeaderHistory(pFits,HISTORY7,m_lastError)) return false;
	if (!CFitsTools::primaryHeaderHistory(pFits,HISTORY8,m_lastError)) return false;
	if (!CFitsTools::primaryHeaderHistory(pFits,HISTORY9,m_lastError)) return false;
	return true;
};

Loading