diff --git a/CHANGELOG.md b/CHANGELOG.md index c8e1ed8741ddf9a70975e4c8c1cb5032e094dbe0..78a63fce32e7e5d540be382f7c45162be4bdd10d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -111,3 +111,4 @@ and this project adheres to [Semantic Versioning](http://semver.org/ issue #689 - The dataset provided by weather station has been enlarged by the wind direction. The correctponding RAL 'wx' command will noe provided wind direction readout, as well issue #621 - The maximum number of chars of the schedule file name is now 37 (extension included). This is done for fits file and archive issue with the lenght of the schedule name. issue #853 - The setSection command can now accept a wildcard (*) as section identifier. This will allow to configure all backend sections with a single command + issue #895 - FitZilla version 1.23 released, the rest frequency is also added in the header of the Section table \ No newline at end of file diff --git a/Common/Servers/FitsWriter/include/Version.h b/Common/Servers/FitsWriter/include/Version.h index cb1621ae0bd927a4a9c35921e6b61a568b38e4e1..cb266e16b6ee61e10195b5a47db3014f1d85a8dd 100644 --- a/Common/Servers/FitsWriter/include/Version.h +++ b/Common/Servers/FitsWriter/include/Version.h @@ -23,9 +23,10 @@ #define FITS_VERSION11 "V.1.2" #define FITS_VERSION12 "V.1.21" #define FITS_VERSION13 "V.1.22" +#define FITS_VERSION14 "V.1.23" -#define CURRENT_VERSION FITS_VERSION13 +#define CURRENT_VERSION FITS_VERSION14 #define DEFAULT_COMMENT CURRENT_VERSION" Created by S. Righini, M. Bartolini & A. Orlati" @@ -42,6 +43,8 @@ #define HISTORY11 FITS_VERSION11" Frequency and bandwidth columns added to Section table reporting backend sampled band" #define HISTORY12 FITS_VERSION12" SubScan offsets added to the primary header" #define HISTORY13 FITS_VERSION13" Summary file aligned to reference document" +#define HISTORY14 FITS_VERSION14" Rest frequency information also added in the header of section table" + #define CREDITS1 " " #define CREDITS2 "These data are property of:" diff --git a/Common/Servers/FitsWriter/src/EngineThread.cpp b/Common/Servers/FitsWriter/src/EngineThread.cpp index 0008d1dbb92fa6799bf5e0f5a0fc3563c8ab96f7..9ed3691f7b7afa0e373ef75d4ade125e5131368a 100644 --- a/Common/Servers/FitsWriter/src/EngineThread.cpp +++ b/Common/Servers/FitsWriter/src/EngineThread.cpp @@ -629,7 +629,7 @@ void CEngineThread::runLoop() ACS::doubleSeq fluxes; ACS::longSeq feedsID; ACS::longSeq ifsID; - ACS::doubleSeq atts; + ACS::doubleSeq atts,restFreqs; ACS::longSeq sectionsID; ACS::stringSeq axisName,axisUnit; @@ -889,6 +889,39 @@ 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); } + m_info.getRestFreq(restFreqs); + if (restFreqs.length()==1) { + double rfValue; + IRA::CString keyName; + for (long j=0;j<m_data->getSectionsNumber();j++) { + if (restFreqs[0]>0.0) rfValue=restFreqs[0]; + else rfValue=DOUBLE_DUMMY_VALUE; + keyName.Format("RESTFREQ%d",j+1); + if (!m_file->setSectionHeaderKey(keyName,rfValue,"Frequency resolution of the Nth section (MHz)")) { + _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); + } + } + } + else { + double rfValue; + IRA::CString keyName; + for (long j=0;j<restFreqs.length();j++) { + if (restFreqs[j]>0.0) rfValue=restFreqs[j]; + else rfValue=DOUBLE_DUMMY_VALUE; + keyName.Format("RESTFREQ%d",j+1); + if (!m_file->setSectionHeaderKey(keyName,rfValue,"Frequency resolution of the Nth section (MHz)")) { + _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); + } + } + } CFitsWriter::TFeedHeader *feedH=m_info.getFeedHeader(); if (!m_file->addFeedTable("FEED TABLE")) { _EXCPT(ManagementErrors::FitsCreationErrorExImpl,impl,"CEngineThread::runLoop()"); diff --git a/Common/Servers/FitsWriter/src/FitsWriter.cpp b/Common/Servers/FitsWriter/src/FitsWriter.cpp index b7dafd5df31cd11f91c3e57c2c4febd2e12cb8fc..57a1a3a68ba20eb6fc32de3532335618af404a61 100644 --- a/Common/Servers/FitsWriter/src/FitsWriter.cpp +++ b/Common/Servers/FitsWriter/src/FitsWriter.cpp @@ -234,7 +234,8 @@ bool CFitsWriter::create() if (!CFitsTools::primaryHeaderHistory(pFits,HISTORY10,m_lastError)) return false; if (!CFitsTools::primaryHeaderHistory(pFits,HISTORY11,m_lastError)) return false; if (!CFitsTools::primaryHeaderHistory(pFits,HISTORY12,m_lastError)) return false; - if (!CFitsTools::primaryHeaderHistory(pFits,HISTORY13,m_lastError)) return false; + if (!CFitsTools::primaryHeaderHistory(pFits,HISTORY13,m_lastError)) return false; + if (!CFitsTools::primaryHeaderHistory(pFits,HISTORY14,m_lastError)) return false; if (!CFitsTools::primaryHeaderComment(pFits,CREDITS1,m_lastError)) return false; if (!CFitsTools::primaryHeaderComment(pFits,CREDITS2,m_lastError)) return false; diff --git a/Common/Servers/FitsWriter/src/SummaryWriter.cpp b/Common/Servers/FitsWriter/src/SummaryWriter.cpp index 81fc021f007a4e6312c4b587bda9b8bac559f7c5..b516e783bbee4bff3865acb336296807125c0301 100644 --- a/Common/Servers/FitsWriter/src/SummaryWriter.cpp +++ b/Common/Servers/FitsWriter/src/SummaryWriter.cpp @@ -63,6 +63,7 @@ bool CSummaryWriter::create() if (!CFitsTools::primaryHeaderHistory(m_pFits,HISTORY11,m_lastError)) return false; if (!CFitsTools::primaryHeaderHistory(m_pFits,HISTORY12,m_lastError)) return false; if (!CFitsTools::primaryHeaderHistory(m_pFits,HISTORY13,m_lastError)) return false; + if (!CFitsTools::primaryHeaderHistory(m_pFits,HISTORY14,m_lastError)) return false; if (!CFitsTools::primaryHeaderComment(m_pFits,CREDITS1,m_lastError)) return false; if (!CFitsTools::primaryHeaderComment(m_pFits,CREDITS2,m_lastError)) return false;