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

A top level class defining the data handling interface for the MSTransform module. More...

#include <MSTransformIteratorFactory.h>

Inheritance diagram for casa::MSTransformIteratorFactory:
casa::vi::ViFactory

Public Member Functions

 MSTransformIteratorFactory (casacore::Record &configuration)
 
 MSTransformIteratorFactory (casacore::Record &configuration, casacore::MrsEligibility &eligibleSubTables)
 
 ~MSTransformIteratorFactory ()
 
std::vector< casacore::IPositiongetVisBufferStructure ()
 
vi::VisibilityIterator2getInputVI ()
 
- Public Member Functions inherited from casa::vi::ViFactory
virtual ~ViFactory ()
 

Protected Member Functions

void setConfiguration (casacore::Record &configuration)
 
void initializeManager ()
 
vi::ViImplementation2createVi () const
 

Private Attributes

casacore::Record configuration_p
 
casacore::String tmpMSFileName_p
 
std::shared_ptr
< MSTransformManager
manager_p
 
casacore::MrsEligibility eligibleSubTables_p
 

Detailed Description

A top level class defining the data handling interface for the MSTransform module.

Intended use:

Public interface

Prerequisite

Etymology

MSTransformFactory is a class that generates a Visibility Iterator implementation based on mstransform

Synopsis

MSTransformFactory 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.

Motivation

The idea is that an external application (plotms, imaging) can consume data transformed using the mstransform code via a Visibility Iterator interface

Example

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

The user defines a dictionary with the parameters that would be normally passed to test_mstransform (therefore I point to task_mstransform help for doubts regarding the parameters)

casacore::Record configuration;
configuration.define ("inputms", filename);
configuration.define ("spw", "8,9,10,11");
configuration.define ("antenna", "1&&2");
configuration.define ("combinespws", true);
configuration.define ("regridms", true);
configuration.define ("mode", "channel");
configuration.define ("width", "2");
configuration.define ("timeaverage", true);
configuration.define ("timebin", "30s");

casacore::Notice that some parameters don't make sense in the context of a VI/VB interface: outputms tileshape datacolumn realmodelcol usewtspectrum

With this configuration record the factory class MSTransformIteratorFactory will create internally a MSTransformIterator and return a pointer to a VisibilityIterator2 object whose implementation is the newly created MSTransformIterator.

MSTransformIteratorFactory factory(configuration);
vi::VisibilityIterator2 *visIter = new vi::VisibilityIterator2 (factory);
vi::VisBuffer2 *visBuffer = visIter->getVisBuffer();

Once this is done one can normally iterate and access the transformed data:

visIter->originChunks();
while (visIter->moreChunks())
{
visIter->origin();
while (visIter->more())
{
casacore::Vector<casacore::Int> ddi = visBuffer->dataDescriptionIds();
casacore::Vector<casacore::Int> antenna1 = visBuffer->antenna1();
casacore::Vector<casacore::Int> antenna2 = visBuffer->antenna2();
// Etc
visIter->next();
}
visIter->nextChunk();
}

It is also possible to access the transformed Sub-Tables (loaded in memory thanks to the casacore::Memory Resident Sub-Tables mechanism):

casacore::MSSpectralWindow transformedSpwTable = visIter->ms().spectralWindow();

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 141 of file MSTransformIteratorFactory.h.

Constructor & Destructor Documentation

casa::MSTransformIteratorFactory::MSTransformIteratorFactory ( casacore::Record configuration)
casa::MSTransformIteratorFactory::MSTransformIteratorFactory ( casacore::Record configuration,
casacore::MrsEligibility eligibleSubTables 
)
casa::MSTransformIteratorFactory::~MSTransformIteratorFactory ( )

Member Function Documentation

vi::ViImplementation2* casa::MSTransformIteratorFactory::createVi ( ) const
protectedvirtual

Implements casa::vi::ViFactory.

vi::VisibilityIterator2* casa::MSTransformIteratorFactory::getInputVI ( )
inline

Definition at line 151 of file MSTransformIteratorFactory.h.

References manager_p.

std::vector<casacore::IPosition> casa::MSTransformIteratorFactory::getVisBufferStructure ( )
void casa::MSTransformIteratorFactory::initializeManager ( )
protected
void casa::MSTransformIteratorFactory::setConfiguration ( casacore::Record configuration)
protected

Member Data Documentation

casacore::Record casa::MSTransformIteratorFactory::configuration_p
private

Definition at line 161 of file MSTransformIteratorFactory.h.

casacore::MrsEligibility casa::MSTransformIteratorFactory::eligibleSubTables_p
private

Definition at line 164 of file MSTransformIteratorFactory.h.

std::shared_ptr<MSTransformManager> casa::MSTransformIteratorFactory::manager_p
mutableprivate

Definition at line 163 of file MSTransformIteratorFactory.h.

Referenced by getInputVI().

casacore::String casa::MSTransformIteratorFactory::tmpMSFileName_p
private

Definition at line 162 of file MSTransformIteratorFactory.h.


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