VisBuffer.h

Classes

VisBuffer -- VisBuffers encapulsate one chunk of visibility data for processing. (full description)

class VisBuffer

Interface

Public Members
VisBuffer()
VisBuffer(ROVisibilityIterator & iter)
VisBuffer(const VisBuffer& vb)
~VisBuffer()
VisBuffer& operator=(const VisBuffer& vb)
VisBuffer& assign(const VisBuffer& vb, Bool copy=True)
VisBuffer& operator-=(const VisBuffer& vb)
void attachToVisIter(ROVisibilityIterator & iter)
void invalidate()
Int& nChannel()
Int nChannel() const
Vector<Int>& channel()
const Vector<Int>& channel() const
Int& nRow()
Int nRow() const
Vector<Int>& antenna1()
const Vector<Int>& antenna1() const
Vector<Int>& antenna2()
const Vector<Int>& antenna2() const
Vector<Int>& feed1()
const Vector<Int>& feed1() const
Vector<Int>& feed2()
const Vector<Int>& feed2() const
Vector<Float>& feed1_pa()
const Vector<Float>& feed1_pa() const
Vector<Float>& feed2_pa()
const Vector<Float>& feed2_pa() const
Vector<SquareMatrix<Complex,2> >& CJones()
const Vector<SquareMatrix<Complex,2> >& CJones() const
const Vector<Float>& feed_pa(Double time) const
Vector<MDirection>& direction1()
const Vector<MDirection>& direction1() const
Vector<MDirection>& direction2()
const Vector<MDirection>& direction2() const
const Vector<MDirection>& azel(Double time) const
Int fieldId() const
Int arrayId() const
Matrix<Bool>& flag()
const Matrix<Bool>& flag() const
Cube<Bool>& flagCube()
const Cube<Bool>& flagCube() const
Vector<Bool>& flagRow()
const Vector<Bool>& flagRow() const
Vector<Int>& scan()
const Vector<Int>& scan() const
Int scan0()
Vector<Double>& frequency()
const Vector<Double>& frequency() const
Vector<Double>& lsrFrequency()
const Vector<Double>& lsrFrequency() const
void lsrFrequency(const Int& spw, Vector<Double>& freq, Bool convert=False)
void lsrFrequency(const Int& spw, Vector<Double>& freq, Bool convert=False) const
MDirection& phaseCenter()
const MDirection& phaseCenter() const
Int polFrame() const
Vector<Int>& corrType()
const Vector<Int>& corrType() const
Vector<Float>& sigma()
const Vector<Float>& sigma() const
Int& spectralWindow()
Int spectralWindow() const
Vector<Double>& time()
const Vector<Double>& time() const
Vector<Double>& timeInterval()
const Vector<Double>& timeInterval() const
Vector<RigidVector<Double,3> >& uvw()
const Vector<RigidVector<Double,3> >& uvw() const
Matrix<CStokesVector>& visibility()
const Matrix<CStokesVector>& visibility() const
Matrix<CStokesVector>& modelVisibility()
const Matrix<CStokesVector>& modelVisibility() const
Matrix<CStokesVector>& correctedVisibility()
const Matrix<CStokesVector>& correctedVisibility() const
Cube<Complex>& visCube()
const Cube<Complex>& visCube() const
Cube<Complex>& modelVisCube()
const Cube<Complex>& modelVisCube() const
Cube<Complex>& correctedVisCube()
const Cube<Complex>& correctedVisCube() const
Vector<Float>& weight()
const Vector<Float>& weight() const
Matrix<Float>& imagingWeight()
const Matrix<Float>& imagingWeight() const
Vector<Int> vecIntRange(const MSCalEnums::colDef& calEnum) const
Vector<Int> antIdRange() const
Bool timeRange(MEpoch& rTime, MVEpoch& rTimeEP, MVEpoch& rInterval) const
void freqAverage()
void updateCoordInfo()
void setVisCube(Complex c)
void setModelVisCube(Complex c)
void setCorrectedVisCube(Complex c)
void setVisCube(const Cube<Complex>& vis)
void setModelVisCube(const Cube<Complex>& vis)
void setCorrectedVisCube(const Cube<Complex>& vis)
void refModelVis(const Matrix<CStokesVector>& mvis)
void removeScratchCols()
const ROMSColumns& msColumns() const
void allSelectedSpectralWindows(Vector<Int>& spws, Vector<Int>& nvischan)
void allSelectedSpectralWindows(Vector<Int>& spws, Vector<Int>& nvischan) const
Int msId() const
Bool newMS() const
Private Members
void validate()
Int & fillnChannel()
Vector<Int>& fillChannel()
Int & fillnRow()
Vector<Int>& fillAnt1()
Vector<Int>& fillAnt2()
Vector<Int>& fillFeed1()
Vector<Int>& fillFeed2()
Vector<Float>& fillFeed1_pa()
Vector<Float>& fillFeed2_pa()
Vector<MDirection>& fillDirection1()
Vector<MDirection>& fillDirection2()
Vector<SquareMatrix<Complex,2> >& fillCjones()
Int& fillFieldId()
Int& fillArrayId()
Matrix<Bool>& fillFlag()
Cube<Bool>& fillFlagCube()
Vector<Bool> & fillFlagRow()
Vector<Int> & fillScan()
Vector<Double>& fillFreq()
Vector<Double>& fillLSRFreq()
MDirection& fillPhaseCenter()
Int& fillPolFrame()
Vector<Int>& fillCorrType()
Vector<Float>& fillSigma()
Int& fillSpW()
Vector<Double>& fillTime()
Vector<Double>& fillTimeInterval()
Vector<RigidVector<Double,3> >& filluvw()
Matrix<CStokesVector>& fillVis(VisibilityIterator::DataColumn whichOne)
Cube<Complex>& fillVisCube(VisibilityIterator::DataColumn whichOne)
Vector<Float>& fillWeight()
Matrix<Float>& fillImagingWeight()
Bool checkMSId()
Vector<Int> unique(const Vector<Int>& indices) const

