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::VisBuffGroup Class Reference

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...
 
VisBufferoperator() (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...
 
VisBuffGroupoperator= (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::BoolendChunk_p
 

Detailed Description

A class to store a group of VisBuffers.

Intended use:

Public interface

Review Status

Date Reviewed:
yyyy/mm/dd

Prerequisite

Etymology

It is a group of VisBuffers

Synopsis

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.

Example

Motivation

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).

To Do

Definition at line 83 of file VisBuffGroup.h.

Constructor & Destructor Documentation

casa::VisBuffGroup::VisBuffGroup ( )
casa::VisBuffGroup::~VisBuffGroup ( )

Null destructor.

casa::VisBuffGroup::VisBuffGroup ( const VisBuffGroup )
private

Prohibit public copying and assignment.

Member Function Documentation

static casacore::Bool casa::VisBuffGroup::applyChanMask ( casacore::Cube< casacore::Bool > &  chanmaskedflags,
const casacore::Vector< casacore::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). 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()).

casacore::Bool casa::VisBuffGroup::chunkEnd ( const casacore::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 ( )

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.

casacore::uInt casa::VisBuffGroup::nBuf ( ) const
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().

VisBuffGroup& casa::VisBuffGroup::operator= ( const VisBuffGroup )
private
casacore::Bool casa::VisBuffGroup::store ( const VisBuffer vb)

Add a VisBuffer.

Returns true on success and false on failure.

Member Data Documentation

casacore::Vector<casacore::Bool> casa::VisBuffGroup::endChunk_p
private

Definition at line 152 of file VisBuffGroup.h.

Referenced by chunkEnd().

casacore::uInt casa::VisBuffGroup::nBuf_p
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().

casacore::PtrBlock<VisBuffer*> casa::VisBuffGroup::VB_p
private

The list of buffers.

Definition at line 150 of file VisBuffGroup.h.


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