Skip to content
Snippets Groups Projects
Commit 8b0c2f28 authored by Andre Offringa's avatar Andre Offringa
Browse files

Task #11550: Apply full Jones HDF5 solutions that are separated in amplitude and phase

parent 05c536c3
No related branches found
No related tags found
No related merge requests found
...@@ -108,6 +108,7 @@ namespace LOFAR { ...@@ -108,6 +108,7 @@ namespace LOFAR {
H5Parm itsH5Parm; H5Parm itsH5Parm;
string itsSolTabName; string itsSolTabName;
H5Parm::SolTab itsSolTab; H5Parm::SolTab itsSolTab;
H5Parm::SolTab itsSolTab2; // in the case of full Jones, amp and phase table need to be open
CorrectType itsCorrectType; CorrectType itsCorrectType;
bool itsInvert; bool itsInvert;
uint itsTimeSlotsPerParmUpdate; uint itsTimeSlotsPerParmUpdate;
......
...@@ -101,9 +101,14 @@ namespace LOFAR { ...@@ -101,9 +101,14 @@ namespace LOFAR {
itsSolTabName = (parset.isDefined(prefix + "correction") ? itsSolTabName = (parset.isDefined(prefix + "correction") ?
parset.getString(prefix + "correction") : parset.getString(prefix + "correction") :
parset.getString(defaultPrefix + "correction")); parset.getString(defaultPrefix + "correction"));
itsSolTab = itsH5Parm.getSolTab(itsSolTabName);
itsCorrectType = stringToCorrectType(itsSolTab.getType()); itsCorrectType = stringToCorrectType(itsSolTab.getType());
if(itsCorrectType == FULLJONES)
{
itsSolTab = itsH5Parm.getSolTab("amplitude");
itsSolTab2 = itsH5Parm.getSolTab("phase");
}
else
itsSolTab = itsH5Parm.getSolTab(itsSolTabName);
if (itsCorrectType==PHASE && nPol("")==1) { if (itsCorrectType==PHASE && nPol("")==1) {
itsCorrectType = SCALARPHASE; itsCorrectType = SCALARPHASE;
} }
...@@ -448,7 +453,7 @@ namespace LOFAR { ...@@ -448,7 +453,7 @@ namespace LOFAR {
#pragma omp critical(updateH5ParmValues) #pragma omp critical(updateH5ParmValues)
{ {
// TODO: understand polarization etc. // TODO: understand polarization etc.
ASSERT(itsParmExprs.size()==1 || itsParmExprs.size()==2); // ASSERT(itsParmExprs.size()==1 || itsParmExprs.size()==2);
// Figure out whether time or frequency is first axis // Figure out whether time or frequency is first axis
bool freqvariesfastest = true; bool freqvariesfastest = true;
...@@ -469,12 +474,28 @@ namespace LOFAR { ...@@ -469,12 +474,28 @@ namespace LOFAR {
} }
for (uint ant = 0; ant < numAnts; ++ant) { for (uint ant = 0; ant < numAnts; ++ant) {
for (uint pol=0; pol<itsParmExprs.size(); ++pol) { if(itsCorrection == FULLJONES)
parmvalues[pol][ant] = itsSolTab.getValuesOrWeights("val", {
info().antennaNames()[ant], for (uint pol=0; pol<4; ++pol) {
times, freqs, // Place amplitude in even and phase in odd elements
pol, itsDirection); parmvalues[pol*2][ant] = itsSolTab.getValuesOrWeights("val",
} info().antennaNames()[ant],
times, freqs,
pol, itsDirection);
parmvalues[pol*2+1][ant] = itsSolTab2.getValuesOrWeights("val",
info().antennaNames()[ant],
times, freqs,
pol, itsDirection);
}
}
else {
for (uint pol=0; pol<itsParmExprs.size(); ++pol) {
parmvalues[pol][ant] = itsSolTab.getValuesOrWeights("val",
info().antennaNames()[ant],
times, freqs,
pol, itsDirection);
}
}
} }
} // End pragma omp critical } // End pragma omp critical
} else { // Use ParmDB } else { // Use ParmDB
......
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