casa
5.7.0-16
|
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... | |
GroupWorkerBase * | gw_p |
casacore::Double | groupInterval_p |
casacore::Vector < casacore::Double > | timev_p |
Uninitialized by c'tor. More... | |
casacore::Double | groupStart_p |
bool | tvi_debug |
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 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.
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.
Definition at line 112 of file GroupProcessor.h.
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.
|
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.
|
private |
|
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.
|
inline |
Definition at line 139 of file GroupProcessor.h.
References casacore::abs(), and groupInterval_p.
|
private |
|
inline |
Definition at line 147 of file GroupProcessor.h.
|
private |
Definition at line 157 of file GroupProcessor.h.
Referenced by groupInterval(), and setGroupInterval().
|
private |
Definition at line 161 of file GroupProcessor.h.
|
private |
Definition at line 156 of file GroupProcessor.h.
|
private |
Uninitialized by c'tor.
Definition at line 160 of file GroupProcessor.h.
|
private |
Definition at line 162 of file GroupProcessor.h.
Referenced by setTVIDebug().
|
private |
should be added to the group.
Initialized by c'tor.
Definition at line 155 of file GroupProcessor.h.