Source
void CalSolVi2Organizer::addCalForSolving(VisEquation& ve, const Bool& corrDepFlags) {
//# CalSolVi2Organizer.cc: Definition of CalSolVi2Organizer
//# Copyright (C) 2016
//# Associated Universities, Inc. Washington DC, USA.
//#
//# This library is free software; you can redistribute it and/or modify it
//# under the terms of the GNU Library General Public License as published by
//# the Free Software Foundation; either version 2 of the License, or (at your
//# option) any later version.
//#
//# This library 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 Library General Public
//# License for more details.
//#
//# You should have received a copy of the GNU Library General Public License
//# along with this library; if not, write to the Free Software Foundation,
//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
//#
//# Correspondence concerning AIPS++ should be adressed 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
//#
//#
//#include <casacore/ms/MeasurementSets/MeasurementSet.h>
using namespace casacore;
namespace casa { //# NAMESPACE CASA - BEGIN
using namespace vi;
// Constructor
CalSolVi2Organizer::CalSolVi2Organizer() :
data_(NULL),
cal_(NULL),
chanave_(NULL),
timeave_(NULL),
calfilter_(NULL),
factories_(),
vi_(NULL)
{
// nothing else
}
// Destructor
CalSolVi2Organizer::~CalSolVi2Organizer()
{
cleanUp();
}
vi::VisibilityIterator2& CalSolVi2Organizer::makeFullVI() {
AlwaysAssert(factories_.nelements()>0, casacore::AipsError);
if (vi_) delete vi_;
vi_=new VisibilityIterator2(factories_);
return *vi_;
}
int CalSolVi2Organizer::countSolutions(casacore::Vector<int>& nChunkPerSolve) {
// TBD: Make this smart w.r.t. combine options...
AlwaysAssert(factories_.nelements()>0, AipsError);
// A local (temporary) VI2 using just the bottom layer
// This assumes each solutions constains data
// from one or more chunk in the bottom layer
// (i.e., one chunk contains data for at most
// one distict solution)
// Using this VI2 (rather than the full one) ensures
// that we do not invoke the averaging layers
// in non-trivial ways
// (NB:the loop below will need to vi.origin() to
// examine times and indices to handle
// non-trivial solution-counting cases, e.g.,
// combine='spw', etc.)