casa
$Rev:20696$
|
class Block; class MeasurementSet; More...
#include <GroupProcessor.h>
Public Member Functions | |
GroupProcessor (ROVisibilityIterator &vi, GroupWorkerBase *gw, Double groupInterval=0.0) | |
Construct from a ROVisibilityIterator (provides the data) and a pointer to a GroupWorker (does something with the data). | |
Double | groupInterval () |
// Copy construct. | |
void | setGroupInterval (Double gi) |
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. | |
Static Public Member Functions | |
static String | getAipsRcBase () |
Private Member Functions | |
void | setGroupOrigin () |
Bool | groupHasMore () |
Private Attributes | |
ROVisibilityIterator | vi_p |
should be added to the group. | |
GroupWorkerBase * | gw_p |
Double | groupInterval_p |
Vector< Double > | timev_p |
Uninitialized by c'tor. | |
Double | groupStart_p |
class Block; class MeasurementSet;
GroupProcessor goes through one or more MeasurementSets, feeding VisBuffGroups to a GroupWorker.
Public interface
The GroupProcessor processes one VisBuffGroup after another.
GroupProcessor handles iteration with by groups of chunklets for one or more MSs.
VBGContinuumSubtractor is a GroupWorker. VBGContinuumSubtractor vbgcs(msOut_p, fitorder_p);
sort is a Block<Int> with the right columns. VisibilityIterator viIn(mssel_p, sort, 0.0);
GroupProcessor rogp(viIn, &vbgcs); Bool success = rogp.go(); // Encapsulates the nested for loops.
For imaging and calibration you need to access an 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 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 MS with a different number or arrangement of rows from the input MS, but per chunk it requires two more reads (the CalTable and the output 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 MS can be declared const.
Definition at line 108 of file GroupProcessor.h.
casa::GroupProcessor::GroupProcessor | ( | ROVisibilityIterator & | vi, |
GroupWorkerBase * | gw, | ||
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.
static String casa::GroupProcessor::getAipsRcBase | ( | ) | [inline, static] |
Definition at line 141 of file GroupProcessor.h.
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.
Bool casa::GroupProcessor::groupHasMore | ( | ) | [private] |
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 134 of file GroupProcessor.h.
References groupInterval_p.
void casa::GroupProcessor::setGroupInterval | ( | Double | gi | ) | [inline] |
Definition at line 135 of file GroupProcessor.h.
References casa::abs(), and groupInterval_p.
void casa::GroupProcessor::setGroupOrigin | ( | ) | [private] |
Double casa::GroupProcessor::groupInterval_p [private] |
Definition at line 151 of file GroupProcessor.h.
Referenced by groupInterval(), and setGroupInterval().
Double casa::GroupProcessor::groupStart_p [private] |
Definition at line 155 of file GroupProcessor.h.
GroupWorkerBase* casa::GroupProcessor::gw_p [private] |
Definition at line 150 of file GroupProcessor.h.
Vector<Double> casa::GroupProcessor::timev_p [private] |
Uninitialized by c'tor.
Definition at line 154 of file GroupProcessor.h.
should be added to the group.
Initialized by c'tor.
Definition at line 149 of file GroupProcessor.h.