Source
cout << "allNear(amplitude(vb->visCubeCorrected()(phands)),calfactor,tol) = " << allNear(amplitude(vb->visCubeCorrected()(phands)),calfactor,tol) << endl;
//# tCalSolVi2Organizer.cc: Tests CalSolVi2Organizer
//# Copyright (C) 1995,1999,2000,2001,2016
//# Associated Universities, Inc. Washington DC, USA.
//#
//# This program is free software; you can redistribute it and/or modify it
//# under the terms of the GNU General Public License as published by the Free
//# Software Foundation; either version 2 of the License, or (at your option)
//# any later version.
//#
//# This program is distributed in the hope that it will be useful, but WITHOUT
//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
//# more details.
//#
//# You should have received a copy of the GNU General Public License along
//# with this program; if not, write to the Free Software Foundation, Inc.,
//# 675 Massachusetts Ave, Cambridge, MA 02139, USA.
//#
//# Correspondence concerning AIPS++ should be addressed as follows:
//# Internet email: aips2-request@nrao.edu.
//# Postal address: AIPS++ Project Office
//# National Radio Astronomy Observatory
//# 520 Edgemont Road
//# Charlottesville, VA 22903-2475 USA
//#
//# $Id$
//#include <msvis/MSVis/SimpleSimVi2.h>
//#include <msvis/MSVis/AveragingVi2Factory.h>
//#include <mstransform/TVI/ChannelAverageTVI.h>
using namespace std;
using namespace casa;
using namespace casacore;
using namespace casa::vi;
int main(int argc, char **argv) {
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
// A function to test the contents of vb.antenna1 and vb.antenna2
Bool testA1A2(const Vector<Int>& a1, const Vector<Int>& a2, Int nAnt, Bool doAC=False) {
Int nBln=nAnt*(nAnt-1)/2;
Int da=1;
if (doAC) {
nBln+=nAnt;
da=0;
}
Bool ok(True);
Int k=0;
for (Int i=0;i<nAnt-da;++i) {
for (Int j=i+da;j<nAnt;++j) {
ok &= (i==a1[k]);
ok &= (j==a2[k]);
// cout << k << ": " << i << "-" << j << " " << a1[k] << "-" << a2[k] << endl;
++k;
}
}
return ok;
}
TEST( CalSolVi2Organizer , BasicCalSolveLayerTest ) {
// A very rudimentary test of Cal Solving layer
CalSolVi2Organizer vi2org;
vi2org.addSimIO();
Float calfactor(2.333);
vi2org.addCalForSolving(calfactor);
Int nSol;
Vector<Int> nChunkPerSol;
nSol=vi2org.countSolutions(nChunkPerSol);
//cout << "nSol=" << nSol << endl;