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

Task #11550: fix test and the bug it did not catch

parent 0d11d943
No related branches found
No related tags found
No related merge requests found
......@@ -499,14 +499,14 @@ namespace LOFAR {
info().antennaNames()[ant],
times, freqs,
pol, itsDirection);
weights = itsSolTab.getValuesOrWeights("val",
weights = itsSolTab.getValuesOrWeights("weight",
info().antennaNames()[ant], times, freqs, pol, itsDirection);
applyFlags(parmvalues[pol*2][ant], weights);
parmvalues[pol*2+1][ant] = itsSolTab2.getValuesOrWeights("val",
info().antennaNames()[ant],
times, freqs,
pol, itsDirection);
weights = itsSolTab2.getValuesOrWeights("val",
weights = itsSolTab2.getValuesOrWeights("weight",
info().antennaNames()[ant], times, freqs, pol, itsDirection);
applyFlags(parmvalues[pol*2+1][ant], weights);
}
......@@ -517,7 +517,7 @@ namespace LOFAR {
info().antennaNames()[ant],
times, freqs,
pol, itsDirection);
weights = itsSolTab.getValuesOrWeights("val",
weights = itsSolTab.getValuesOrWeights("weight",
info().antennaNames()[ant], times, freqs, pol, itsDirection);
applyFlags(parmvalues[pol][ant], weights);
}
......
......@@ -203,20 +203,19 @@ private:
if (itsDoTest) {
//cout<<endl;
for (int bl=0; bl<1; ++bl) {
for (uint bl=0; bl<info().nbaselines(); ++bl) {
for (int chan=0; chan<itsNChan; ++chan) {
uint ant1 = info().getAnt1()[bl];
uint ant2 = info().getAnt2()[bl];
// Square root of autocorrelation for first antenna
complex<float> val = sqrt(buf.getData().data()[bl*itsNCorr*itsNChan + chan*itsNCorr]);
//cout<<val<<"\t";
ASSERT(near(rightTimes[itsTimeStep]*100 + rightFreqs[chan], val));
bool flag = buf.getFlags().data()[bl*itsNCorr*itsNChan + chan*itsNCorr];
if ((ant1==1 || ant2==1) && itsTimeStep==2 && chan==3) {
if ((ant1==1 || ant2==1) && rightTimes[itsTimeStep]==2 && rightFreqs[chan]==2) {
ASSERT(flag);
} else {
ASSERT(!flag);
ASSERT(near(rightTimes[itsTimeStep]*100 + rightFreqs[chan], val));
}
}
}
......@@ -340,7 +339,7 @@ void createH5Parm(vector<double> times, vector<double> freqs) {
for (uint f=0; f<nfreqs; ++f) {
values[ant*ntimes*nfreqs+t*nfreqs + f] = 1./(100.*(t%100)+(1+f));
weights[ant*ntimes*nfreqs+t*nfreqs + f] = 1.;
if (ant==1 && t==2 && f==3) {
if (ant==1 && t==2 && f==1) {
weights[ant*ntimes*nfreqs+t*nfreqs + f] = 0.;
}
}
......
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