diff --git a/CEP/DP3/DPPP/include/DPPP/MSWriter.h b/CEP/DP3/DPPP/include/DPPP/MSWriter.h index 1d0c843f6b860b883bbdce6734235f3b270e5c9b..47f8700368a5c42449ad6ba215f10d0b3036b86c 100644 --- a/CEP/DP3/DPPP/include/DPPP/MSWriter.h +++ b/CEP/DP3/DPPP/include/DPPP/MSWriter.h @@ -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); diff --git a/CEP/DP3/DPPP/src/MSWriter.cc b/CEP/DP3/DPPP/src/MSWriter.cc index 8451ac17c097dbcee9232c8983c766c3be12afb6..0c343dde38a354ddd9cc8ec9e724a4042922de87 100644 --- a/CEP/DP3/DPPP/src/MSWriter.cc +++ b/CEP/DP3/DPPP/src/MSWriter.cc @@ -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")); diff --git a/CEP/DP3/DPPP/src/PhaseShift.cc b/CEP/DP3/DPPP/src/PhaseShift.cc index e0cbd4e5c51b0859391a7f8c990293b347defb42..7c1583b773e1a3e142b41ce02243e37b9c51947c 100644 --- a/CEP/DP3/DPPP/src/PhaseShift.cc +++ b/CEP/DP3/DPPP/src/PhaseShift.cc @@ -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