A class to average VisBuffers in time. More...
#include <VisBuffAccumulator.h>
Public Member Functions | |
VisBuffAccumulator (const Int &nAnt, const Double &interval, const Bool &prenorm, const Bool fillModel=True) | |
Construct from the number of antennas, the averaging interval and the pre-normalization flag. | |
~VisBuffAccumulator () | |
Null destructor. | |
void | reset () |
Reset the averager. | |
void | accumulate (const VisBuffer &vb) |
Accumulate a VisBuffer. | |
void | finalizeAverage () |
Finalize averaging, and return the result. | |
VisBuffer & | aveVisBuff () |
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? | |
CalVisBuffer & | aveCalVisBuff () |
Double & | timeStamp () |
Global timestamp info. | |
Double & | timeStampWt () |
uInt | nBuf () |
The number of VisBuffers that have been accumulated. | |
const Vector< Int > & | outToInRow (const Bool hurl=true) |
Return a map from row numbers in the VisBuffer returned by aveVisBuff() or aveCalVisBuff() to row numbers in the input VisBuffer. | |
void | setTVIDebug (Bool debug) |
Protected Attributes | |
CalVisBuffer | avBuf_p |
Averaging buffer. | |
Int | nCorr_p |
Number of correlations and channels. | |
Int | nChan_p |
Private Member Functions | |
VisBuffAccumulator () | |
Prohibit null constructor, copy constructor and assignment for now. | |
VisBuffAccumulator & | operator= (const VisBuffAccumulator &) |
VisBuffAccumulator (const VisBuffAccumulator &) | |
Int & | prtlev () |
Diagnostic printing level. | |
void | initialize (const Bool ©data) |
Initialize the next accumulation interval. | |
void | normalize () |
Normalize the current accumulation. | |
Int | hashFunction (const Int &ant1, const Int &ant2) |
Hash function to return the row offset for an interferometer (ant1, ant2). | |
void | throw_err (const String &origin, const String &msg) |
Shuffle error handling elsewhere in an attempt to let the calling function be efficient and inlinable. | |
Private Attributes | |
Int | nAnt_p |
Number of antennas. | |
Double | interval_p |
Averaging interval. | |
Bool | prenorm_p |
Pre-normalization flag. | |
Int | prtlev_ |
Diagnostic print level. | |
uInt | nBuf_p |
How many VisBuffers have been accumulated. | |
Bool | fillModel_p |
Double | aveTime_p |
End of initialization list. | |
Double | aveTimeWt_p |
Double | globalTime_p |
Global timestamp average. | |
Double | globalTimeWt_p |
Double | tStart_p |
Start time and row of current accumulation. | |
Int | avrow_p |
Bool | firstInterval_p |
Flag to mark the first accumulation interval. | |
Vector< Int > | outToInRow_p |
A map from avBuf_p's row numbers to row numbers in the VisBuffer used to fill avBuf_p. | |
Bool | tvi_debug |
A class to average VisBuffers in time.
Public interface
From "visibility", "time" and "averaging".
This class averages VisBuffers in time.
Collect all time averaging capabilities for VisBuffer averaging.
Definition at line 74 of file VisBuffAccumulator.h.
casa::VisBuffAccumulator::VisBuffAccumulator | ( | const Int & | nAnt, | |
const Double & | interval, | |||
const Bool & | prenorm, | |||
const 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] |
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.
Int casa::VisBuffAccumulator::hashFunction | ( | const Int & | ant1, | |
const Int & | ant2 | |||
) | [private] |
Hash function to return the row offset for an interferometer (ant1, ant2).
void casa::VisBuffAccumulator::initialize | ( | const Bool & | copydata | ) | [private] |
Initialize the next accumulation interval.
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 Vector<Int>& casa::VisBuffAccumulator::outToInRow | ( | const 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().
Int& casa::VisBuffAccumulator::prtlev | ( | ) | [inline, private] |
void casa::VisBuffAccumulator::reset | ( | ) |
Reset the averager.
void casa::VisBuffAccumulator::setTVIDebug | ( | Bool | debug | ) | [inline] |
Definition at line 119 of file VisBuffAccumulator.h.
References tvi_debug.
void casa::VisBuffAccumulator::throw_err | ( | const String & | origin, | |
const String & | msg | |||
) | [private] |
Shuffle error handling elsewhere in an attempt to let the calling function be efficient and inlinable.
Referenced by outToInRow().
Double& casa::VisBuffAccumulator::timeStamp | ( | ) | [inline] |
Global timestamp info.
Definition at line 101 of file VisBuffAccumulator.h.
References globalTime_p.
Double& casa::VisBuffAccumulator::timeStampWt | ( | ) | [inline] |
Definition at line 102 of file VisBuffAccumulator.h.
References globalTimeWt_p.
CalVisBuffer casa::VisBuffAccumulator::avBuf_p [protected] |
Averaging buffer.
Definition at line 123 of file VisBuffAccumulator.h.
Referenced by aveCalVisBuff(), and aveVisBuff().
Double casa::VisBuffAccumulator::aveTime_p [private] |
End of initialization list.
Per-interval timestamp averaging
Definition at line 170 of file VisBuffAccumulator.h.
Double casa::VisBuffAccumulator::aveTimeWt_p [private] |
Definition at line 171 of file VisBuffAccumulator.h.
Int casa::VisBuffAccumulator::avrow_p [private] |
Definition at line 179 of file VisBuffAccumulator.h.
Bool casa::VisBuffAccumulator::fillModel_p [private] |
Definition at line 165 of file VisBuffAccumulator.h.
Bool casa::VisBuffAccumulator::firstInterval_p [private] |
Flag to mark the first accumulation interval.
Definition at line 182 of file VisBuffAccumulator.h.
Double casa::VisBuffAccumulator::globalTime_p [private] |
Global timestamp average.
Definition at line 174 of file VisBuffAccumulator.h.
Referenced by timeStamp().
Double casa::VisBuffAccumulator::globalTimeWt_p [private] |
Definition at line 175 of file VisBuffAccumulator.h.
Referenced by timeStampWt().
Double casa::VisBuffAccumulator::interval_p [private] |
Averaging interval.
Definition at line 154 of file VisBuffAccumulator.h.
Int casa::VisBuffAccumulator::nAnt_p [private] |
Number of antennas.
Definition at line 151 of file VisBuffAccumulator.h.
uInt casa::VisBuffAccumulator::nBuf_p [private] |
How many VisBuffers have been accumulated.
Definition at line 163 of file VisBuffAccumulator.h.
Referenced by nBuf(), and outToInRow().
Int casa::VisBuffAccumulator::nChan_p [protected] |
Definition at line 126 of file VisBuffAccumulator.h.
Int casa::VisBuffAccumulator::nCorr_p [protected] |
Number of correlations and channels.
Definition at line 126 of file VisBuffAccumulator.h.
Vector<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 186 of file VisBuffAccumulator.h.
Referenced by outToInRow().
Bool casa::VisBuffAccumulator::prenorm_p [private] |
Pre-normalization flag.
Definition at line 157 of file VisBuffAccumulator.h.
Int casa::VisBuffAccumulator::prtlev_ [private] |
Diagnostic print level.
Definition at line 160 of file VisBuffAccumulator.h.
Referenced by prtlev().
Double casa::VisBuffAccumulator::tStart_p [private] |
Start time and row of current accumulation.
Definition at line 178 of file VisBuffAccumulator.h.
Bool casa::VisBuffAccumulator::tvi_debug [private] |
Definition at line 188 of file VisBuffAccumulator.h.
Referenced by setTVIDebug().