Skip to content
Snippets Groups Projects
Commit b23cd3c4 authored by Chris Broekema's avatar Chris Broekema
Browse files

Bug #1011: Add the used parset and some identifying information to the MS.

parent 4687e8fe
Branches
Tags
No related merge requests found
...@@ -71,6 +71,7 @@ class MeasurementSetFormat : public Format ...@@ -71,6 +71,7 @@ class MeasurementSetFormat : public Format
void fillDataDesc(); void fillDataDesc();
void fillSpecWindow(unsigned subband); void fillSpecWindow(unsigned subband);
void fillObs(); void fillObs();
void fillHistory();
}; };
} //RTCP } //RTCP
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include <lofar_config.h> #include <lofar_config.h>
#include <Storage/MeasurementSetFormat.h> #include <Storage/MeasurementSetFormat.h>
#include <Storage/Package__Version.h>
#include <AMCBase/Epoch.h> #include <AMCBase/Epoch.h>
...@@ -52,7 +53,6 @@ ...@@ -52,7 +53,6 @@
#include <boost/thread/mutex.hpp> #include <boost/thread/mutex.hpp>
using namespace casa; using namespace casa;
namespace LOFAR { namespace LOFAR {
...@@ -150,6 +150,7 @@ void MeasurementSetFormat::createMSTables(unsigned subband) ...@@ -150,6 +150,7 @@ void MeasurementSetFormat::createMSTables(unsigned subband)
fillDataDesc(); fillDataDesc();
fillSpecWindow(subband); fillSpecWindow(subband);
fillObs(); fillObs();
fillHistory();
} catch (AipsError x) { } catch (AipsError x) {
THROW(StorageException,"AIPS/CASA error: " << x.getMesg()); THROW(StorageException,"AIPS/CASA error: " << x.getMesg());
...@@ -357,6 +358,38 @@ void MeasurementSetFormat::fillSpecWindow(unsigned subband) { ...@@ -357,6 +358,38 @@ void MeasurementSetFormat::fillSpecWindow(unsigned subband) {
msspw.flush(); msspw.flush();
} }
void MeasurementSetFormat::fillHistory() {
Table histtab(itsMS->keywordSet().asTable("HISTORY"));
histtab.reopenRW();
ScalarColumn<double> time (histtab, "TIME");
ScalarColumn<int> obsId (histtab, "OBSERVATION_ID");
ScalarColumn<String> message (histtab, "MESSAGE");
ScalarColumn<String> application (histtab, "APPLICATION");
ScalarColumn<String> priority (histtab, "PRIORITY");
ScalarColumn<String> origin (histtab, "ORIGIN");
ArrayColumn<String> parms (histtab, "APP_PARAMS");
ArrayColumn<String> cli (histtab, "CLI_COMMAND");
// Put all parset entries in a Vector<String>.
casa::Vector<String> appvec;
casa::Vector<String> clivec;
appvec.resize (itsPS->size());
casa::Array<String>::contiter viter = appvec.cbegin();
for (ParameterSet::const_iterator iter = itsPS->begin(); iter != itsPS->end(); ++iter, ++viter) {
*viter = iter->first + '=' + iter->second.get();
}
uint rownr = histtab.nrow();
histtab.addRow();
time.put (rownr, Time().modifiedJulianDay()*24.*3600.);
obsId.put (rownr, 0);
message.put (rownr, "parameters");
application.put (rownr, "OLAP");
priority.put (rownr, "NORMAL");
origin.put (rownr, Version::getInfo<StorageVersion>("Storage", "full"));
parms.put (rownr, appvec);
cli.put (rownr, clivec);
}
void MeasurementSetFormat::createMSMetaFile(unsigned subband) void MeasurementSetFormat::createMSMetaFile(unsigned subband)
{ {
Block<Int> ant1(itsPS->nrBaselines()); Block<Int> ant1(itsPS->nrBaselines());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment