Skip to content
Snippets Groups Projects
Commit aaf2185f authored by Ger van Diepen's avatar Ger van Diepen
Browse files

bug 1638:

Write new phase center if needed
parent 66f8a4a6
No related branches found
No related tags found
No related merge requests found
......@@ -103,6 +103,9 @@ namespace LOFAR {
// Update the OBSERVATION table with the correct start and end time.
void updateObs (const string& outName);
// Update the FIELD table with the new phase center.
void updateField (const string& outName, const DPInfo& info);
// Write the data, flags, etc.
void writeData (casa::Table& out, const DPBuffer& buf);
......
......@@ -34,6 +34,8 @@
#include <tables/Tables/SetupNewTab.h>
#include <tables/Tables/ArrColDesc.h>
#include <tables/Tables/StandardStMan.h>
#include <measures/TableMeasures/ArrayMeasColumn.h>
#include <measures/Measures/MCDirection.h>
#include <casa/Arrays/ArrayMath.h>
#include <casa/Containers/Record.h>
#include <casa/OS/Path.h>
......@@ -349,6 +351,10 @@ namespace LOFAR {
updateSpw (outName, info);
// Adjust the OBSERVATION table as needed.
updateObs (outName);
// ADjust the FIELD table as needed.
if (! info.phaseCenterIsOriginal()) {
updateField (outName, info);
}
}
void MSWriter::updateSpw (const string& outName, const DPInfo& info)
......@@ -437,6 +443,17 @@ namespace LOFAR {
}
}
void MSWriter::updateField (const string& outName, const DPInfo& info)
{
Table outField = Table(outName + "/FIELD", Table::Update);
// Set phase center.
ArrayMeasColumn<MDirection> delayCol (outField, "DELAY_DIR");
ArrayMeasColumn<MDirection> phaseCol (outField, "PHASE_DIR");
Vector<MDirection> dir(1, info.phaseCenter());
delayCol.put (0, dir);
phaseCol.put (0, dir);
}
void MSWriter::writeHistory (Table& ms, const ParameterSet& parset)
{
Table histtab(ms.keywordSet().asTable("HISTORY"));
......
......@@ -69,7 +69,7 @@ namespace LOFAR {
void PhaseShift::show (std::ostream& os) const
{
os << "PhaseShift " << itsName << std::endl;
os << " center: " << itsCenter << std::endl;
os << " phasecenter: " << itsCenter << std::endl;
}
void PhaseShift::showTimings (std::ostream& os, double duration) const
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment