Source
//cout << "vCC=" << Vector<Complex>(vb2->visCubeCorrected()(Slice(),Slice(nChan/2),Slice(0))) << endl;
//# tDJones: test polarization terms
//# Copyright (C) 2013
//# 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
//#
using namespace std;
using namespace casa;
using namespace casacore;
using namespace casa::vi;
// <summary>
// Test program for KJones-related classes
// </summary>
// Control verbosity
int main(int argc, char **argv) {
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
// Ad hoc D-term refant application (TBD: use a DJones method)
void Dref(Cube<Complex>& D,Int refant=0,
Complex rval=Complex(0.0f)) {
Int nChan=D.shape()(1);
for (Int ich=0;ich<nChan;++ich) {
const Complex D0=D(0,ich,refant)-rval;
Array<Complex> Dl(D(Slice(1,1,1),Slice(ich),Slice()));
Dl+=conj(D0);
Array<Complex> Dr(D(Slice(0,1,1),Slice(ich),Slice()));
Dr-=D0;
}
}
class DJonesUNPOLarizedTest : public VisCalTestBase {
public:
Cube<Complex> d;
DJonesUNPOLarizedTest() :
VisCalTestBase(1,3,1,50,4,1,10,false), // 3 scans, UNpolarized
d(2,nChan,nAnt,Complex(0.0))
{
for (Int iant=0;iant<nAnt;++iant) {
d(Slice(0,1,1),Slice(),Slice(iant,1,1))=Complex(iant*0.01,iant*0.02);
d(Slice(1,1,1),Slice(),Slice(iant,1,1))=Complex(iant*0.02,iant*0.01);
}