Description

Prerequisite

Etymology

VisBuffer is a buffer for visibility data

Synopsis

This class contains 'one iteration' of the VisibilityIterator It is a modifiable buffer of values to which calibration and averaging can be applied. This allows processing of the data in larger blocks, avoiding some overheads for processing per visibility point or spectrum.

See MeasurementEquations for more details on how the VisBuffer is to be used.

To Do

Member Description

VisBuffer()

Create empty VisBuffer you can assign to or attach.

VisBuffer(ROVisibilityIterator & iter)

Construct VisBuffer for a particular VisibilityIterator The buffer will remain synchronized with the iterator.

VisBuffer(const VisBuffer& vb)

Copy construct, looses synchronization with iterator: only use buffer for current iteration (or reattach).

~VisBuffer()

Destructor (detaches from VisIter)

VisBuffer& operator=(const VisBuffer& vb)

Assignment, looses synchronization with iterator: only use buffer for current iteration (or reattach)

VisBuffer& assign(const VisBuffer& vb, Bool copy=True)

Assignment, optionally without copying the data across; with copy=True this is identical to normal assignment operator

VisBuffer& operator-=(const VisBuffer& vb)

subtraction: return the difference of the visibilities, flags of this and other are or-ed. An exception is thrown if the number of rows or channels differs, but no further checks are done.

void attachToVisIter(ROVisibilityIterator & iter)

Attach to a VisIter. Detaches itself first if already attached to a VisIter. Will remain synchronized with iterator.

void invalidate()

Invalidate the cache

Int& nChannel()

Access functions

Vector<Float>& feed1_pa()

feed1_pa() and feed2_pa() return an array of parallactic angles (each corresponds to the first receptor of the feed) one for each row in the current buffer. In contrast, feed_pa() calculates the angles for each antenna. These methods are implemented for VisBuffer only to benefit from caching of the feed and antenna IDs.

const Vector<Float>& feed_pa(Double time) const

Note that feed_pa is a function instead of a cached value

Vector<MDirection>& direction1()

direction1() and direction2() return arrays of directions where the first and the second antenna/feed are pointed to. One value for each row in the current buffer.

const Vector<MDirection>& azel(Double time) const

Note that azel is a function instead of a cached value

Int scan0()

scalar version for convenience, when scan known constant for entire iteration/buffer.

void lsrFrequency(const Int& spw, Vector<Double>& freq, Bool convert=False)

the following method is to convert the observed frequencies This conversion may not be accurate for some frame conversion like topo to lsr except if the spw is in the actual buffer

Int nChannel() const
Vector<Int>& channel()
const Vector<Int>& channel() const
Int& nRow()
Int nRow() const
Vector<Int>& antenna1()
const Vector<Int>& antenna1() const
Vector<Int>& antenna2()
const Vector<Int>& antenna2() const
Vector<Int>& feed1()
const Vector<Int>& feed1() const
Vector<Int>& feed2()
const Vector<Int>& feed2() const
const Vector<Float>& feed1_pa() const
Vector<Float>& feed2_pa()
const Vector<Float>& feed2_pa() const
Vector<SquareMatrix<Complex,2> >& CJones()
const Vector<SquareMatrix<Complex,2> >& CJones() const
const Vector<MDirection>& direction1() const
Vector<MDirection>& direction2()
const Vector<MDirection>& direction2() const
Int fieldId() const
Int arrayId() const
Matrix<Bool>& flag()
const Matrix<Bool>& flag() const
Cube<Bool>& flagCube()
const Cube<Bool>& flagCube() const
Vector<Bool>& flagRow()
const Vector<Bool>& flagRow() const
Vector<Int>& scan()
const Vector<Int>& scan() const
Vector<Double>& frequency()
const Vector<Double>& frequency() const
Vector<Double>& lsrFrequency()
const Vector<Double>& lsrFrequency() const
void lsrFrequency(const Int& spw, Vector<Double>& freq, Bool convert=False) const
MDirection& phaseCenter()
const MDirection& phaseCenter() const
Int polFrame() const
Vector<Int>& corrType()
const Vector<Int>& corrType() const
Vector<Float>& sigma()
const Vector<Float>& sigma() const
Int& spectralWindow()
Int spectralWindow() const
Vector<Double>& time()
const Vector<Double>& time() const
Vector<Double>& timeInterval()
const Vector<Double>& timeInterval() const
Vector<RigidVector<Double,3> >& uvw()
const Vector<RigidVector<Double,3> >& uvw() const
Matrix<CStokesVector>& visibility()
const Matrix<CStokesVector>& visibility() const
Matrix<CStokesVector>& modelVisibility()
const Matrix<CStokesVector>& modelVisibility() const
Matrix<CStokesVector>& correctedVisibility()
const Matrix<CStokesVector>& correctedVisibility() const
Cube<Complex>& visCube()
const Cube<Complex>& visCube() const
Cube<Complex>& modelVisCube()
const Cube<Complex>& modelVisCube() const
Cube<Complex>& correctedVisCube()
const Cube<Complex>& correctedVisCube() const
Vector<Float>& weight()
const Vector<Float>& weight() const
Matrix<Float>& imagingWeight()
const Matrix<Float>& imagingWeight() const

Vector<Int> antIdRange() const

Antenna id. range (includes both ANTENNA1 and ANTENNA2 columns)

Bool timeRange(MEpoch& rTime, MVEpoch& rTimeEP, MVEpoch& rInterval) const

Time range

Vector<Int> vecIntRange(const MSCalEnums::colDef& calEnum) const

void freqAverage()

Frequency average the buffer

void updateCoordInfo()

Update coordinate info - useful for copied VisBuffers that need to retain some state for later reference. Presently this fills antenna, array, field and spectralWindow ids, time, frequency and number of rows. Add more as needed.

void setVisCube(Complex c)

Set the visibility to a constant, note that this only changes the buffer, no values are written back to tables from here.

void setModelVisCube(Complex c)

void setCorrectedVisCube(Complex c)

void setVisCube(const Cube<Complex>& vis)

Set the visibility, note that this only changes the buffer, no values are written back to tables from here.

void setModelVisCube(const Cube<Complex>& vis)

void setCorrectedVisCube(const Cube<Complex>& vis)

void refModelVis(const Matrix<CStokesVector>& mvis)

Reference external model visibilities

void removeScratchCols()

Remove scratch cols data from vb

const ROMSColumns& msColumns() const

Access the current ROMSColumns object via VisIter

void allSelectedSpectralWindows(Vector<Int>& spws, Vector<Int>& nvischan)

Get all selected spectral windows not just the one in the actual buffer

void allSelectedSpectralWindows(Vector<Int>& spws, Vector<Int>& nvischan) const

Int msId() const

Return the actual msid, useful if using multiple ms to monitor which ms in the list is being dealt with

Bool newMS() const

checked if the ms has changed since the last chunk processed

void validate()

validate the cache

Int & fillnChannel()

functions to fill cache from iterator

Vector<Int>& fillChannel()

Int & fillnRow()

Vector<Int>& fillAnt1()

Vector<Int>& fillAnt2()

Vector<Int>& fillFeed1()

Vector<Int>& fillFeed2()

Vector<Float>& fillFeed1_pa()

calling fillFeed1_pa or fillFeed2_pa will fill antenna, feed and time caches automatically

Vector<Float>& fillFeed2_pa()

Vector<MDirection>& fillDirection1()

calling direction1 or direction2 will fill antenna,feed, time and pa caches automatically

Vector<MDirection>& fillDirection2()

Vector<SquareMatrix<Complex,2> >& fillCjones()

Int& fillFieldId()

Int& fillArrayId()

Matrix<Bool>& fillFlag()

Cube<Bool>& fillFlagCube()

Vector<Bool> & fillFlagRow()

Vector<Int> & fillScan()

Vector<Double>& fillFreq()

Vector<Double>& fillLSRFreq()

MDirection& fillPhaseCenter()

Int& fillPolFrame()

Vector<Int>& fillCorrType()

Vector<Float>& fillSigma()

Int& fillSpW()

Vector<Double>& fillTime()

Vector<Double>& fillTimeInterval()

Vector<RigidVector<Double,3> >& filluvw()

Matrix<CStokesVector>& fillVis(VisibilityIterator::DataColumn whichOne)

Cube<Complex>& fillVisCube(VisibilityIterator::DataColumn whichOne)

Vector<Float>& fillWeight()

Matrix<Float>& fillImagingWeight()

Bool checkMSId()

Vector<Int> unique(const Vector<Int>& indices) const

Filter index arrays for unique elements