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

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

#include <VisBuffAccumulator.h>

List of all members.

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.
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?
CalVisBufferaveCalVisBuff ()
DoubletimeStamp ()
 Global timestamp info.
DoubletimeStampWt ()
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.

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.
VisBuffAccumulatoroperator= (const VisBuffAccumulator &)
 VisBuffAccumulator (const VisBuffAccumulator &)
Intprtlev ()
 Diagnostic printing level.
void initialize (const Bool &copydata)
 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< IntoutToInRow_p
 A map from avBuf_p's row numbers to row numbers in the VisBuffer used to fill avBuf_p.

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

Null destructor.

Prohibit null constructor, copy constructor and assignment for now.


Member Function Documentation

Accumulate a VisBuffer.

Definition at line 98 of file VisBuffAccumulator.h.

References avBuf_p.

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.

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.

The number of VisBuffers that have been accumulated.

Definition at line 105 of file VisBuffAccumulator.h.

References nBuf_p.

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]

Diagnostic printing level.

Definition at line 133 of file VisBuffAccumulator.h.

References prtlev_.

Reset the averager.

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

Global timestamp info.

Definition at line 101 of file VisBuffAccumulator.h.

References globalTime_p.

Definition at line 102 of file VisBuffAccumulator.h.

References globalTimeWt_p.


Member Data Documentation

Averaging buffer.

Definition at line 121 of file VisBuffAccumulator.h.

Referenced by aveCalVisBuff(), and aveVisBuff().

End of initialization list.

Per-interval timestamp averaging

Definition at line 168 of file VisBuffAccumulator.h.

Definition at line 169 of file VisBuffAccumulator.h.

Definition at line 177 of file VisBuffAccumulator.h.

Definition at line 163 of file VisBuffAccumulator.h.

Flag to mark the first accumulation interval.

Definition at line 180 of file VisBuffAccumulator.h.

Global timestamp average.

Definition at line 172 of file VisBuffAccumulator.h.

Referenced by timeStamp().

Definition at line 173 of file VisBuffAccumulator.h.

Referenced by timeStampWt().

Averaging interval.

Definition at line 152 of file VisBuffAccumulator.h.

Number of antennas.

Definition at line 149 of file VisBuffAccumulator.h.

How many VisBuffers have been accumulated.

Definition at line 161 of file VisBuffAccumulator.h.

Referenced by nBuf(), and outToInRow().

Definition at line 124 of file VisBuffAccumulator.h.

Number of correlations and channels.

Definition at line 124 of file VisBuffAccumulator.h.

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 184 of file VisBuffAccumulator.h.

Referenced by outToInRow().

Pre-normalization flag.

Definition at line 155 of file VisBuffAccumulator.h.

Diagnostic print level.

Definition at line 158 of file VisBuffAccumulator.h.

Referenced by prtlev().

Start time and row of current accumulation.

Definition at line 176 of file VisBuffAccumulator.h.


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