casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
casa::VisBuffAccumulator Class Reference

A class to average VisBuffers in time. More...

#include <VisBuffAccumulator.h>

Public Member Functions

 VisBuffAccumulator (const casacore::Int &nAnt, const casacore::Double &interval, const casacore::Bool &prenorm, const casacore::Bool fillModel=true)
 Construct from the number of antennas, the averaging interval and the pre-normalization flag. More...
 
 ~VisBuffAccumulator ()
 Null destructor. More...
 
void reset ()
 Reset the averager. More...
 
void accumulate (const VisBuffer &vb)
 Accumulate a VisBuffer. More...
 
void finalizeAverage ()
 Finalize averaging, and return the result. More...
 
VisBufferaveVisBuff ()
 Return a reference to the result TBD: is it ok to return a CVB as a VB reference? (do I need an explicit cast here? More...
 
CalVisBufferaveCalVisBuff ()
 
casacore::DoubletimeStamp ()
 Global timestamp info. More...
 
casacore::DoubletimeStampWt ()
 
casacore::uInt nBuf ()
 The number of VisBuffers that have been accumulated. More...
 
const casacore::Vector
< casacore::Int > & 
outToInRow (const casacore::Bool hurl=true)
 Return a map from row numbers in the VisBuffer returned by aveVisBuff() or aveCalVisBuff() to row numbers in the input VisBuffer. More...
 
void setTVIDebug (bool debug)
 
void reportData ()
 

Protected Attributes

CalVisBuffer avBuf_p
 Averaging buffer. More...
 
casacore::Int nCorr_p
 Number of correlations and channels. More...
 
casacore::Int nChan_p
 

Private Member Functions

 VisBuffAccumulator ()
 Prohibit null constructor, copy constructor and assignment for now. More...
 
VisBuffAccumulatoroperator= (const VisBuffAccumulator &)
 
 VisBuffAccumulator (const VisBuffAccumulator &)
 
casacore::Intprtlev ()
 Diagnostic printing level. More...
 
void initialize (const casacore::Bool &copydata)
 Initialize the next accumulation interval. More...
 
void normalize ()
 Normalize the current accumulation. More...
 
casacore::Int hashFunction (const casacore::Int &ant1, const casacore::Int &ant2)
 Hash function to return the row offset for an interferometer (ant1, ant2) More...
 
void throw_err (const casacore::String &origin, const casacore::String &msg)
 Shuffle error handling elsewhere in an attempt to let the calling function be efficient and inlinable. More...
 

Private Attributes

casacore::Int nAnt_p
 Number of antennas. More...
 
casacore::Double interval_p
 Averaging interval. More...
 
casacore::Bool prenorm_p
 Pre-normalization flag. More...
 
casacore::Int prtlev_
 Diagnostic print level. More...
 
casacore::uInt nBuf_p
 How many VisBuffers have been accumulated. More...
 
casacore::Bool fillModel_p
 
casacore::Double aveTime_p
 End of initialization list. More...
 
casacore::Double aveTimeWt_p
 
casacore::Double globalTime_p
 Global timestamp average. More...
 
casacore::Double globalTimeWt_p
 
casacore::Double tStart_p
 Start time and row of current accumulation. More...
 
casacore::Int avrow_p
 
casacore::Bool firstInterval_p
 Flag to mark the first accumulation interval. More...
 
casacore::Vector< casacore::IntoutToInRow_p
 A map from avBuf_p's row numbers to row numbers in the VisBuffer used to fill avBuf_p. More...
 
bool tvi_debug
 

Detailed Description

A class to average VisBuffers in time.

Intended use:

Public interface

Review Status

Date Reviewed:
yyyy/mm/dd

Prerequisite

Etymology

From "visibility", "time" and "averaging".

Synopsis

This class averages VisBuffers in time.

Example

Motivation

Collect all time averaging capabilities for VisBuffer averaging.

Thrown Exceptions

To Do

Definition at line 74 of file VisBuffAccumulator.h.

Constructor & Destructor Documentation

casa::VisBuffAccumulator::VisBuffAccumulator ( const casacore::Int nAnt,
const casacore::Double interval,
const casacore::Bool prenorm,
const casacore::Bool  fillModel = true 
)

Construct from the number of antennas, the averaging interval and the pre-normalization flag.

casa::VisBuffAccumulator::~VisBuffAccumulator ( )

Null destructor.

casa::VisBuffAccumulator::VisBuffAccumulator ( )
private

Prohibit null constructor, copy constructor and assignment for now.

casa::VisBuffAccumulator::VisBuffAccumulator ( const VisBuffAccumulator )
private

Member Function Documentation

void casa::VisBuffAccumulator::accumulate ( const VisBuffer vb)

Accumulate a VisBuffer.

CalVisBuffer& casa::VisBuffAccumulator::aveCalVisBuff ( )
inline

Definition at line 98 of file VisBuffAccumulator.h.

References avBuf_p.

VisBuffer& casa::VisBuffAccumulator::aveVisBuff ( )
inline

Return a reference to the result TBD: is it ok to return a CVB as a VB reference? (do I need an explicit cast here?

Definition at line 97 of file VisBuffAccumulator.h.

References avBuf_p.

void casa::VisBuffAccumulator::finalizeAverage ( )

Finalize averaging, and return the result.

casacore::Int casa::VisBuffAccumulator::hashFunction ( const casacore::Int ant1,
const casacore::Int ant2 
)
private

Hash function to return the row offset for an interferometer (ant1, ant2)

void casa::VisBuffAccumulator::initialize ( const casacore::Bool copydata)
private

Initialize the next accumulation interval.

casacore::uInt casa::VisBuffAccumulator::nBuf ( )
inline

The number of VisBuffers that have been accumulated.

Definition at line 105 of file VisBuffAccumulator.h.

References nBuf_p.

void casa::VisBuffAccumulator::normalize ( )
private

Normalize the current accumulation.

VisBuffAccumulator& casa::VisBuffAccumulator::operator= ( const VisBuffAccumulator )
private
const casacore::Vector<casacore::Int>& casa::VisBuffAccumulator::outToInRow ( const casacore::Bool  hurl = true)
inline

Return a map from row numbers in the VisBuffer returned by aveVisBuff() or aveCalVisBuff() to row numbers in the input VisBuffer.

Only useful if nBuf_p == 1 or you are sure that the last input VisBuffer will meet your needs (i.e. all the input VisBuffers had same set of antennas and the metadata you want also matches). hurl controls whether an exception will be thrown if nBuf() != 1. Unfilled rows point to -1.

Definition at line 113 of file VisBuffAccumulator.h.

References nBuf_p, outToInRow_p, and throw_err().

casacore::Int& casa::VisBuffAccumulator::prtlev ( )
inlineprivate

Diagnostic printing level.

Definition at line 137 of file VisBuffAccumulator.h.

References prtlev_.

void casa::VisBuffAccumulator::reportData ( )
void casa::VisBuffAccumulator::reset ( )

Reset the averager.

void casa::VisBuffAccumulator::setTVIDebug ( bool  debug)
inline

Definition at line 119 of file VisBuffAccumulator.h.

References debug, and tvi_debug.

void casa::VisBuffAccumulator::throw_err ( const casacore::String origin,
const casacore::String msg 
)
private

Shuffle error handling elsewhere in an attempt to let the calling function be efficient and inlinable.

Referenced by outToInRow().

casacore::Double& casa::VisBuffAccumulator::timeStamp ( )
inline

Global timestamp info.

Definition at line 101 of file VisBuffAccumulator.h.

References globalTime_p.

casacore::Double& casa::VisBuffAccumulator::timeStampWt ( )
inline

Definition at line 102 of file VisBuffAccumulator.h.

References globalTimeWt_p.

Member Data Documentation

CalVisBuffer casa::VisBuffAccumulator::avBuf_p
protected

Averaging buffer.

Definition at line 125 of file VisBuffAccumulator.h.

Referenced by aveCalVisBuff(), and aveVisBuff().

casacore::Double casa::VisBuffAccumulator::aveTime_p
private

End of initialization list.

Per-interval timestamp averaging

Definition at line 172 of file VisBuffAccumulator.h.

casacore::Double casa::VisBuffAccumulator::aveTimeWt_p
private

Definition at line 173 of file VisBuffAccumulator.h.

casacore::Int casa::VisBuffAccumulator::avrow_p
private

Definition at line 181 of file VisBuffAccumulator.h.

casacore::Bool casa::VisBuffAccumulator::fillModel_p
private

Definition at line 167 of file VisBuffAccumulator.h.

casacore::Bool casa::VisBuffAccumulator::firstInterval_p
private

Flag to mark the first accumulation interval.

Definition at line 184 of file VisBuffAccumulator.h.

casacore::Double casa::VisBuffAccumulator::globalTime_p
private

Global timestamp average.

Definition at line 176 of file VisBuffAccumulator.h.

Referenced by timeStamp().

casacore::Double casa::VisBuffAccumulator::globalTimeWt_p
private

Definition at line 177 of file VisBuffAccumulator.h.

Referenced by timeStampWt().

casacore::Double casa::VisBuffAccumulator::interval_p
private

Averaging interval.

Definition at line 156 of file VisBuffAccumulator.h.

casacore::Int casa::VisBuffAccumulator::nAnt_p
private

Number of antennas.

Definition at line 153 of file VisBuffAccumulator.h.

casacore::uInt casa::VisBuffAccumulator::nBuf_p
private

How many VisBuffers have been accumulated.

Definition at line 165 of file VisBuffAccumulator.h.

Referenced by nBuf(), and outToInRow().

casacore::Int casa::VisBuffAccumulator::nChan_p
protected

Definition at line 128 of file VisBuffAccumulator.h.

casacore::Int casa::VisBuffAccumulator::nCorr_p
protected

Number of correlations and channels.

Definition at line 128 of file VisBuffAccumulator.h.

casacore::Vector<casacore::Int> casa::VisBuffAccumulator::outToInRow_p
private

A map from avBuf_p's row numbers to row numbers in the VisBuffer used to fill avBuf_p.

Only useful if nBuf_p == 1. Unfilled rows point to -1.

Definition at line 188 of file VisBuffAccumulator.h.

Referenced by outToInRow().

casacore::Bool casa::VisBuffAccumulator::prenorm_p
private

Pre-normalization flag.

Definition at line 159 of file VisBuffAccumulator.h.

casacore::Int casa::VisBuffAccumulator::prtlev_
private

Diagnostic print level.

Definition at line 162 of file VisBuffAccumulator.h.

Referenced by prtlev().

casacore::Double casa::VisBuffAccumulator::tStart_p
private

Start time and row of current accumulation.

Definition at line 180 of file VisBuffAccumulator.h.

bool casa::VisBuffAccumulator::tvi_debug
private

Definition at line 190 of file VisBuffAccumulator.h.

Referenced by setTVIDebug().


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