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

GroupProcessor goes through one or more MeasurementSets, feeding VisBuffGroups to a GroupWorker. More...

#include <GroupProcessor.h>

Public Member Functions

 GroupProcessor (ROVisibilityIterator &vi, GroupWorkerBase *gw, casacore::Double groupInterval=0.0)
 Construct from a ROVisibilityIterator (provides the data) and a pointer to a GroupWorker (does something with the data). More...
 
casacore::Double groupInterval ()
 // Copy construct. More...
 
void setGroupInterval (casacore::Double gi)
 
casacore::Bool go ()
 Once it's all set up, you should just have to tell it to go! Returns true/false depending on whether it thinks it went all the way. More...
 
void setTVIDebug (bool debug)
 

Static Public Member Functions

static casacore::String getAipsRcBase ()
 

Private Member Functions

void setGroupOrigin ()
 
casacore::Bool groupHasMore ()
 

Private Attributes

ROVisibilityIterator vi_p
 should be added to the group. More...
 
GroupWorkerBasegw_p
 
casacore::Double groupInterval_p
 
casacore::Vector
< casacore::Double
timev_p
 Uninitialized by c'tor. More...
 
casacore::Double groupStart_p
 
bool tvi_debug
 

Detailed Description

GroupProcessor goes through one or more MeasurementSets, feeding VisBuffGroups to a GroupWorker.

Intended use:

Public interface

Review Status

Date Reviewed:
yyyy/mm/dd

Prerequisite

Etymology

The GroupProcessor processes one VisBuffGroup after another.

Synopsis

GroupProcessor handles iteration with by groups of chunklets for one or more MSs.

Example

VBGContinuumSubtractor is a GroupWorker. VBGContinuumSubtractor vbgcs(msOut_p, fitorder_p);

sort is a casacore::Block<casacore::Int> with the right columns. VisibilityIterator viIn(mssel_p, sort, 0.0);

GroupProcessor rogp(viIn, &vbgcs); casacore::Bool success = rogp.go(); // Encapsulates the nested for loops.

Motivation

For imaging and calibration you need to access an casacore::MS in some consistent order (by field, spectralwindow, time interval etc.). This class provides that access. Furthermore, some calculations or applications need more than one VisBuffer. For example, one might want to estimate and subtract the continuum from the visibilities of an casacore::MS that has a broad line completely spanning spw 1, but spws 0 and 2 line-free, so the spws should be combined (combine='spw') for the continuum estimation.

It is much more efficient if the group of necessary data can be read only once, worked on, and then written. The CalTable approach is more flexible in that a CalTable can be applied to an casacore::MS with a different number or arrangement of rows from the input casacore::MS, but per chunk it requires two more reads (the CalTable and the output casacore::MS) and an extra write (the CalTable).

Another goal is to encapsulate the commonly repeated boilerplate of setting up VisIters and VisBuffers, and then looping over chunks and then chunklets.

A separate GroupProcessor is needed so the input casacore::MS can be declared const.

Thrown Exceptions

Definition at line 112 of file GroupProcessor.h.

Constructor & Destructor Documentation

casa::GroupProcessor::GroupProcessor ( ROVisibilityIterator vi,
GroupWorkerBase gw,
casacore::Double  groupInterval = 0.0 
)

Construct from a ROVisibilityIterator (provides the data) and a pointer to a GroupWorker (does something with the data).

vi should be set up (selection, slurping, and sort order specified) before calling this, but this will call vi.originChunks() and drive the iteration.

Member Function Documentation

static casacore::String casa::GroupProcessor::getAipsRcBase ( )
inlinestatic

Definition at line 145 of file GroupProcessor.h.

casacore::Bool casa::GroupProcessor::go ( )

Once it's all set up, you should just have to tell it to go! Returns true/false depending on whether it thinks it went all the way.

casacore::Bool casa::GroupProcessor::groupHasMore ( )
private
casacore::Double casa::GroupProcessor::groupInterval ( )
inline

// Copy construct.

This calls the assigment operator. GroupProcessor(const GroupProcessor & other){ vi_p = other.vi_p ? other.vi_p->clone(&(this->vi_p)) : NULL; }

Assigment. Any attached VisBuffers are lost in the assign. GroupProcessor & operator=(const GroupProcessor &other); Destructor virtual ~GroupProcessor() {}; ~GroupProcessor() {};

Members

Return and set the "timebin" for each group, in s.

Definition at line 138 of file GroupProcessor.h.

References groupInterval_p.

void casa::GroupProcessor::setGroupInterval ( casacore::Double  gi)
inline

Definition at line 139 of file GroupProcessor.h.

References casacore::abs(), and groupInterval_p.

void casa::GroupProcessor::setGroupOrigin ( )
private
void casa::GroupProcessor::setTVIDebug ( bool  debug)
inline

Definition at line 147 of file GroupProcessor.h.

References debug, and tvi_debug.

Member Data Documentation

casacore::Double casa::GroupProcessor::groupInterval_p
private

Definition at line 157 of file GroupProcessor.h.

Referenced by groupInterval(), and setGroupInterval().

casacore::Double casa::GroupProcessor::groupStart_p
private

Definition at line 161 of file GroupProcessor.h.

GroupWorkerBase* casa::GroupProcessor::gw_p
private

Definition at line 156 of file GroupProcessor.h.

casacore::Vector<casacore::Double> casa::GroupProcessor::timev_p
private

Uninitialized by c'tor.

Definition at line 160 of file GroupProcessor.h.

bool casa::GroupProcessor::tvi_debug
private

Definition at line 162 of file GroupProcessor.h.

Referenced by setTVIDebug().

ROVisibilityIterator casa::GroupProcessor::vi_p
private

should be added to the group.

Initialized by c'tor.

Definition at line 155 of file GroupProcessor.h.


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