diff --git a/RTCP/Cobalt/CoInterface/src/Parset.cc b/RTCP/Cobalt/CoInterface/src/Parset.cc index 6e5a82b44588e667c78b014f60cd4e2b48f8c395..4c1050c8bd91d93b7d3b580a917db52edd4898fb 100644 --- a/RTCP/Cobalt/CoInterface/src/Parset.cc +++ b/RTCP/Cobalt/CoInterface/src/Parset.cc @@ -641,9 +641,16 @@ namespace LOFAR const string prefix = str(format("Observation.Beam[%u].TiedArrayBeam[%u]") % i % j); - tab.directionDelta.type = getString(prefix + ".directionType", "J2000"); - tab.directionDelta.angle1 = getDouble(prefix + ".angle1", 0.0); - tab.directionDelta.angle2 = getDouble(prefix + ".angle2", 0.0); + tab.direction.type = getString(prefix + ".directionType", "J2000"); + tab.direction.angle1 = getDouble(renamedKey(prefix + ".absoluteAngle1", + prefix + ".angle1"), 0.0); + tab.direction.angle2 = getDouble(renamedKey(prefix + ".absoluteAngle2", + prefix + ".angle2"), 0.0); + // Always store absolute angles. So this is for backwards compat. + if (!isDefined(prefix + ".absoluteAngle1")) + tab.direction.angle1 += settings.SAPs[i].direction.angle1; + if (!isDefined(prefix + ".absoluteAngle2")) + tab.direction.angle2 += settings.SAPs[i].direction.angle2; tab.coherent = getBool(prefix + ".coherent", true); if (tab.coherent) @@ -1033,8 +1040,8 @@ namespace LOFAR { std::vector<double> TAB(2); - TAB[0] = settings.beamFormer.SAPs[beam].TABs[pencil].directionDelta.angle1; - TAB[1] = settings.beamFormer.SAPs[beam].TABs[pencil].directionDelta.angle2; + TAB[0] = settings.beamFormer.SAPs[beam].TABs[pencil].direction.angle1; + TAB[1] = settings.beamFormer.SAPs[beam].TABs[pencil].direction.angle2; return TAB; } diff --git a/RTCP/Cobalt/CoInterface/src/Parset.h b/RTCP/Cobalt/CoInterface/src/Parset.h index 424c43495b4528ed0777f1c752a8d84d42d39570..57afc38c79911e351ad217e24d620aa5539cb453 100644 --- a/RTCP/Cobalt/CoInterface/src/Parset.h +++ b/RTCP/Cobalt/CoInterface/src/Parset.h @@ -244,7 +244,7 @@ namespace LOFAR // NIC(s) to bind to (comma seperated) // - // F.e. 'mlx4_0', 'mlx_4_1', 'eth0', etc + // E.g. 'mlx4_0', 'mlx_4_1', 'eth0', etc std::string nic; }; @@ -261,8 +261,8 @@ namespace LOFAR // Two angles within the coordinate type (RA/DEC, etc) // - // key: *.angle1 - // key: *.angle2 + // key: *.absoluteAngle1 + // key: *.absoluteAngle2 double angle1; double angle2; }; @@ -444,11 +444,10 @@ namespace LOFAR unsigned nrHighResolutionChannels; struct TAB { - // The direction in wich the TAB points, relative - // to the SAP's coordinates + // The (absolute) direction where the TAB points to. // // key: Observation.Beam[sap].TiedArrayBeam[tab].* - struct Direction directionDelta; + struct Direction direction; // Whether the beam is coherent (or incoherent) // diff --git a/RTCP/Cobalt/InputProc/src/Delays/Delays.cc b/RTCP/Cobalt/InputProc/src/Delays/Delays.cc index e497e121f9208b98ccbe79312879bc5deb268915..dc5c4bd4ecb6addba57c50714649b5becfe20e93 100644 --- a/RTCP/Cobalt/InputProc/src/Delays/Delays.cc +++ b/RTCP/Cobalt/InputProc/src/Delays/Delays.cc @@ -227,8 +227,8 @@ namespace LOFAR // Convert the TAB directions using the convert engine const struct ObservationSettings::BeamFormer::SAP &bfSap = parset.settings.beamFormer.SAPs[sap]; for (size_t tab = 0; tab < bfSap.TABs.size(); tab++) { - const MVDirection dir(sapInfo.direction.angle1 + bfSap.TABs[tab].directionDelta.angle1, - sapInfo.direction.angle2 + bfSap.TABs[tab].directionDelta.angle2); + const MVDirection dir(bfSap.TABs[tab].direction.angle1, + bfSap.TABs[tab].direction.angle2); result.SAPs[sap].TABs[tab] = convert(converter, dir); } diff --git a/RTCP/Cobalt/OutputProc/src/MSWriterDAL.cc b/RTCP/Cobalt/OutputProc/src/MSWriterDAL.cc index a1cae5da6a5a8499e2ab8061ee5a84a4eca2ba5e..981b53d8201f3516fdb52d5c7f80390f51a1eaa5 100644 --- a/RTCP/Cobalt/OutputProc/src/MSWriterDAL.cc +++ b/RTCP/Cobalt/OutputProc/src/MSWriterDAL.cc @@ -327,13 +327,13 @@ namespace LOFAR BeamCoordinates pbeamDirs = parset.TABs(sapNr); BeamCoord3D pbeamDir = pbeamDirs[beamNr]; - beam.pointRA().value = (beamDir[0] + pbeamDir[0]) * 180.0 / M_PI; + beam.pointRA().value = pbeamDir[0] * 180.0 / M_PI; beam.pointRAUnit().value = "deg"; - beam.pointDEC().value = (beamDir[1] + pbeamDir[1]) * 180.0 / M_PI; + beam.pointDEC().value = pbeamDir[1] * 180.0 / M_PI; beam.pointDECUnit().value = "deg"; - beam.pointOffsetRA().value = pbeamDir[0] * 180.0 / M_PI; + beam.pointOffsetRA().value = (pbeamDir[0] - beamDir[0]) * 180.0 / M_PI; beam.pointOffsetRAUnit().value = "deg"; - beam.pointOffsetDEC().value = pbeamDir[1] * 180.0 / M_PI; + beam.pointOffsetDEC().value = (pbeamDir[1] - beamDir[1]) * 180.0 / M_PI; beam.pointOffsetDECUnit().value = "deg";