casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
casa::VisBuffGroup Class Reference

A class to store a group of VisBuffers. More...

#include <VisBuffGroup.h>

List of all members.

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

To Do

Definition at line 83 of file VisBuffGroup.h.


Constructor & Destructor Documentation

Null destructor.

Prohibit public copying and assignment.


Member Function Documentation

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.

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.

VisBuffer& casa::VisBuffGroup::operator() ( const Int  buf)

uInt nDDID() const {return nDDID_p;} 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]

Add a VisBuffer.

Returns True on success and False on failure.


Member Data Documentation

Definition at line 152 of file VisBuffGroup.h.

Referenced by chunkEnd().

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

The list of buffers.

Definition at line 150 of file VisBuffGroup.h.


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