Source
//cout << "ntrue(sdb.flagCube()(slice)) = " << ntrue(sdb.flagCube()(Slice(),Slice(focusChan0,1,1),Slice())) << endl;
//# tSolveDataBuffer.cc: Tests the SolveDataBuffer
//# Copyright (C) 1995,1999,2000,2001
//# 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 <casa/aips.h>
//#include <casa/Exceptions/Error.h>
//#include <casa/Quanta/MVTime.h>
//#include <casa/iomanip.h>
//#include <casa/namespace.h>
using namespace std;
using namespace casa;
using namespace casacore;
using namespace casa::vi;
class SolveDataBufferTest : public ::testing::Test {
public:
SolveDataBufferTest() :
nAnt(5),
nCorr(4),
nChan(2),
nRow(nAnt*(nAnt-1)/2),
a1(nRow,-1),
a2(nRow,-1),
c0(9,1.0)
{
VisBuffer2 *vb0 = VisBuffer2::factory(VbRekeyable);
// The basic shape
vb0->setShape(nCorr,nChan,nRow);
// Meta info
vb0->setObservationId(Vector<Int>(nRow,0)); // obsid=0
vb0->setArrayId(Vector<Int>(nRow,0)); // arrid=0
vb0->setScan(Vector<Int>(nRow,1)); // scan #1
vb0->setFieldId(Vector<Int>(nRow,1)); // fieldid=0
vb0->setTime(Vector<Double>(nRow,1e9)); // time
vb0->setTimeCentroid(Vector<Double>(nRow,1e9)); // time
vb0->setDataDescriptionIds(Vector<int>(nRow,0)); // ddid=0
vb0->setSpectralWindows(Vector<int>(nRow,0)); // spw=0
Int irow(0);
for (Int i=0;i<nAnt-1;++i) {
for (Int j=i+1;j<nAnt;++j,irow++) {
a1(irow)=i;
a2(irow)=j;
}
}
vb0->setAntenna1(a1);
vb0->setAntenna2(a2);
// Data, etc.
vb0->setFlagRow(Vector<Bool>(nRow,False)); // unflagged
vb0->setFlagCube(Cube<Bool>(nCorr,nChan,nRow,False)); // unflagged
vb0->setWeightSpectrum(Cube<Float>(nCorr,nChan,nRow,1.0)); // all wt=1