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

Task #9178: fix bug for second polarization in stefcal

parent dbbd9f58
No related branches found
No related tags found
No related merge requests found
...@@ -52,6 +52,7 @@ namespace LOFAR { ...@@ -52,6 +52,7 @@ namespace LOFAR {
casa::Matrix<casa::DComplex> g; // Station, correlation casa::Matrix<casa::DComplex> g; // Station, correlation
casa::Array<casa::DComplex> vis; casa::Array<casa::DComplex> vis;
casa::Array<casa::DComplex> mvis; casa::Array<casa::DComplex> mvis;
uint savedNCr; // number of correlations stored (1,2 or 4)
private: private:
casa::Matrix<casa::DComplex> gx; casa::Matrix<casa::DComplex> gx;
...@@ -61,7 +62,7 @@ namespace LOFAR { ...@@ -61,7 +62,7 @@ namespace LOFAR {
casa::Matrix<casa::DComplex> z; casa::Matrix<casa::DComplex> z;
uint nSt; // number of stations uint nSt; // number of stations
uint nCr; // number of correlations uint nCr; // number of correlations (1 or 4)
uint nUn; // number of unknowns uint nUn; // number of unknowns
uint nSp; // number that is two for scalarphase, one else uint nSp; // number that is two for scalarphase, one else
uint _solInt; uint _solInt;
......
...@@ -411,12 +411,12 @@ namespace LOFAR { ...@@ -411,12 +411,12 @@ namespace LOFAR {
// Stefcal terminated (either by maxiter or by converging) // Stefcal terminated (either by maxiter or by converging)
// Let's save G... // Let's save G...
Cube<DComplex> allg(info().antennaNames().size(), nCr, itsNFreqCells); Cube<DComplex> allg(info().antennaNames().size(), iS[0].savedNCr, itsNFreqCells);
for (uint freqCell=0; freqCell<itsNFreqCells; ++freqCell) { for (uint freqCell=0; freqCell<itsNFreqCells; ++freqCell) {
//cout<<endl<<"freqCell="<<freqCell<<", timeCell="<<itsTStep/itsSolInt<<", tstep="<<itsTStep<<endl; //cout<<endl<<"freqCell="<<freqCell<<", timeCell="<<itsTStep/itsSolInt<<", tstep="<<itsTStep<<endl;
casa::Matrix<casa::DComplex> sol = iS[freqCell].getSolution(); casa::Matrix<casa::DComplex> sol = iS[freqCell].getSolution();
for (uint st=0; st<info().antennaNames().size(); st++) { for (uint st=0; st<info().antennaNames().size(); st++) {
for (uint cr=0; cr<nCr; ++cr) { for (uint cr=0; cr<iS[0].savedNCr; ++cr) {
allg(st,cr,freqCell)=sol(st,cr); allg(st,cr,freqCell)=sol(st,cr);
} }
} }
......
...@@ -65,14 +65,17 @@ namespace LOFAR { ...@@ -65,14 +65,17 @@ namespace LOFAR {
nUn=nSt; nUn=nSt;
nCr=4; nCr=4;
nSp=1; nSp=1;
savedNCr=4;
} else if (_mode=="scalarphase") { } else if (_mode=="scalarphase") {
nUn=nSt; nUn=nSt;
nCr=1; nCr=1;
nSp=2; nSp=2;
savedNCr=1;
} else { // mode=="phaseonly", mode=="diagonal" } else { // mode=="phaseonly", mode=="diagonal"
nUn=nSt*2; nUn=nSt*2;
nCr=1; nCr=1;
nSp=1; nSp=1;
savedNCr=2;
} }
g.resize(nUn,nCr); g.resize(nUn,nCr);
...@@ -226,11 +229,7 @@ namespace LOFAR { ...@@ -226,11 +229,7 @@ namespace LOFAR {
casa::Matrix<casa::DComplex> StefCal::getSolution() { casa::Matrix<casa::DComplex> StefCal::getSolution() {
casa::Matrix<casa::DComplex> sol; casa::Matrix<casa::DComplex> sol;
if (_mode=="diagonal" || _mode=="phaseonly") { sol.resize(_antMap.size(), savedNCr);
sol.resize(_antMap.size(), 2);
} else {
sol.resize(_antMap.size(), nCr);
}
uint sSt=0; // Index in stefcal numbering uint sSt=0; // Index in stefcal numbering
for (uint st=0; st<_antMap.size(); ++st) { for (uint st=0; st<_antMap.size(); ++st) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment