casa
$Rev:20696$
|
A class to store a group of VisBuffers. More...
#include <VisBuffGroup.h>
Public Member Functions | |
VisBuffGroup () | |
~VisBuffGroup () | |
Null destructor. | |
Bool | store (const VisBuffer &vb) |
Add a VisBuffer. | |
void | endChunk () |
Record the end of a chunk. | |
Bool | chunkEnd (const Int buf) const |
(See endChunk()) Returns whether or not vi.nextChunk() should be used when advancing past buffer number buf. | |
uInt | nBuf () const |
Replace the VisBuffer in slot buf with vb. | |
VisBuffer & | operator() (const Int buf) |
uInt nDDID() const {return nDDID_p;} uInt nFld() const {return nFld_p;} | |
Static Public Member Functions | |
static Bool | applyChanMask (Cube< Bool > &chanmaskedflags, const Vector< Bool > *chanmask, const VisBuffer &vb) |
// Returns the buffer index corresponding to data description ID ddid and field ID fld. | |
Private Member Functions | |
VisBuffGroup (const VisBuffGroup &) | |
Prohibit public copying and assignment. | |
VisBuffGroup & | operator= (const VisBuffGroup &) |
Private Attributes | |
uInt | nBuf_p |
// Numbers of data description ids and fields uInt nDDID_p, nFld_p, nBuf_p; | |
PtrBlock< VisBuffer * > | VB_p |
The list of buffers. | |
Vector< Bool > | endChunk_p |
A class to store a group of VisBuffers.
Public interface
It is a group of VisBuffers
This class stores a group of VisBuffers. Unlike VisBuffGroupAcc or VisBuffAccumulator, the VisBuffers are copied and stored in a nearly pristine state so that their individual contents can be accessed later (i.e. without any averaging). The only difference between a normal (or "fresh") VisBuffer and one retrieved from a VisBuffGroup is that VisBuffGroup detaches its VisBuffers from any underlying VisIter.
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).
Definition at line 83 of file VisBuffGroup.h.
Null destructor.
casa::VisBuffGroup::VisBuffGroup | ( | const VisBuffGroup & | ) | [private] |
Prohibit public copying and assignment.
static Bool casa::VisBuffGroup::applyChanMask | ( | Cube< Bool > & | chanmaskedflags, |
const Vector< Bool > * | chanmask, | ||
const VisBuffer & | vb | ||
) | [static] |
// Returns the buffer index corresponding to data description ID ddid and field ID fld.
Returns -1 if there is no such buffer.
Returns -(# of matching buffers) if there is > 1 match (use bufInds). Int bufInd(const Int ddid, const Int fld);
Returns the buffer indices corresponding to data description ID ddid and field ID fld. Vector<Int> bufInds(const Int ddid, const Int fld)
The flagging approach to channel selection. Sets chanmaskedflags to True wherever the channels in chanmask or flags in vb.flagCube() are True, resizing if necessary. Returns True/False on success/error (i.e. chanmask having a different # of channels from vb.flagCube()).
Bool casa::VisBuffGroup::chunkEnd | ( | const Int | buf | ) | const [inline] |
(See endChunk()) Returns whether or not vi.nextChunk() should be used when advancing past buffer number buf.
Definition at line 102 of file VisBuffGroup.h.
References endChunk_p.
void casa::VisBuffGroup::endChunk | ( | ) |
Record the end of a chunk.
Doing so marks that if "playing back" a VisIter vi matching the order that the VBs were stored in, vi.nextChunk() will be needed at this point instead of ++vi.
uInt casa::VisBuffGroup::nBuf | ( | ) | const [inline] |
Replace the VisBuffer in slot buf with vb.
Returns True on success and False on failure. Bool replace(const VisBuffer& vb, const uInt buf);
How many VisBuffers are contained herein?
Definition at line 109 of file VisBuffGroup.h.
References nBuf_p.
VisBuffGroup& casa::VisBuffGroup::operator= | ( | const VisBuffGroup & | ) | [private] |
Bool casa::VisBuffGroup::store | ( | const VisBuffer & | vb | ) |
Add a VisBuffer.
Returns True on success and False on failure.
Vector<Bool> casa::VisBuffGroup::endChunk_p [private] |
Definition at line 152 of file VisBuffGroup.h.
Referenced by chunkEnd().
uInt casa::VisBuffGroup::nBuf_p [private] |
// Numbers of data description ids and fields uInt nDDID_p, nFld_p, nBuf_p;
Number of buffers.
Definition at line 147 of file VisBuffGroup.h.
Referenced by nBuf().
PtrBlock<VisBuffer*> casa::VisBuffGroup::VB_p [private] |
The list of buffers.
Definition at line 150 of file VisBuffGroup.h.