casa
5.7.0-16
|
A class to store a group of VisBuffers. More...
#include <VisBuffGroup.h>
Public Member Functions | |
VisBuffGroup () | |
~VisBuffGroup () | |
Null destructor. More... | |
casacore::Bool | store (const VisBuffer &vb) |
Add a VisBuffer. More... | |
void | endChunk () |
casacore::Record the end of a chunk. More... | |
casacore::Bool | chunkEnd (const casacore::Int buf) const |
(See endChunk()) Returns whether or not vi.nextChunk() should be used when advancing past buffer number buf. More... | |
casacore::uInt | nBuf () const |
Replace the VisBuffer in slot buf with vb. More... | |
VisBuffer & | operator() (const casacore::Int buf) |
casacore::uInt nDDID() const {return nDDID_p;} casacore::uInt nFld() const {return nFld_p;} More... | |
Static Public Member Functions | |
static casacore::Bool | applyChanMask (casacore::Cube< casacore::Bool > &chanmaskedflags, const casacore::Vector< casacore::Bool > *chanmask, const VisBuffer &vb) |
// Returns the buffer index corresponding to data description ID ddid and field ID fld. More... | |
Private Member Functions | |
VisBuffGroup (const VisBuffGroup &) | |
Prohibit public copying and assignment. More... | |
VisBuffGroup & | operator= (const VisBuffGroup &) |
Private Attributes | |
casacore::uInt | nBuf_p |
// Numbers of data description ids and fields casacore::uInt nDDID_p, nFld_p, nBuf_p; More... | |
casacore::PtrBlock< VisBuffer * > | VB_p |
The list of buffers. More... | |
casacore::Vector< casacore::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 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).
Definition at line 83 of file VisBuffGroup.h.
casa::VisBuffGroup::VisBuffGroup | ( | ) |
casa::VisBuffGroup::~VisBuffGroup | ( | ) |
Null destructor.
|
private |
Prohibit public copying and assignment.
|
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). casacore::Int bufInd(const casacore::Int ddid, const casacore::Int fld);
Returns the buffer indices corresponding to data description ID ddid and field ID fld. casacore::Vector<casacore::Int> bufInds(const casacore::Int ddid, const casacore::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()).
|
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 | ( | ) |
casacore::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.
|
inline |
Replace the VisBuffer in slot buf with vb.
Returns true on success and false on failure. casacore::Bool replace(const VisBuffer& vb, const casacore::uInt buf);
How many VisBuffers are contained herein?
Definition at line 109 of file VisBuffGroup.h.
References nBuf_p.
VisBuffer& casa::VisBuffGroup::operator() | ( | const casacore::Int | buf | ) |
casacore::uInt nDDID() const {return nDDID_p;} casacore::uInt nFld() const {return nFld_p;}
Return a reference to the indexed VisBuffer. Throws an exception if buf > nBuf().
|
private |
casacore::Bool casa::VisBuffGroup::store | ( | const VisBuffer & | vb | ) |
Add a VisBuffer.
Returns true on success and false on failure.
|
private |
Definition at line 152 of file VisBuffGroup.h.
Referenced by chunkEnd().
|
private |
// Numbers of data description ids and fields casacore::uInt nDDID_p, nFld_p, nBuf_p;
Number of buffers.
Definition at line 147 of file VisBuffGroup.h.
Referenced by nBuf().
|
private |
The list of buffers.
Definition at line 150 of file VisBuffGroup.h.