Unverified Commit cbd4815a authored by Andrea Orlati's avatar Andrea Orlati Committed by GitHub
Browse files

Fix issue 348 (#633)

* fix issue #348: fixed keyword EXPTIME and LST in summary fits file

* fix issue #348: fixed keyword EQUINOX and LogFileName, ScheduleName in Summary fits file

* fix issue #348: reviwed the name of the summary file, empty keyword assigned the proper dummy value

* fix isuue #348: multiple keywords in summary file are now properly valued

* fix issue #348: last fixed regarding some  keywords comment
parent 068a4e61
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -100,19 +100,19 @@ public:
	}

	static bool map(const char *strMode,TPolarization& mode) {
		if (strcasecmp(strMode,"LEFT")==0) {
		if (strcasecmp(strMode,"LCP")==0) {
			mode=RCV_LCP;
			return true;
		}
		if (strcasecmp(strMode,"RIGHT")==0) {
		if (strcasecmp(strMode,"RCP")==0) {
			mode=RCV_RCP;
			return true;
		}
		if (strcasecmp(strMode,"VERTICAL")==0) {
		if (strcasecmp(strMode,"VLP")==0) {
			mode=RCV_VLP;
			return true;
		}
		if (strcasecmp(strMode,"HORIZONTAL")==0) {
		if (strcasecmp(strMode,"HLP")==0) {
			mode=RCV_HLP;
			return true;
		}
@@ -122,16 +122,16 @@ public:
	}
	static const char *map(const TPolarization& mode ) {
		if (mode==RCV_LCP) {
			return "LEFT";
			return "LCP";
		}
		if (mode==RCV_RCP) {
			return "RIGHT";
			return "RCP";
		}
		if (mode==RCV_VLP) {
			return "VERTICAL";
			return "VLP";
		}
		else { //RCV_HLP
			return "HORIZONTAL";
			return "HLP";
		}
	}
};
+14 −0
Original line number Diff line number Diff line
@@ -336,6 +336,11 @@ public:
	 */
	long getSectionsNumber() const { return m_mainH.sections; }
	
	/**
	 * Get the bandwidth of a section
	*/
	double getSectionBandWidth(const long& ch) const { return m_sectionH[ch].bandWidth; }
	
	/**
	 * Get the millisecond of integration
	 */
@@ -351,6 +356,13 @@ public:
	 */
	void getInputsConfiguration(ACS::longSeq& sectionID,ACS::longSeq& feeds,ACS::longSeq& ifs,ACS::doubleSeq& freqs,ACS::doubleSeq& bws,ACS::doubleSeq& atts);
	
	/**
	 * Gets the frequency (sky) associated to the sections
	*/
	void getSectionSkyFrequency(ACS::doubleSeq& outFreq,const ACS::doubleSeq& skyFreqs) const;
	
	void getSectionTypeAndPols(std::list<IRA::CString>& outPols,const ACS::longSeq& pols) const;
	
	/**
	 * Get number of expected streams coming from a section.
	 * @param section section identifier
@@ -531,6 +543,8 @@ public:
private:
	/** the name of the file */
	IRA::CString m_fileName;
	/** The name of the summary file */
	IRA::CString m_summaryFileName;
	/**
	 * the full path of the file in system disk
	 */
+4 −0
Original line number Diff line number Diff line
@@ -13,6 +13,10 @@
#include <CCfits>
#include <IRA>

#define LONG_DUMMY_VALUE -999
#define DOUBLE_DUMMY_VALUE -999.0
#define STRING_DUMMY_VALUE "NULL"

namespace FitsWriter_private {

class CFitsTools {
+14 −5
Original line number Diff line number Diff line
@@ -97,20 +97,21 @@ public:

	/*
	 * allows to read the sequence of IFs polarization
	 * @param pol used to return back the the array
	 * @param pol used to return back the array
	 */
	void getReceiverPolarization(ACS::longSeq& pol) const { pol=m_receiverPolarization; }

	/**
	 * @param freq used to return the number of frequencies, one value for each section
	 * @param freq used to return the number of frequencies, one value for each inputs
	 */
	void getSkyFrequency(ACS::doubleSeq& freq) const { freq=m_skyFrequency; }

	/**
	 * @param freq used to return the number of bandwidths, one value for each section
	 * @param freq used to return the number of bandwidths, one value for each inputs
	 */
	void getSkyBandwidth(ACS::doubleSeq& freq) const { freq=m_skyBandwidth; }
	

	/**
	 * allows to store the information about each of the backend inputs. The dimension of the sequences should be exactly the number returned by the method <i>getInputsNumber()</i>-
	 */
@@ -189,8 +190,8 @@ public:
	}

	/**
	 * Stores the list of values corresponding to the estimated source flux of the source,
	 * @param fl list of fluxes, one value is  given corresponding to each input, but just one for each section is taken
	 * Stores the list of values corresponding to the estimated source flux of the source for each input
	 * @param fl list of fluxes, one value is  given corresponding to each input
	 */
	void setSourceFlux(const ACS::doubleSeq& fl) { m_sourceFlux=fl; }
	void setSourceFlux() { m_sourceFlux.length(0); }
@@ -250,6 +251,10 @@ public:
	}
	void getRestFreq(ACS::doubleSeq& rf) const { rf=m_restFreq; }
	
	WORD getTotalDumps() const { return m_totalDumps; }
	void resetTotalDumps() { m_totalDumps=0; }
	void incTotalDumps() { m_totalDumps++; }

private:

	/**
@@ -344,6 +349,10 @@ private:
	 * It reports if the calibration diode has been fired on subscan basis
	*/
	bool m_calDiode;
	/*
	* Reports how many dumps have been taken in the observation (scan)
	*/
	WORD m_totalDumps;
};

};
+23 −9
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@
#ifndef SUMMARYSCHEMA_H_
#define SUMMARYSCHEMA_H_

#define SCHEMA_HEADER_ENTRY_NUMBER 31
#define SCHEMA_HEADER_ENTRY_NUMBER 45

#define SCHEMA_HEADER_ENTRY1 ( 0, _FILE_STRING_TYPE,_FILE_SINGLE_ENTRY,"TELESCOP","Telescope name" )
#define SCHEMA_HEADER_ENTRY2 ( 0, _FILE_STRING_TYPE,_FILE_SINGLE_ENTRY,"ReceiverCode","Receiver name" )
@@ -22,7 +22,7 @@
#define SCHEMA_HEADER_ENTRY7 ( 0, _FILE_DOUBLE_TYPE,_FILE_SINGLE_ENTRY,"EQUINOX","Equinox of RA, Dec" )
#define SCHEMA_HEADER_ENTRY8 ( 0, _FILE_DOUBLE_TYPE,_FILE_SINGLE_ENTRY,"EXPTIME","Total integration time (seconds)" )
#define SCHEMA_HEADER_ENTRY9 ( 0, _FILE_STRING_TYPE,_FILE_SINGLE_ENTRY,"PROJID","ProjectID" )
#define SCHEMA_HEADER_ENTRY10 ( 0, _FILE_STRING_TYPE,_FILE_SINGLE_ENTRY,"LST","Local sidereal time" )
#define SCHEMA_HEADER_ENTRY10 ( 0, _FILE_DOUBLE_TYPE,_FILE_SINGLE_ENTRY,"LST","Local sidereal time (seconds)" )
#define SCHEMA_HEADER_ENTRY11 ( 0, _FILE_STRING_TYPE,_FILE_SINGLE_ENTRY,"SCANTYPE","Scan astronomical type" )
#define SCHEMA_HEADER_ENTRY12 ( 0, _FILE_STRING_TYPE,_FILE_SINGLE_ENTRY,"SCANMODE","Mapping mode" )
#define SCHEMA_HEADER_ENTRY13 ( 0, _FILE_STRING_TYPE,_FILE_SINGLE_ENTRY,"SCANGEOM","Scan geometry" )
@@ -30,20 +30,34 @@
#define SCHEMA_HEADER_ENTRY15 ( 0, _FILE_STRING_TYPE,_FILE_SINGLE_ENTRY,"ScheduleName","Name of the schedule" )
#define SCHEMA_HEADER_ENTRY16 ( 0, _FILE_STRING_TYPE,_FILE_SINGLE_ENTRY,"LogFileName","Name of the log file" )
#define SCHEMA_HEADER_ENTRY17 ( 0, _FILE_DOUBLE_TYPE,_FILE_SINGLE_ENTRY,"SCANXVEL","Tracking rate (optional,OTF)" )
#define SCHEMA_HEADER_ENTRY18 ( 0, _FILE_LONG_TYPE,_FILE_SINGLE_ENTRY,"WOBUSED","Wobbler used?" )
#define SCHEMA_HEADER_ENTRY18 ( 0, _FILE_STRING_TYPE,_FILE_SINGLE_ENTRY,"WOBUSED","Wobbler used?" )
#define SCHEMA_HEADER_ENTRY19 ( 0, _FILE_STRING_TYPE,_FILE_SINGLE_ENTRY,"OBSID","Observer or operator initials" )
#define SCHEMA_HEADER_ENTRY20 ( 0, _FILE_STRING_TYPE,_FILE_SINGLE_ENTRY,"CREATOR","Software (incl. version)" )
#define SCHEMA_HEADER_ENTRY21 ( 0, _FILE_STRING_TYPE,_FILE_SINGLE_ENTRY,"FITSVER","FITS version" )
#define SCHEMA_HEADER_ENTRY22 ( 0, _FILE_LONG_TYPE,_FILE_SINGLE_ENTRY,"NUSEBANDS","Number of sections" )
#define SCHEMA_HEADER_ENTRY23 ( 0, _FILE_DOUBLE_TYPE,_FILE_MULTI_ENTRY,"FREQRES","Frequency resolution (MHz)" )
#define SCHEMA_HEADER_ENTRY24 ( 0, _FILE_DOUBLE_TYPE,_FILE_MULTI_ENTRY,"RESTFREQ","Rest frequency (MHz)" )
#define SCHEMA_HEADER_ENTRY25 ( 0, _FILE_DOUBLE_TYPE,_FILE_MULTI_ENTRY,"FREQ","frequency of the Nth section(MHz)" )
#define SCHEMA_HEADER_ENTRY26 ( 0, _FILE_DOUBLE_TYPE,_FILE_MULTI_ENTRY,"BWID","bandwidth of the Nth section (MHz)" )
#define SCHEMA_HEADER_ENTRY27 ( 0, _FILE_LONG_TYPE,_FILE_MULTI_ENTRY,"CHAN","Number of spectral bins of the Nth section" )
#define SCHEMA_HEADER_ENTRY22 ( 0, _FILE_LONG_TYPE,_FILE_SINGLE_ENTRY,"NUSEBAND","Number of sections" )
#define SCHEMA_HEADER_ENTRY23 ( 0, _FILE_DOUBLE_TYPE,_FILE_MULTI_ENTRY,"FREQRESOL","Frequency resolution of the Nth section (MHz)" )
#define SCHEMA_HEADER_ENTRY24 ( 0, _FILE_DOUBLE_TYPE,_FILE_MULTI_ENTRY,"RESTFREQ","Rest frequency of the Nth setcion (MHz)" )
#define SCHEMA_HEADER_ENTRY25 ( 0, _FILE_DOUBLE_TYPE,_FILE_MULTI_ENTRY,"FREQ","Start frequency of the Nth section(MHz)" )
#define SCHEMA_HEADER_ENTRY26 ( 0, _FILE_DOUBLE_TYPE,_FILE_MULTI_ENTRY,"BWID","Bandwidth of the Nth section (MHz)" )
#define SCHEMA_HEADER_ENTRY27 ( 0, _FILE_LONG_TYPE,_FILE_MULTI_ENTRY,"FREQBINS","Number of spectral bins of the Nth section" )
#define SCHEMA_HEADER_ENTRY28 ( 0, _FILE_DOUBLE_TYPE,_FILE_SINGLE_ENTRY,"VRAD","Radial velocity" )
#define SCHEMA_HEADER_ENTRY29 ( 0, _FILE_STRING_TYPE,_FILE_SINGLE_ENTRY,"VFRAME","Radial velocity reference frame" )
#define SCHEMA_HEADER_ENTRY30 ( 0, _FILE_STRING_TYPE,_FILE_SINGLE_ENTRY,"VDEF","Radial velocity definition" )
#define SCHEMA_HEADER_ENTRY31 ( 0, _FILE_STRING_TYPE,_FILE_SINGLE_ENTRY,"DATE-OBS","Observation time" )
#define SCHEMA_HEADER_ENTRY32 ( 0, _FILE_STRING_TYPE,_FILE_SINGLE_ENTRY,"PINAME","Name if the PI of the project" )
#define SCHEMA_HEADER_ENTRY33 ( 0, _FILE_STRING_TYPE,_FILE_SINGLE_ENTRY,"WCSNAME","Astronomical basis frame" )
#define SCHEMA_HEADER_ENTRY34 ( 0, _FILE_STRING_TYPE,_FILE_SINGLE_ENTRY,"SCANDIR","(Optional) scan direction" )
#define SCHEMA_HEADER_ENTRY35 ( 0, _FILE_STRING_TYPE,_FILE_SINGLE_ENTRY,"DUTYCYC","(Optional) On-Off-Cal duty cycle" )
#define SCHEMA_HEADER_ENTRY36 ( 0, _FILE_STRING_TYPE,_FILE_SINGLE_ENTRY,"USRFRAME","Description of the user frame" )
#define SCHEMA_HEADER_ENTRY37 ( 0, _FILE_STRING_TYPE,_FILE_MULTI_ENTRY,"POLATYPE","LCP, RCP, HLP, VLP, stokes type of the Nth section" )
#define SCHEMA_HEADER_ENTRY38 ( 0, _FILE_DOUBLE_TYPE,_FILE_SINGLE_ENTRY,"XMINDEG","Scan start x coordinate (degree, optional)")
#define SCHEMA_HEADER_ENTRY39 ( 0, _FILE_DOUBLE_TYPE,_FILE_SINGLE_ENTRY,"XMAXDEG","Scan end x coordinate (degree, optional)" )
#define SCHEMA_HEADER_ENTRY40 ( 0, _FILE_DOUBLE_TYPE,_FILE_SINGLE_ENTRY,"YMINDEG","Scan start y coordinate (degree, optional)" )
#define SCHEMA_HEADER_ENTRY41 ( 0, _FILE_DOUBLE_TYPE,_FILE_SINGLE_ENTRY,"YMAXDEG","Scan end y coordinate (degree, optional)" )
#define SCHEMA_HEADER_ENTRY42 ( 0, _FILE_DOUBLE_TYPE,_FILE_SINGLE_ENTRY,"SCANOFF","Scan offset (deg)" )
#define SCHEMA_HEADER_ENTRY43 ( 0, _FILE_DOUBLE_TYPE,_FILE_SINGLE_ENTRY,"SCANLEN","Scan span (deg)" )
#define SCHEMA_HEADER_ENTRY44 ( 0, _FILE_DOUBLE_TYPE,_FILE_SINGLE_ENTRY,"SCANSTART","Scan start (deg)" )
#define SCHEMA_HEADER_ENTRY45 ( 0, _FILE_DOUBLE_TYPE,_FILE_SINGLE_ENTRY,"TSYS","System temperature (K)" )

//#define SCHEMA_TABLE_NUMBER 1

Loading