casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Attributes | List of all members
casa::vi::LayeredVi2Factory Class Reference

A factory for generating ViImplementation2 layers that optionally include calibration (via CalibratingVi2) and time-averaging (via AveragingTvi2). More...

#include <LayeredVi2Factory.h>

Inheritance diagram for casa::vi::LayeredVi2Factory:
casa::vi::ViFactory

Public Member Functions

 LayeredVi2Factory (casacore::MeasurementSet *ms, IteratingParameters *iterpar, AveragingParameters *avepar=0)
 Non-calibrating version. More...
 
 LayeredVi2Factory (casacore::MeasurementSet *ms, IteratingParameters *iterpar, const casacore::Record &calrec, AveragingParameters *avepar=0)
 Calibrating version, via CalLib Record. More...
 
 LayeredVi2Factory (casacore::MeasurementSet *ms, IteratingParameters *iterpar, const casacore::String &callib, AveragingParameters *avepar=0)
 Calibrating version, vis CalLib casacore::String (filename or casacore::String) More...
 
 ~LayeredVi2Factory ()
 
vi::ViImplementation2createVi () const
 
vi::ViImplementation2createVi (vi::ViImplementation2 *) const
 
- Public Member Functions inherited from casa::vi::ViFactory
virtual ~ViFactory ()
 

Private Attributes

casacore::MeasurementSetms_p
 
vi::IteratingParametersiterpar_p
 
vi::AveragingParametersavepar_p
 
casacore::Bool doCal_p
 
casacore::String callib_p
 
casacore::Record calrec_p
 
casacore::Int nlayer_p
 
CalibratingVi2FactoryIcalvi2factory_p
 

Additional Inherited Members

Detailed Description

A factory for generating ViImplementation2 layers that optionally include calibration (via CalibratingVi2) and time-averaging (via AveragingTvi2).

Intended use:

Public interface

Prerequisite

Etymology

Factory for layered ViImplementation2 construction

Synopsis

LayeredVi2Factory generates a Visibility Iterator implementation (ViImplementation2) object that can be plugged into a Visibility Iterator (VisibilityIterator2) object, so that the user can access the data using the Visibility Iterator interface. The ViImplementation2 generated by this factory consists of an underlying VisibilityIteratorImpl2, and (optionally) CalibratingVi2 and AveragingTvi2 ViImplementation2s, thereby supporting these operations in sequence. When both calibration and averaging are invoked, calibration is hard-wired to occur first.

Motivation

This class makes the combination of OTF calibration application and time-averaging portable, and available to all VisibilityIterator2 users.

Example

External usage is quite simple, and compliant with the 'normal' VI/VB framework.

The user first makes objects describing the data iteration, calibration parameters, and averaging parameters:

IteratingParameters iterpar(60.0); // 60s chunk interval
casacore::Float calfactor(100.0); // a simple factor with which to multiply the data
casacore::Record calrec; // (in leiu of full VisEquation functionality (TBD)
calrec.define("calfactor",calfactor); // in a casacore::Record
AveragingParameters avepar(10.0); // 10s averaging

Then these parameter objects, along with a casacore::MeasurementSet pointer, are used to make a factory suitable for the generic VisibilityIterator2 ctor, which is then invoked

casacore::MeasurementSet *ms(....); // typically from elsewhere, e.g., selected
LayeredVi2Factory factory(ms,&iterpar,calrec,&avepar);
vi::VisibilityIterator2 *visIter = new vi::VisibilityIterator2 (factory);
vi::VisBuffer2 *visBuffer = visIter->getVisBuffer();

Once this is done one can normally iterate and access OTF calibrated and averaged data:

while (visIter->moreChunks())
{
visIter->origin();
while (visIter->more())
{
// the following will have been calibrated and averaged to 10s
casacore::Vector<casacore::Int> ddi = visBuffer->dataDescriptionIds();
casacore::Vector<casacore::Int> antenna1 = visBuffer->antenna1();
casacore::Vector<casacore::Int> antenna2 = visBuffer->antenna2();
casacore::Cube<casacore::Complex> cvis = visBuffer->visCubeCorrected();
visIter->next();
}
visIter->nextChunk();
}

casacore::Notice that it is the responsibility of the application layer to delete the VisibilityIterator2 pointer returned by the factory method. However the life cycle of the VisBuffer2 object is responsibility of the VisibilityIterator2 object.

delete visIter;

Definition at line 134 of file LayeredVi2Factory.h.

Constructor & Destructor Documentation

casa::vi::LayeredVi2Factory::LayeredVi2Factory ( casacore::MeasurementSet ms,
IteratingParameters iterpar,
AveragingParameters avepar = 0 
)

Non-calibrating version.

casa::vi::LayeredVi2Factory::LayeredVi2Factory ( casacore::MeasurementSet ms,
IteratingParameters iterpar,
const casacore::Record calrec,
AveragingParameters avepar = 0 
)

Calibrating version, via CalLib Record.

casa::vi::LayeredVi2Factory::LayeredVi2Factory ( casacore::MeasurementSet ms,
IteratingParameters iterpar,
const casacore::String callib,
AveragingParameters avepar = 0 
)

Calibrating version, vis CalLib casacore::String (filename or casacore::String)

casa::vi::LayeredVi2Factory::~LayeredVi2Factory ( )

Member Function Documentation

vi::ViImplementation2* casa::vi::LayeredVi2Factory::createVi ( ) const
virtual

Implements casa::vi::ViFactory.

vi::ViImplementation2* casa::vi::LayeredVi2Factory::createVi ( vi::ViImplementation2 ) const
inline

Definition at line 156 of file LayeredVi2Factory.h.

Member Data Documentation

vi::AveragingParameters* casa::vi::LayeredVi2Factory::avepar_p
private

Definition at line 163 of file LayeredVi2Factory.h.

casacore::String casa::vi::LayeredVi2Factory::callib_p
private

Definition at line 165 of file LayeredVi2Factory.h.

casacore::Record casa::vi::LayeredVi2Factory::calrec_p
private

Definition at line 166 of file LayeredVi2Factory.h.

CalibratingVi2FactoryI* casa::vi::LayeredVi2Factory::calvi2factory_p
private

Definition at line 168 of file LayeredVi2Factory.h.

casacore::Bool casa::vi::LayeredVi2Factory::doCal_p
private

Definition at line 164 of file LayeredVi2Factory.h.

vi::IteratingParameters* casa::vi::LayeredVi2Factory::iterpar_p
private

Definition at line 162 of file LayeredVi2Factory.h.

casacore::MeasurementSet* casa::vi::LayeredVi2Factory::ms_p
private

Definition at line 156 of file LayeredVi2Factory.h.

casacore::Int casa::vi::LayeredVi2Factory::nlayer_p
private

Definition at line 167 of file LayeredVi2Factory.h.


The documentation for this class was generated from the following file: