Skip to content
Snippets Groups Projects
Commit 183aae55 authored by Tammo Jan Dijkema's avatar Tammo Jan Dijkema
Browse files

Task #9273: DPPP applycal now accepts ScalarPhase as alias for CommonScalarPhase

parent b3a92bf5
No related branches found
No related tags found
No related merge requests found
...@@ -70,6 +70,15 @@ namespace LOFAR { ...@@ -70,6 +70,15 @@ namespace LOFAR {
if (itsCorrectType=="fulljones" && itsUpdateWeights) { if (itsCorrectType=="fulljones" && itsUpdateWeights) {
ASSERTSTR (itsInvert, "Updating weights has not been implemented for invert=false and fulljones"); ASSERTSTR (itsInvert, "Updating weights has not been implemented for invert=false and fulljones");
} }
ASSERT(itsCorrectType=="gain" || itsCorrectType=="fulljones" ||
itsCorrectType=="tec" || itsCorrectType=="clock" ||
itsCorrectType=="scalarphase" || itsCorrectType=="commonscalarphase" ||
itsCorrectType=="scalaramplitude" || itsCorrectType=="commonscalaramplitude" ||
itsCorrectType=="rotationangle" || itsCorrectType=="commonrotationangle" ||
itsCorrectType=="rotationmeasure");
if (itsCorrectType.substr(0,6)=="common") {
itsCorrectType=itsCorrectType.substr(6);
}
} }
ApplyCal::ApplyCal() ApplyCal::ApplyCal()
...@@ -172,13 +181,13 @@ namespace LOFAR { ...@@ -172,13 +181,13 @@ namespace LOFAR {
itsParmExprs.push_back("Clock:0"); itsParmExprs.push_back("Clock:0");
itsParmExprs.push_back("Clock:1"); itsParmExprs.push_back("Clock:1");
} }
} else if (itsCorrectType == "commonrotationangle") { } else if (itsCorrectType == "rotationangle") {
itsParmExprs.push_back("{Common,}RotationAngle"); itsParmExprs.push_back("{Common,}RotationAngle");
} else if (itsCorrectType == "commonscalarphase") { } else if (itsCorrectType == "scalarphase") {
itsParmExprs.push_back("{Common,}ScalarPhase"); itsParmExprs.push_back("{Common,}ScalarPhase");
} else if (itsCorrectType == "rotationmeasure") { } else if (itsCorrectType == "rotationmeasure") {
itsParmExprs.push_back("RotationMeasure"); itsParmExprs.push_back("RotationMeasure");
} else if (itsCorrectType == "commonscalaramplitude") { } else if (itsCorrectType == "scalaramplitude") {
itsParmExprs.push_back("{Common,}ScalarAmplitude"); itsParmExprs.push_back("{Common,}ScalarAmplitude");
} }
else { else {
...@@ -448,7 +457,7 @@ namespace LOFAR { ...@@ -448,7 +457,7 @@ namespace LOFAR {
parmvalues[1][ant][tf] * freq * casa::C::_2pi); parmvalues[1][ant][tf] * freq * casa::C::_2pi);
} }
} }
else if (itsCorrectType=="commonrotationangle") { else if (itsCorrectType=="rotationangle") {
double phi=parmvalues[0][ant][tf]; double phi=parmvalues[0][ant][tf];
if (itsInvert) { if (itsInvert) {
phi = -phi; phi = -phi;
...@@ -474,11 +483,11 @@ namespace LOFAR { ...@@ -474,11 +483,11 @@ namespace LOFAR {
itsParms(2, ant, tf) = sinv; itsParms(2, ant, tf) = sinv;
itsParms(3, ant, tf) = cosv; itsParms(3, ant, tf) = cosv;
} }
else if (itsCorrectType=="commonscalarphase") { else if (itsCorrectType=="scalarphase") {
itsParms(0, ant, tf) = polar(1., parmvalues[0][ant][tf]); itsParms(0, ant, tf) = polar(1., parmvalues[0][ant][tf]);
itsParms(1, ant, tf) = polar(1., parmvalues[0][ant][tf]); itsParms(1, ant, tf) = polar(1., parmvalues[0][ant][tf]);
} }
else if (itsCorrectType=="commonscalaramplitude") { else if (itsCorrectType=="scalaramplitude") {
itsParms(0, ant, tf) = parmvalues[0][ant][tf]; itsParms(0, ant, tf) = parmvalues[0][ant][tf];
itsParms(1, ant, tf) = parmvalues[0][ant][tf]; itsParms(1, ant, tf) = parmvalues[0][ant][tf];
} }
...@@ -501,7 +510,7 @@ namespace LOFAR { ...@@ -501,7 +510,7 @@ namespace LOFAR {
uint numParms; uint numParms;
if (itsCorrectType=="fulljones" || if (itsCorrectType=="fulljones" ||
itsCorrectType=="commonrotationangle" || itsCorrectType=="rotationangle" ||
itsCorrectType=="rotationmeasure") { itsCorrectType=="rotationmeasure") {
numParms = 4; numParms = 4;
} }
......
...@@ -79,3 +79,21 @@ EOL ...@@ -79,3 +79,21 @@ EOL
../../src/NDPPP msin=tNDPPP-generic.MS msout=. msout.datacolumn=DATA3 steps=[applycal] applycal.parmdb=tApplyCal.parmdb applycal.correction=commonscalarphase showcounts=false ../../src/NDPPP msin=tNDPPP-generic.MS msout=. msout.datacolumn=DATA3 steps=[applycal] applycal.parmdb=tApplyCal.parmdb applycal.correction=commonscalarphase showcounts=false
$taqlexe 'select from tNDPPP-generic.MS where not(all(DATA~=DATA3))' > taql.out $taqlexe 'select from tNDPPP-generic.MS where not(all(DATA~=DATA3))' > taql.out
diff taql.out taql.ref || exit 1 diff taql.out taql.ref || exit 1
echo; echo "Testing ScalarAmplitude values"
rm -rf tApplyCal.parmdb
../../../../ParmDB/src/parmdbm <<EOL
open table="tApplyCal.parmdb"
add ScalarAmplitude:CS001HBA0 values=[3.,3.,3.,3.], domain=[10e6, 200e6, 4472025735, 4972025795], shape=[2,2], shape=[2,2]
add ScalarAmplitude:CS002HBA0 values=[3.,3.,3.,3.], domain=[10e6, 200e6, 4472025735, 4972025795], shape=[2,2], shape=[2,2]
add ScalarAmplitude:CS002HBA1 values=[3.,3.,3.,3.], domain=[10e6, 200e6, 4472025735, 4972025795], shape=[2,2], shape=[2,2]
add ScalarAmplitude:CS004HBA1 values=[3.,3.,3.,3.], domain=[10e6, 200e6, 4472025735, 4972025795], shape=[2,2], shape=[2,2]
add ScalarAmplitude:RS106HBA values=[3.,3.,3.,3.], domain=[10e6, 200e6, 4472025735, 4972025795], shape=[2,2], shape=[2,2]
add ScalarAmplitude:RS208HBA values=[3.,3.,3.,3.], domain=[10e6, 200e6, 4472025735, 4972025795], shape=[2,2], shape=[2,2]
add ScalarAmplitude:RS305HBA values=[3.,3.,3.,3.], domain=[10e6, 200e6, 4472025735, 4972025795], shape=[2,2], shape=[2,2]
add ScalarAmplitude:RS307HBA values=[3.,3.,3.,3.], domain=[10e6, 200e6, 4472025735, 4972025795], shape=[2,2], shape=[2,2]
EOL
../../src/NDPPP msin=tNDPPP-generic.MS msout=. msout.datacolumn=DATA3 steps=[applycal] applycal.parmdb=tApplyCal.parmdb applycal.correction=scalaramplitude showcounts=false
$taqlexe 'select from tNDPPP-generic.MS where not(all(DATA~=9*DATA3))' > taql.out
diff taql.out taql.ref || exit 1
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment