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

ROVisibilityIterator iterates through one or more readonly MeasurementSets. More...

#include <VisibilityIterator.h>

Inheritance diagram for casa::ROVisibilityIterator:
casa::ROVisIterator casa::VisibilityIterator casa::VisIterator

List of all members.

Classes

class  AsyncEnabler
class  Factory
 VLAT should not access private parts, especially variables. More...

Public Types

enum  PolFrame {
  Circular,
  Linear
}
enum  DataColumn {
  Observed,
  Model,
  Corrected
}
typedef enum
casa::ROVisibilityIterator::DataColumn 
DataColumn

Public Member Functions

 ROVisibilityIterator ()
 Default constructor - useful only to assign another iterator later.
 ROVisibilityIterator (const MeasurementSet &ms, const Block< Int > &sortColumns, Double timeInterval=0, const Factory &factory=Factory())
 Construct from an MS and a Block of MS column enums specifying the iteration order.
 ROVisibilityIterator (const MeasurementSet &ms, const Block< Int > &sortColumns, const Bool addDefaultSortCols, Double timeInterval=0)
 Same as above, but with the option of using the raw order of ms (addDefaultSortCols=false).
 ROVisibilityIterator (const Block< MeasurementSet > &mss, const Block< Int > &sortColumns, Double timeInterval=0)
 Same as previous constructors, but with multiple MSs to iterate over.
 ROVisibilityIterator (const Block< MeasurementSet > &mss, const Block< Int > &sortColumns, const Bool addDefaultSortCols, Double timeInterval=0)
 ROVisibilityIterator (const asyncio::PrefetchColumns *prefetchColumns, const MeasurementSet &ms, const Block< Int > &sortColumns, const Bool addDefaultSortCols=True, Double timeInterval=0)
 ROVisibilityIterator (const asyncio::PrefetchColumns *prefetchColumns, const Block< MeasurementSet > &mss, const Block< Int > &sortColumns, const Bool addDefaultSortCols=True, Double timeInterval=0)
 ROVisibilityIterator (const ROVisibilityIterator &other)
 Copy construct.
 ROVisibilityIterator (const asyncio::PrefetchColumns *prefetchColumns, const ROVisibilityIterator &other)
ROVisibilityIteratoroperator= (const ROVisibilityIterator &other)
 Assigment.
virtual ~ROVisibilityIterator ()
 Destructor.
Bool isAsynchronous () const
 static ROVisibilityIterator * create (const MeasurementSet & ms, const Block<Int>& sortColumns, const asyncio::PrefetchColumns * prefetchColumns = NULL, const Bool addDefaultSortCols = True, Double timeInterval=0);
Bool isAsyncEnabled () const
Bool isWritable () const
void origin ()
 Reset iterator to origin/start of data (of current chunk)
void originChunks ()
 Reset iterator to true start of data (first chunk)
Double getInterval () const
 Return the time interval (in seconds) used for iteration.
void setInterval (Double timeInterval)
 Set or reset the time interval (in seconds) to use for iteration.
void setRowBlocking (Int nRows=0)
 Set the 'blocking' size for returning data.
Bool more () const
 Return False if no more data (in current chunk)
SubChunkPair getSubchunkId () const
ROVisibilityIteratoroperator++ (int)
 Advance iterator through data.
ROVisibilityIteratoroperator++ ()
Bool moreChunks () const
 Return False if no more 'Chunks' of data left.
Bool newMS () const
 Check if ms has change since last iteration.
Int msId () const
VisBuffergetVisBuffer ()
const MeasurementSetms () const
 reference to actual ms in interator
ROVisibilityIteratornextChunk ()
 Advance to the next Chunk of data.
Vector< Int > & antenna1 (Vector< Int > &ant1) const
 Return antenna1.
Vector< Int > & antenna2 (Vector< Int > &ant2) const
 Return antenna2.
Vector< Int > & feed1 (Vector< Int > &fd1) const
 Return feed1.
Vector< Int > & feed2 (Vector< Int > &fd2) const
 Return feed2.
virtual Vector< Int > & channel (Vector< Int > &chan) const
 Return channel numbers in selected VisSet spectrum (i.e.
Vector< SquareMatrix< Complex, 2 > > & CJones (Vector< SquareMatrix< Complex, 2 > > &cjones) const
 Return feed configuration matrix for specified antenna.
const Cube< Double > & receptorAngles () const
 Return receptor angles for all antennae and feeds First axis of the cube is a receptor number, 2nd is antennaId, 3rd is feedId Note: the method is intended to provide an access to MSIter::receptorAngles for VisBuffer in the multi-feed case.
const Vector< String > & antennaMounts () const
 return a string mount identifier for each antenna
const Cube< RigidVector
< Double, 2 > > & 
getBeamOffsets () const
 Return a cube containing pairs of coordinate offsets for each receptor of each feed (values are in radians, coordinate system is fixed with antenna and is the same one as used to define the BEAM_OFFSET parameter in the feed table).
Bool allBeamOffsetsZero () const
 True if all elements of the cube returned by getBeamOffsets are zero.
Vector< Floatfeed_pa (Double time) const
 Return feed parallactic angles Vector(nant) (1 feed/ant)
const Floatparang0 (Double time) const
 Return nominal parallactic angle at specified time (does not include feed position angle offset--see feed_pa) A global value for all antennas (e.g., small array)
Vector< Floatparang (Double time) const
 Per antenna:
MDirection azel0 (Double time) const
 Return the antenna AZ/EL Vector(nant)
Vector< MDirectionazel (Double time) const
Double hourang (Double time) const
 Return the hour angle for the specified time.
Int fieldId () const
 Return the current FieldId.
Int arrayId () const
 Return the current ArrayId.
String fieldName () const
 Return the current Field Name.
String sourceName () const
 Return the current Source Name.
virtual Cube< Bool > & flag (Cube< Bool > &flags) const
 Return flag for each polarization, channel and row.
Matrix< Bool > & flag (Matrix< Bool > &flags) const
 Return flag for each channel & row.
Bool existsFlagCategory () const
 Determine whether FLAG_CATEGORY is valid.
Array< Bool > & flagCategory (Array< Bool > &flagCategories) const
 Return flags for each polarization, channel, category, and row.
Vector< Bool > & flagRow (Vector< Bool > &rowflags) const
 Return row flag.
Vector< Int > & scan (Vector< Int > &scans) const
 Return scan number.
Vector< Int > & observationId (Vector< Int > &obsids) const
 Return the OBSERVATION_IDs.
Vector< Int > & processorId (Vector< Int > &procids) const
 Return the PROCESSOR_IDs.
Vector< Int > & stateId (Vector< Int > &stateids) const
 Return the STATE_IDs.
virtual Vector< Double > & frequency (Vector< Double > &freq) const
 Return current frequencies (in Hz, acc.
Vector< Double > & lsrFrequency (Vector< Double > &freq) const
 Return frequencies (in Hz, acc.
const MDirectionphaseCenter () const
 Return the current phase center as an MDirection.
Int polFrame () const
 Return frame for polarization (returns PolFrame enum)
virtual Vector< Int > & corrType (Vector< Int > &corrTypes) const
 Return the correlation type (returns Stokes enums)
Vector< Float > & sigma (Vector< Float > &sig) const
 Return sigma.
virtual Matrix< Float > & sigmaMat (Matrix< Float > &sigmat) const
 Return sigma matrix (pol-dep)
Int spectralWindow () const
 Return current SpectralWindow.
Int polarizationId () const
 Return current Polarization Id.
Int dataDescriptionId () const
 Return current DataDescription Id.
Vector< Double > & time (Vector< Double > &t) const
 Return MJD midpoint of interval.
Vector< Double > & timeCentroid (Vector< Double > &t) const
 Return MJD centroid of interval.
Vector< Double > & timeInterval (Vector< Double > &ti) const
 Return nominal time interval.
Vector< Double > & exposure (Vector< Double > &expo) const
 Return actual time interval.
virtual Cube< Complex > & visibility (Cube< Complex > &vis, DataColumn whichOne) const
 Return the visibilities as found in the MS, Cube(npol,nchan,nrow).
Cube< Float > & floatData (Cube< Float > &fcube) const
 Return FLOAT_DATA as a Cube(npol, nchan, nrow) if found in the MS.
Matrix< CStokesVector > & visibility (Matrix< CStokesVector > &vis, DataColumn whichOne) const
 Return the visibility 4-vector of polarizations for each channel.
IPosition visibilityShape () const
 Return the shape of the visibility Cube.
virtual Vector< RigidVector
< Double, 3 > > & 
uvw (Vector< RigidVector< Double, 3 > > &uvwvec) const
 Return u,v and w (in meters)
Matrix< Double > & uvwMat (Matrix< Double > &uvwmat) const
Vector< Float > & weight (Vector< Float > &wt) const
 Return weight.
virtual Matrix< Float > & weightMat (Matrix< Float > &wtmat) const
 Returns the nPol_p x curNumRow_p weight matrix.
Bool existsWeightSpectrum () const
 Determine whether WEIGHT_SPECTRUM exists.
Cube< Float > & weightSpectrum (Cube< Float > &wtsp) const
 Return weightspectrum (a weight for each channel)
Bool newFieldId () const
 Return imaging weight (a weight for each channel) Matrix<Float>& imagingWeight(Matrix<Float>& wt) const; Return True if FieldId/Source has changed since last iteration.
Bool newArrayId () const
 Return True if arrayID has changed since last iteration.
Bool newSpectralWindow () const
 Return True if SpectralWindow has changed since last iteration.
Int channelIndex () const
 Return the index of the first channel of the current channel group in the total (selected) spectrum.
Int channelGroupSize () const
 Return the width of the current group of channels, i.e., the number of channels returned by visibility() and frequency().
Int nCorr () const
 Return the number of correlations in the current iteration.
Int nRow () const
 Return the number of rows in the current iteration.
virtual Vector< uInt > & rowIds (Vector< uInt > &rowids) const
 Return the row ids as from the original root table.
Int nRowChunk () const
 Return the numbers of rows in the current chunk.
Int nSubInterval () const
 Return the number of sub-intervals in the current chunk.
void slurp () const
 Call to use the slurp i/o method for all scalar columns.
ROVisibilityIteratorselectVelocity (Int nChan, const MVRadialVelocity &vStart, const MVRadialVelocity &vInc, MRadialVelocity::Types rvType=MRadialVelocity::LSR, MDoppler::Types dType=MDoppler::RADIO, Bool precise=False)
 Velocity selection - specify the output channels in velocity: nChan - number of output channels, vStart - start velocity, vInc - velocity increment.
ROVisibilityIteratorvelInterpolation (const String &type)
 Select the velocity interpolation scheme.
ROVisibilityIteratorselectChannel (Int nGroup=1, Int start=0, Int width=0, Int increment=1, Int spectralWindow=-1)
 Channel selection - only the selected channels will be returned by the access functions.
ROVisibilityIteratorselectChannel (Block< Vector< Int > > &blockNGroup, Block< Vector< Int > > &blockStart, Block< Vector< Int > > &blockWidth, Block< Vector< Int > > &blockIncr, Block< Vector< Int > > &blockSpw)
 Same as above except when multiple ms's are to be accessed.
void getChannelSelection (Block< Vector< Int > > &blockNGroup, Block< Vector< Int > > &blockStart, Block< Vector< Int > > &blockWidth, Block< Vector< Int > > &blockIncr, Block< Vector< Int > > &blockSpw)
 get the channel selection ...the block over the number of ms's associated with this iterator
void slicesToMatrices (Vector< Matrix< Int > > &matv, const Vector< Vector< Slice > > &slicesv, const Vector< Int > &widthsv) const
 Translate slicesv from the form returned by MSSelection::getChanSlices() to matv as used by setChanAveBounds().
void getSpwInFreqRange (Block< Vector< Int > > &spw, Block< Vector< Int > > &start, Block< Vector< Int > > &nchan, Double freqStart, Double freqEnd, Double freqStep, MFrequency::Types freqFrame=MFrequency::LSRK)
 Get the spw, start and nchan for all the ms's is this Visiter that match the frequecy "freqstart-freqStep" and "freqEnd+freqStep" range Can help in doing channel selection above.
void getFreqInSpwRange (Double &freqStart, Double &freqEnd, MFrequency::Types freqframe=MFrequency::LSRK)
 Get the frequency range of the data selection.
void attachVisBuffer (VisBuffer &vb)
 Attach a VisBuffer object.
void detachVisBuffer (VisBuffer &vb)
 Detach a VisBuffer object.
const ROMSColumnsmsColumns () const
 Access the current ROMSColumns object in MSIter.
void allSelectedSpectralWindows (Vector< Int > &spws, Vector< Int > &nvischan)
 get back the selected spectral windows and spectral channels for current ms
void lsrFrequency (const Int &spw, Vector< Double > &freq, Bool &convert, const Bool ignoreconv=False)
 Convert the frequency from the observe frame to lsr frame.
void useImagingWeight (const VisImagingWeight &imWgt)
 assign a VisImagingWeight object to this iterator
const VisImagingWeightgetImagingWeightGenerator () const
Int numberAnt ()
 return number of Ant
Int numberCoh ()
 Return number of rows in all selected ms's.
Int numberSpw ()
 Return number of spws, polids, ddids.
Int numberPol ()
Int numberDDId ()
Int getDataDescriptionId () const
 ROArrayColumn <Double> & getChannelFrequency () const; Block<Int> getChannelGroupNumber () const; Block<Int> getChannelIncrement () const; Block<Int> getChannelStart () const; Block<Int> getChannelWidth () const;.
const MeasurementSetgetMeasurementSet () const
Int getMeasurementSetId () const
Int getNAntennas () const
MEpoch getEpoch () const
Vector< FloatgetReceptor0Angle ()
Vector< uIntgetRowIds () const
const Block< Int > & getSortColumns () const
 Returns the columns that the VisibilityIterator is sorting by.

Static Public Member Functions

static Bool isAsynchronousIoEnabled ()
static Vector< Floatfeed_paCalculate (Double time, MSDerivedValues &msd, Int nAntennas, const MEpoch &mEpoch0, const Vector< Float > &receptor0Angle)
static Float parang0Calculate (Double time, MSDerivedValues &msd, const MEpoch &epoch0)
static Vector< FloatparangCalculate (Double time, MSDerivedValues &msd, int nAntennas, const MEpoch mEpoch0)
static void azel0Calculate (Double time, MSDerivedValues &msd, MDirection &azel0, const MEpoch &mEpoch0)
static void azelCalculate (Double time, MSDerivedValues &msd, Vector< MDirection > &azel, Int nAnt, const MEpoch &mEpoch0)
static Double hourangCalculate (Double time, MSDerivedValues &msd, const MEpoch &mEpoch0)
static void lsrFrequency (const Int &spw, Vector< Double > &freq, Bool &convert, const Block< Int > &chanStart, const Block< Int > &chanWidth, const Block< Int > &chanInc, const Block< Int > &numChanGroup, const ROArrayColumn< Double > &chanFreqs, const ROScalarColumn< Int > &obsMFreqTypes, const MEpoch &ep, const MPosition &obsPos, const MDirection &dir)
static String getAipsRcBase ()

Protected Member Functions

 ROVisibilityIterator (const asyncio::PrefetchColumns *prefetchColumns, const Block< MeasurementSet > &mss, const Block< Int > &sortColumns, const Bool addDefaultSortCols, Double timeInterval, Bool writable)
void construct (const asyncio::PrefetchColumns *prefetchColumns, const Block< MeasurementSet > &mss, const Block< Int > &sortColumns, const Bool addDefaultSortCols, Double timeInterval, Bool writable, const Factory &factory)
VisibilityIteratorReadImplgetReadImpl () const
bool existsColumn (VisBufferComponents::EnumType id) const
virtual void advance ()
 advance the iteration
virtual void setSelTable ()
 set the currently selected table
void setState ()
 set the iteration state
void getTopoFreqs ()
 get the TOPO frequencies from the selected velocities and the obs.
void getTopoFreqs (Vector< Double > &lsrFreq, Vector< Double > &selFreq)
void getLsrInfo (Block< Int > &channelGroupNumber, Block< Int > &channelIncrement, Block< Int > &channelStart, Block< Int > &channelWidth, MPosition &observatoryPositon, MDirection &phaseCenter, Bool &velocitySelection) const
std::vector< MeasurementSetgetMeasurementSets () const
const MSDerivedValuesgetMSD () const
virtual void updateSlicer ()
 update the DATA slicer
virtual void attachColumns (const Table &t)
 attach the column objects to the currently selected table
virtual const Table attachTable () const
 returns the table, to which columns are attached, can be overridden in derived classes
void getDataColumn (DataColumn whichOne, const Slicer &slicer, Cube< Complex > &data) const
 get the (velocity selected) interpolated visibilities, flags and weights.
void getDataColumn (DataColumn whichOne, Cube< Complex > &data) const
void getFloatDataColumn (const Slicer &slicer, Cube< Float > &data) const
 get FLOAT_DATA as real Floats.
void getFloatDataColumn (Cube< Float > &data) const
void originChunks (Bool forceRewind)
void doChannelSelection ()
 Re-Do the channel selection in multi ms case.
virtual void setTileCache ()
 Set the tile cache size....when using slice access if tile cache size is not set memory usage can go wild.
Bool isInSelectedSPW (const Int &spw)
 Check if spw is in selected SPW for actual ms.
void update_rowIds () const
 Updates, if necessary, rowIds_p member for the current chunk.
void setAsyncEnabled (Bool enable)
template<class T >
void getColScalar (const ROScalarColumn< T > &column, Vector< T > &array, Bool resize) const
template<class T >
void getColArray (const ROArrayColumn< T > &column, Array< T > &array, Bool resize) const
virtual void getCol (const ROScalarColumn< Bool > &column, Vector< Bool > &array, Bool resize=False) const
 column access functions, can be overridden in derived classes
virtual void getCol (const ROScalarColumn< Int > &column, Vector< Int > &array, Bool resize=False) const
virtual void getCol (const ROScalarColumn< Double > &column, Vector< Double > &array, Bool resize=False) const
virtual void getCol (const ROArrayColumn< Bool > &column, Array< Bool > &array, Bool resize=False) const
virtual void getCol (const ROArrayColumn< Float > &column, Array< Float > &array, Bool resize=False) const
virtual void getCol (const ROArrayColumn< Double > &column, Array< Double > &array, Bool resize=False) const
virtual void getCol (const ROArrayColumn< Complex > &column, Array< Complex > &array, Bool resize=False) const
virtual void getCol (const ROArrayColumn< Bool > &column, const Slicer &slicer, Array< Bool > &array, Bool resize=False) const
virtual void getCol (const ROArrayColumn< Float > &column, const Slicer &slicer, Array< Float > &array, Bool resize=False) const
virtual void getCol (const ROArrayColumn< Complex > &column, const Slicer &slicer, Array< Complex > &array, Bool resize=False) const
template<class T >
void swapyz (Cube< T > &out, const Cube< T > &in) const
 void getCol(const String &colName, Array<Double> &array, Array<Double> &all, Bool resize = False) const; void getCol(const String &colName, Vector<Bool> &array, Vector<Bool> &all, Bool resize = False) const; void getCol(const String &colName, Vector<Int> &array, Vector<Int> &all, Bool resize = False) const; void getCol(const String &colName, Vector<Double> &array, Vector<Double> &all, Bool resize = False) const;

Protected Attributes

VisibilityIteratorReadImplreadImpl_p

Friends

class AsyncEnabler
class VisibilityIteratorReadImpl
class ViReadImplAsync
class asyncio::VLAT

Detailed Description

ROVisibilityIterator iterates through one or more readonly MeasurementSets.

Intended use:

Public interface

Review Status

Date Reviewed:
yyyy/mm/dd

Prerequisite

Etymology

The ROVisibilityIterator is a readonly iterator returning visibilities

Synopsis

ROVisibilityIterator provides iteration with various sort orders for one or more MSs. It has member functions to retrieve the fields commonly needed in synthesis calibration and imaging.

One should use VisBuffer to access chunks of data.

ROVisibilityIterators can be either synchronous or asynchronous, depending on the constructor used to create them as well as the current value of a CASARC file setting. A synchronous instance is works the same as this class ever worked; an asynchronous instance uses a second thread (the Visibility Lookahead Thread or VLAT) to fill the VisBuffers in advance of their use by the original thread.

To create an asynchronous instance of ROVI you must use one of the two constructors which have a pointer to a PrefetchColumns object as the first argument. This object specifies which table columns should be prefetched by the VLAT; accessing columns not specified in the PrefetchColumns object will result in an exception containing an error message indicating that a the VisBuffer does not contain the requested column. In addition to using the appropriate constructor, the CASARC file setting VisibilityIterator.

+-------------------+ | | | *** Nota Bene *** | | | +-------------------+

Because of the multithreaded nature of asynchronous I/O, the user needs to be a bit more careful in the use of the VI and it's attached VisBuffer. Data access operations need to be directed to the VisBuffer. Additionally the user must not attempt to access the data using a separate VI since the underlying casacore objects are not threadsafe and bizarre errors will likely occur.

CASARC Settings

Normal settings

VisibilityIterator.async.enabled - Boolean value that enables or disables async I/O. The default value is currently False (i.e., disabled). VisibilityIterator.async.nBuffers - The number of lookahead buffers. This defaults to 2.

Debug settings

VisibilityIterator.async.doStats: true VisibilityIterator.async.debug.logFile: stderr VisibilityIterator.async.debug.logLevel: 1

Example

Motivation

For imaging and calibration you need to access an MS in some consistent order (by field, spectralwindow, time interval etc.). This class provides that access.

Thrown Exceptions

To Do

Definition at line 283 of file VisibilityIterator.h.


Member Typedef Documentation


Member Enumeration Documentation

Enumerator:
Observed 
Model 
Corrected 

Definition at line 318 of file VisibilityIterator.h.

Enumerator:
Circular 

Circular polarization.

Linear 

Linear polarization.

Definition at line 311 of file VisibilityIterator.h.


Constructor & Destructor Documentation

Default constructor - useful only to assign another iterator later.

casa::ROVisibilityIterator::ROVisibilityIterator ( const MeasurementSet ms,
const Block< Int > &  sortColumns,
Double  timeInterval = 0,
const Factory factory = Factory() 
)

Construct from an MS and a Block of MS column enums specifying the iteration order.

If no order is specified, it uses the default sort order of MSIter, which is not necessarily the raw order of ms! The default ordering is ARRAY_ID, FIELD_ID, DATA_DESC_ID, and TIME, but check MSIter.h to be sure. These columns will be added first if they are not specified.

An optional timeInterval (in seconds) can be given to iterate through chunks of time. The default interval of 0 groups all times together. Every 'chunk' of data contains all data within a certain time interval and with identical values of the other iteration columns (e.g. DATA_DESC_ID and FIELD_ID). Using selectChannel(), a number of groups of channels can be requested. At present the channel group iteration will always occur before the interval iteration.

casa::ROVisibilityIterator::ROVisibilityIterator ( const MeasurementSet ms,
const Block< Int > &  sortColumns,
const Bool  addDefaultSortCols,
Double  timeInterval = 0 
)

Same as above, but with the option of using the raw order of ms (addDefaultSortCols=false).

casa::ROVisibilityIterator::ROVisibilityIterator ( const Block< MeasurementSet > &  mss,
const Block< Int > &  sortColumns,
Double  timeInterval = 0 
)

Same as previous constructors, but with multiple MSs to iterate over.

casa::ROVisibilityIterator::ROVisibilityIterator ( const Block< MeasurementSet > &  mss,
const Block< Int > &  sortColumns,
const Bool  addDefaultSortCols,
Double  timeInterval = 0 
)
casa::ROVisibilityIterator::ROVisibilityIterator ( const asyncio::PrefetchColumns prefetchColumns,
const MeasurementSet ms,
const Block< Int > &  sortColumns,
const Bool  addDefaultSortCols = True,
Double  timeInterval = 0 
)
casa::ROVisibilityIterator::ROVisibilityIterator ( const asyncio::PrefetchColumns prefetchColumns,
const Block< MeasurementSet > &  mss,
const Block< Int > &  sortColumns,
const Bool  addDefaultSortCols = True,
Double  timeInterval = 0 
)

Copy construct.

This calls the assigment operator.

Destructor.

casa::ROVisibilityIterator::ROVisibilityIterator ( const asyncio::PrefetchColumns prefetchColumns,
const Block< MeasurementSet > &  mss,
const Block< Int > &  sortColumns,
const Bool  addDefaultSortCols,
Double  timeInterval,
Bool  writable 
) [protected]

Member Function Documentation

virtual void casa::ROVisibilityIterator::advance ( ) [protected, virtual]

advance the iteration

True if all elements of the cube returned by getBeamOffsets are zero.

get back the selected spectral windows and spectral channels for current ms

Reimplemented in casa::ROVisIterator.

Referenced by casa::VisBuffer::allSelectedSpectralWindows().

Return antenna1.

Return antenna2.

return a string mount identifier for each antenna

Return the current ArrayId.

virtual void casa::ROVisibilityIterator::attachColumns ( const Table t) [protected, virtual]

attach the column objects to the currently selected table

Reimplemented in casa::VisibilityIterator, and casa::VisIterator.

virtual const Table casa::ROVisibilityIterator::attachTable ( ) const [protected, virtual]

returns the table, to which columns are attached, can be overridden in derived classes

Attach a VisBuffer object.

Note that while more than one VisBuffer may be attached, only the last one is actively updated. A Stack is kept internally, so after a detach, the previous VisBuffer becomes active again.

Return the antenna AZ/EL Vector(nant)

static void casa::ROVisibilityIterator::azel0Calculate ( Double  time,
MSDerivedValues msd,
MDirection azel0,
const MEpoch mEpoch0 
) [static]
static void casa::ROVisibilityIterator::azelCalculate ( Double  time,
MSDerivedValues msd,
Vector< MDirection > &  azel,
Int  nAnt,
const MEpoch mEpoch0 
) [static]
virtual Vector<Int>& casa::ROVisibilityIterator::channel ( Vector< Int > &  chan) const [virtual]

Return channel numbers in selected VisSet spectrum (i.e.

disregarding possible selection on the iterator, but including the selection set when creating the VisSet)

Return the width of the current group of channels, i.e., the number of channels returned by visibility() and frequency().

Return the index of the first channel of the current channel group in the total (selected) spectrum.

Vector<SquareMatrix<Complex,2> >& casa::ROVisibilityIterator::CJones ( Vector< SquareMatrix< Complex, 2 > > &  cjones) const

Return feed configuration matrix for specified antenna.

void casa::ROVisibilityIterator::construct ( const asyncio::PrefetchColumns prefetchColumns,
const Block< MeasurementSet > &  mss,
const Block< Int > &  sortColumns,
const Bool  addDefaultSortCols,
Double  timeInterval,
Bool  writable,
const Factory factory 
) [protected]
virtual Vector<Int>& casa::ROVisibilityIterator::corrType ( Vector< Int > &  corrTypes) const [virtual]

Return the correlation type (returns Stokes enums)

Reimplemented in casa::ROVisIterator.

Return current DataDescription Id.

Detach a VisBuffer object.

If the object detached is not the last one attached an exception is thrown.

Re-Do the channel selection in multi ms case.

Determine whether FLAG_CATEGORY is valid.

Determine whether WEIGHT_SPECTRUM exists.

Referenced by casa::VisBuffer::existsWeightSpectrum().

Return actual time interval.

Return feed1.

Return feed2.

Return feed parallactic angles Vector(nant) (1 feed/ant)

static Vector<Float> casa::ROVisibilityIterator::feed_paCalculate ( Double  time,
MSDerivedValues msd,
Int  nAntennas,
const MEpoch mEpoch0,
const Vector< Float > &  receptor0Angle 
) [static]

Return the current FieldId.

Return the current Field Name.

virtual Cube<Bool>& casa::ROVisibilityIterator::flag ( Cube< Bool > &  flags) const [virtual]

Return flag for each polarization, channel and row.

Return flag for each channel & row.

Array<Bool>& casa::ROVisibilityIterator::flagCategory ( Array< Bool > &  flagCategories) const

Return flags for each polarization, channel, category, and row.

Return row flag.

Return FLOAT_DATA as a Cube(npol, nchan, nrow) if found in the MS.

virtual Vector<Double>& casa::ROVisibilityIterator::frequency ( Vector< Double > &  freq) const [virtual]

Return current frequencies (in Hz, acc.

to the MS def'n v.2)

Definition at line 750 of file VisibilityIterator.h.

Return a cube containing pairs of coordinate offsets for each receptor of each feed (values are in radians, coordinate system is fixed with antenna and is the same one as used to define the BEAM_OFFSET parameter in the feed table).

The cube axes are receptor, antenna, feed.

void casa::ROVisibilityIterator::getChannelSelection ( Block< Vector< Int > > &  blockNGroup,
Block< Vector< Int > > &  blockStart,
Block< Vector< Int > > &  blockWidth,
Block< Vector< Int > > &  blockIncr,
Block< Vector< Int > > &  blockSpw 
)

get the channel selection ...the block over the number of ms's associated with this iterator

Reimplemented in casa::ROVisIterator.

Referenced by casa::VisBuffer::getChannelSelection().

virtual void casa::ROVisibilityIterator::getCol ( const ROScalarColumn< Bool > &  column,
Vector< Bool > &  array,
Bool  resize = False 
) const [protected, virtual]

column access functions, can be overridden in derived classes

virtual void casa::ROVisibilityIterator::getCol ( const ROScalarColumn< Int > &  column,
Vector< Int > &  array,
Bool  resize = False 
) const [protected, virtual]
virtual void casa::ROVisibilityIterator::getCol ( const ROScalarColumn< Double > &  column,
Vector< Double > &  array,
Bool  resize = False 
) const [protected, virtual]
virtual void casa::ROVisibilityIterator::getCol ( const ROArrayColumn< Bool > &  column,
Array< Bool > &  array,
Bool  resize = False 
) const [protected, virtual]
virtual void casa::ROVisibilityIterator::getCol ( const ROArrayColumn< Float > &  column,
Array< Float > &  array,
Bool  resize = False 
) const [protected, virtual]
virtual void casa::ROVisibilityIterator::getCol ( const ROArrayColumn< Double > &  column,
Array< Double > &  array,
Bool  resize = False 
) const [protected, virtual]
virtual void casa::ROVisibilityIterator::getCol ( const ROArrayColumn< Complex > &  column,
Array< Complex > &  array,
Bool  resize = False 
) const [protected, virtual]
virtual void casa::ROVisibilityIterator::getCol ( const ROArrayColumn< Bool > &  column,
const Slicer slicer,
Array< Bool > &  array,
Bool  resize = False 
) const [protected, virtual]
virtual void casa::ROVisibilityIterator::getCol ( const ROArrayColumn< Float > &  column,
const Slicer slicer,
Array< Float > &  array,
Bool  resize = False 
) const [protected, virtual]
virtual void casa::ROVisibilityIterator::getCol ( const ROArrayColumn< Complex > &  column,
const Slicer slicer,
Array< Complex > &  array,
Bool  resize = False 
) const [protected, virtual]
template<class T >
void casa::ROVisibilityIterator::getColArray ( const ROArrayColumn< T > &  column,
Array< T > &  array,
Bool  resize 
) const [protected]
template<class T >
void casa::ROVisibilityIterator::getColScalar ( const ROScalarColumn< T > &  column,
Vector< T > &  array,
Bool  resize 
) const [protected]
void casa::ROVisibilityIterator::getDataColumn ( DataColumn  whichOne,
const Slicer slicer,
Cube< Complex > &  data 
) const [protected]

get the (velocity selected) interpolated visibilities, flags and weights.

It is not really const at all (it seems to use This-> trickery so callers like flag() can be declared const). void getInterpolatedVisFlagWeight(DataColumn whichOne) const; get the (velocity selected) interpolated FLOAT_DATA (as real Floats), flags and weights. void getInterpolatedFloatDataFlagWeight() const; get the visibility data (observed, corrected or model); deals with Float and Complex observed data (DATA or FLOAT_DATA)

void casa::ROVisibilityIterator::getDataColumn ( DataColumn  whichOne,
Cube< Complex > &  data 
) const [protected]

ROArrayColumn <Double> & getChannelFrequency () const; Block<Int> getChannelGroupNumber () const; Block<Int> getChannelIncrement () const; Block<Int> getChannelStart () const; Block<Int> getChannelWidth () const;.

void casa::ROVisibilityIterator::getFloatDataColumn ( const Slicer slicer,
Cube< Float > &  data 
) const [protected]

get FLOAT_DATA as real Floats.

void casa::ROVisibilityIterator::getFloatDataColumn ( Cube< Float > &  data) const [protected]

Get the frequency range of the data selection.

Return the time interval (in seconds) used for iteration.

This is not the same as the INTERVAL column.

void casa::ROVisibilityIterator::getLsrInfo ( Block< Int > &  channelGroupNumber,
Block< Int > &  channelIncrement,
Block< Int > &  channelStart,
Block< Int > &  channelWidth,
MPosition observatoryPositon,
MDirection phaseCenter,
Bool velocitySelection 
) const [protected]

Reimplemented in casa::ROVisIterator.

Returns the columns that the VisibilityIterator is sorting by.

void casa::ROVisibilityIterator::getSpwInFreqRange ( Block< Vector< Int > > &  spw,
Block< Vector< Int > > &  start,
Block< Vector< Int > > &  nchan,
Double  freqStart,
Double  freqEnd,
Double  freqStep,
MFrequency::Types  freqFrame = MFrequency::LSRK 
)

Get the spw, start and nchan for all the ms's is this Visiter that match the frequecy "freqstart-freqStep" and "freqEnd+freqStep" range Can help in doing channel selection above.

freqFrame is the frame the caller frequency values are in (freqStart and freqEnd) These will be converted to the frame of the selected spw to match

get the TOPO frequencies from the selected velocities and the obs.

vel.

void casa::ROVisibilityIterator::getTopoFreqs ( Vector< Double > &  lsrFreq,
Vector< Double > &  selFreq 
) [protected]

Return the hour angle for the specified time.

static Double casa::ROVisibilityIterator::hourangCalculate ( Double  time,
MSDerivedValues msd,
const MEpoch mEpoch0 
) [static]

static ROVisibilityIterator * create (const MeasurementSet & ms, const Block<Int>& sortColumns, const asyncio::PrefetchColumns * prefetchColumns = NULL, const Bool addDefaultSortCols = True, Double timeInterval=0);

static ROVisibilityIterator * create (const Block<MeasurementSet>& mss, const Block<Int>& sortColumns, const asyncio::PrefetchColumns * prefetchColumns = NULL, const Bool addDefaultSortCols = True, Double timeInterval=0);

static ROVisibilityIterator * create (const ROVisibilityIterator & rovi, const asyncio::PrefetchColumns * prefetchColumns, Int nReadAheadBuffers = 2);

Members

Check if spw is in selected SPW for actual ms.

Reimplemented in casa::VisibilityIterator.

Return frequencies (in Hz, acc.

to the MS def'n v.2) in selected velocity frame, returns the same as frequency() if there is no vel selection active.

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

Convert the frequency from the observe frame to lsr frame.

Returns True in convert if given spw was not observed in the LSRK frame when ignoreconv=True...no conversion is done from data frame frequency is served as is

Reimplemented in casa::ROVisIterator.

static void casa::ROVisibilityIterator::lsrFrequency ( const Int spw,
Vector< Double > &  freq,
Bool convert,
const Block< Int > &  chanStart,
const Block< Int > &  chanWidth,
const Block< Int > &  chanInc,
const Block< Int > &  numChanGroup,
const ROArrayColumn< Double > &  chanFreqs,
const ROScalarColumn< Int > &  obsMFreqTypes,
const MEpoch ep,
const MPosition obsPos,
const MDirection dir 
) [static]

Return False if no more data (in current chunk)

Return False if no more 'Chunks' of data left.

reference to actual ms in interator

Access the current ROMSColumns object in MSIter.

Referenced by casa::VisBuffer::msColumns().

Return the number of correlations in the current iteration.

Return True if arrayID has changed since last iteration.

Return imaging weight (a weight for each channel) Matrix<Float>& imagingWeight(Matrix<Float>& wt) const; Return True if FieldId/Source has changed since last iteration.

Check if ms has change since last iteration.

Return True if SpectralWindow has changed since last iteration.

Advance to the next Chunk of data.

Return the number of rows in the current iteration.

Return the numbers of rows in the current chunk.

Return the number of sub-intervals in the current chunk.

return number of Ant

Return number of rows in all selected ms's.

Return number of spws, polids, ddids.

Return the OBSERVATION_IDs.

ROVisibilityIterator& casa::ROVisibilityIterator::operator++ ( int  )

Advance iterator through data.

Reimplemented in casa::VisibilityIterator, casa::VisIterator, and casa::ROVisIterator.

ROVisibilityIterator& casa::ROVisibilityIterator::operator++ ( )
ROVisibilityIterator& casa::ROVisibilityIterator::operator= ( const ROVisibilityIterator other)

Assigment.

Any attached VisBuffers are lost in the assign.

Reset iterator to origin/start of data (of current chunk)

Reset iterator to true start of data (first chunk)

void casa::ROVisibilityIterator::originChunks ( Bool  forceRewind) [protected]

Per antenna:

Return nominal parallactic angle at specified time (does not include feed position angle offset--see feed_pa) A global value for all antennas (e.g., small array)

static Float casa::ROVisibilityIterator::parang0Calculate ( Double  time,
MSDerivedValues msd,
const MEpoch epoch0 
) [static]
static Vector<Float> casa::ROVisibilityIterator::parangCalculate ( Double  time,
MSDerivedValues msd,
int  nAntennas,
const MEpoch  mEpoch0 
) [static]

Return the current phase center as an MDirection.

Return current Polarization Id.

Referenced by casa::VisBuffer::polarizationId().

Return frame for polarization (returns PolFrame enum)

Return the PROCESSOR_IDs.

Return receptor angles for all antennae and feeds First axis of the cube is a receptor number, 2nd is antennaId, 3rd is feedId Note: the method is intended to provide an access to MSIter::receptorAngles for VisBuffer in the multi-feed case.

It may be worth to change the interface of feed_pa to return the information for all feeds.

virtual Vector<uInt>& casa::ROVisibilityIterator::rowIds ( Vector< uInt > &  rowids) const [virtual]

Return the row ids as from the original root table.

This is useful to find correspondance between a given row in this iteration to the original ms row

Return scan number.

ROVisibilityIterator& casa::ROVisibilityIterator::selectChannel ( Int  nGroup = 1,
Int  start = 0,
Int  width = 0,
Int  increment = 1,
Int  spectralWindow = -1 
)

Channel selection - only the selected channels will be returned by the access functions.

The default spectralWindow is the current one (or 0) This allows selection of the input channels, producing nGroup groups of width output channels. Default is to return all channels in a single group.

ROVisibilityIterator& casa::ROVisibilityIterator::selectChannel ( Block< Vector< Int > > &  blockNGroup,
Block< Vector< Int > > &  blockStart,
Block< Vector< Int > > &  blockWidth,
Block< Vector< Int > > &  blockIncr,
Block< Vector< Int > > &  blockSpw 
)

Same as above except when multiple ms's are to be accessed.

Velocity selection - specify the output channels in velocity: nChan - number of output channels, vStart - start velocity, vInc - velocity increment.

So channel i will have velocity vStart + i*vInc (i=0,nChan-1). Specify velocities as in e.g., MVRadialVelocity(Quantity(2001.,"km/s")). The reference type and velocity definition are specified separately. Note that no averaging is performed, the visibilities will be interpolated and sampled at the specified velocities, it's up to you to choose a vInc appropriate to the channel width. The REST_FREQUENCY column in the SPECTRAL_WINDOW subtable is used to determine the velocity-frequency conversion. By default calculations are done for a single velocity with offsets applied for the others (ok for non-rel velocities with RADIO defn), set precise to True to do a full conversion for each output channel.(NYI)

void casa::ROVisibilityIterator::setAsyncEnabled ( Bool  enable) [protected]

Set or reset the time interval (in seconds) to use for iteration.

You should call originChunks() to reset the iteration after calling this.

Set the 'blocking' size for returning data.

With the default (0) only a single integration is returned at a time, this is what is currently required for the calibration software. With blocking set, up to nRows can be returned in one go. The chunk size determines the actual maximum.

virtual void casa::ROVisibilityIterator::setSelTable ( ) [protected, virtual]

set the currently selected table

set the iteration state

virtual void casa::ROVisibilityIterator::setTileCache ( ) [protected, virtual]

Set the tile cache size....when using slice access if tile cache size is not set memory usage can go wild.

Specifically, the caching scheme is ephemeral and lives for that instance of setting the caching scheme.

If you don't set any then the defaults come into play and caches a few tiles along every axis at the tile you requested...which is a waste when say you know you want to proceed along the row axis for example...and in fact now VisIter just reads one tile (thus the commenting in setTileCache) and lets the OS do the caching rather than than having the table system cache extra tiles.

Return sigma.

virtual Matrix<Float>& casa::ROVisibilityIterator::sigmaMat ( Matrix< Float > &  sigmat) const [virtual]

Return sigma matrix (pol-dep)

void casa::ROVisibilityIterator::slicesToMatrices ( Vector< Matrix< Int > > &  matv,
const Vector< Vector< Slice > > &  slicesv,
const Vector< Int > &  widthsv 
) const

Translate slicesv from the form returned by MSSelection::getChanSlices() to matv as used by setChanAveBounds().

widthsv is the channel averaging width for each selected spw.

Call to use the slurp i/o method for all scalar columns.

This will set the BucketCache cache size to the full column length and cause the full column to be cached in memory, if any value of the column is used. In case of out-of-memory, it will automatically fall-back on the smaller cache size. Slurping the column is to be considered as a work-around for the Table i/o code, which uses BucketCache and performs extremely bad for random access. Slurping is useful when iterating non-sequentially an MS or parts of an MS, it is not tested with multiple MSs.

Return the current Source Name.

Return current SpectralWindow.

Return the STATE_IDs.

template<class T >
void casa::ROVisibilityIterator::swapyz ( Cube< T > &  out,
const Cube< T > &  in 
) const [protected]

void getCol(const String &colName, Array<Double> &array, Array<Double> &all, Bool resize = False) const; void getCol(const String &colName, Vector<Bool> &array, Vector<Bool> &all, Bool resize = False) const; void getCol(const String &colName, Vector<Int> &array, Vector<Int> &all, Bool resize = False) const; void getCol(const String &colName, Vector<Double> &array, Vector<Double> &all, Bool resize = False) const;

Return MJD midpoint of interval.

Return MJD centroid of interval.

Return nominal time interval.

void casa::ROVisibilityIterator::update_rowIds ( ) const [protected]

Updates, if necessary, rowIds_p member for the current chunk.

virtual void casa::ROVisibilityIterator::updateSlicer ( ) [protected, virtual]

update the DATA slicer

assign a VisImagingWeight object to this iterator

virtual Vector<RigidVector<Double,3> >& casa::ROVisibilityIterator::uvw ( Vector< RigidVector< Double, 3 > > &  uvwvec) const [virtual]

Return u,v and w (in meters)

Select the velocity interpolation scheme.

At present the choice is limited to : nearest and linear, linear is the default. TODO: add cubic, spline and possibly FFT

virtual Cube<Complex>& casa::ROVisibilityIterator::visibility ( Cube< Complex > &  vis,
DataColumn  whichOne 
) const [virtual]

Return the visibilities as found in the MS, Cube(npol,nchan,nrow).

Return the visibility 4-vector of polarizations for each channel.

If the MS doesn't contain all polarizations, it is assumed it contains one or two parallel hand polarizations.

Return the shape of the visibility Cube.

Return weight.

virtual Matrix<Float>& casa::ROVisibilityIterator::weightMat ( Matrix< Float > &  wtmat) const [virtual]

Returns the nPol_p x curNumRow_p weight matrix.

Return weightspectrum (a weight for each channel)


Friends And Related Function Documentation

friend class AsyncEnabler [friend]

Definition at line 285 of file VisibilityIterator.h.

friend class asyncio::VLAT [friend]

Definition at line 288 of file VisibilityIterator.h.

friend class ViReadImplAsync [friend]

Definition at line 287 of file VisibilityIterator.h.

friend class VisibilityIteratorReadImpl [friend]

Definition at line 286 of file VisibilityIterator.h.


Member Data Documentation

Definition at line 858 of file VisibilityIterator.h.


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