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 | Static Protected Member Functions | Private Attributes | Friends
casa::vi::VisibilityIterator2 Class Reference

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

#include <VisibilityIterator2.h>

List of all members.

Classes

class  Factory

Public Types

enum  DataColumn {
  Observed,
  Model,
  Corrected
}
typedef enum MSIter::PolFrame PolFrame
typedef enum
casa::vi::VisibilityIterator2::DataColumn 
DataColumn

Public Member Functions

 VisibilityIterator2 (const MeasurementSet &ms, const Block< Int > &sortColumns=Block< Int >(), Bool isWritable=False, const VisBufferComponents2 *prefetchColumns=0, const Bool addDefaultSortCols=True, Double timeInterval=0)
 Construct from an MS and a Block of MS column enums specifying the iteration order.
 VisibilityIterator2 (const Block< MeasurementSet > &mss, const Block< Int > &sortColumns=Block< Int >(), Bool isWritable=False, const VisBufferComponents2 *prefetchColumns=0, const Bool addDefaultSortCols=True, Double timeInterval=0)
virtual ~VisibilityIterator2 ()
 Destructor.
void origin ()
 END Experimental Section.
void next ()
Bool more () const
void originChunks ()
void nextChunk ()
Bool moreChunks () const
Subchunk getSubchunkId () const
 Returns the pair (chunk,subchunk) for the current position of the VI.
Iterator operation methods
These methods alter the way
that the VI operates After
applying any of 
these (except slurp which should be called after originChunks) originChunks must be called before the VI is advanced again
otherwise an exception will be thrown (changing these values in the middle of a sweep can lead to unexpected behavior).Selecting ranges of frequencies involves initializing a FrequencySelection(s) object and providing it to the VI.Once properly applied the VI will only return data for the selected frequencies.No interpolation is performed
the data returned is simply
the channels that currently
map to the selected
frequencies for the specified
frame of reference *void 
setFrequencySelection (const FrequencySelection &)
void setFrequencySelection (const FrequencySelections &)
Int getRowBlocking () const
 RowBlocking is a suggestion to the iterator that it try to use subchunks having the suggested number of rows.
void setRowBlocking (Int nRows=0)
Double getInterval () const
 In this context the interval determines what rows will be contained in a chunk.
void setInterval (Double timeInterval)
void slurp () const
 Call to use the slurp i/o method for all scalar columns.
Other methods Returns True if
this is an asynchronous VI
*Bool 
isAsynchronous () const
Bool isWritable () const
 Returns True if this VI is writable (always False for ROVI and True for VI; see VisibilityIterator class).
const Block< Int > & getSortColumns () const
 Returns the columns that the VisibilityIterator2 is sorting by.
VisBuffer2getVisBuffer ()
 Returns the VisBuffer permanently attached to this VisibilityIterator.
const MeasurementSetms () const
 reference to actual ms in interator
const vi::SubtableColumnssubtableColumns () const
Int getReportingFrameOfReference () const
 The reporting frame of reference is the default frame of reference to be used when the user requests the frequencies of the current data selection in a VisBuffer.
void setReportingFrameOfReference (Int)
Int nRowsInChunk () const
 Return the numbers of rows in the current chunk.
void useImagingWeight (const VisImagingWeight &imWgt)
 Assign a VisImagingWeight object to this iterator.
const VisImagingWeightgetImagingWeightGenerator () const
void writeFlag (const Matrix< Bool > &flag)
 Write/modify the flags in the data.
virtual void writeFlag (const Cube< Bool > &flag)
 Write/modify the flags in the data.
virtual void writeFlagRow (const Vector< Bool > &rowflags)
 Write/modify the flag row column; dimension Vector(nrow)
void writeFlagCategory (const Array< Bool > &fc)
void writeVisCorrected (const Cube< Complex > &vis)
 Write/modify the visibilities.
void writeVisModel (const Cube< Complex > &vis)
void writeVisObserved (const Cube< Complex > &vis)
void writeWeight (const Matrix< Float > &wt)
 Write/modify the weights.
virtual void writeWeightSpectrum (const Cube< Float > &wtsp)
 Write/modify the weightMat.
void writeSigma (const Matrix< Float > &sig)
 Write/modify the Sigma.
void writeModel (const RecordInterface &rec, Bool iscomponentlist=True, Bool incremental=False)
 Write/modify the ncorr x nrow SigmaMat.
void writeBackChanges (VisBuffer2 *)
 Requests that the modified VisBuffer2 be written back to the visibility at the same spot that it came from.

Static Public Member Functions

BEGIN Experimental Section
*static VisibilityIterator2
copyingViFactory (const MeasurementSet &srcMs, MeasurementSet &dstMs)
static Bool isAsynchronousIoEnabled ()
 Returns True if async I/O is globally enabled.

Protected Member Functions

 VisibilityIterator2 ()
 VisibilityIterator2 (const VisBufferComponents2 * prefetchColumns, const Block<MeasurementSet>& mss, const Block<Int>& sortColumns, const Bool addDefaultSortCols, Double timeInterval, Bool writable);.
void construct (const VisBufferComponents2 *prefetchColumns, const Block< MeasurementSet > &mss, const Block< Int > &sortColumns, const Bool addDefaultSortCols, Double timeInterval, Bool writable)
ViImplementation2getImpl () const
void antenna1 (Vector< Int > &ant1) const
 +------------------+ | | | Data Accessors | | | +------------------+
void antenna2 (Vector< Int > &ant2) const
 Return antenna2.
void feed1 (Vector< Int > &fd1) const
 Return feed1.
void feed2 (Vector< Int > &fd2) const
 Return feed2.
Bool isNewMS () const
 Returns True is this is a new MS from the last subchunk.
Int msId () const
 Returns the zero-based index of the current MS in the collection of MSs used to create the VI.
Int nAntennas () const
 Return number of Ant.
Int nRowsViWillSweep () const
 Return number of rows in all selected ms's.
Int nSpectralWindows () const
 Return number of spws, polids, ddids.
Int nPolarizations () const
Int nDataDescriptionIds () const
Int nRows () const
 Return the number of rows in the current iteration.
void jonesC (Vector< SquareMatrix< Complex, 2 > > &cjones) const
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.
const Vector< Float > & feed_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)
const Vector< Float > & parang (Double time) const
 Per antenna:
MDirection azel0 (Double time) const
 Return the antenna AZ/EL Vector(nant)
const Vector< MDirection > & azel (Double time) const
Double hourang (Double time) const
 Return the hour angle for the specified time.
void fieldIds (Vector< Int > &) const
 Return the current FieldId.
void arrayIds (Vector< Int > &) const
 Return the current ArrayId.
String fieldName () const
 Return the current Field Name.
String sourceName () const
 Return the current Source Name.
virtual void flag (Cube< Bool > &flags) const
 Return flag for each polarization, channel and row.
virtual void flag (Matrix< Bool > &flags) const
 Return flag for each channel & row.
Bool existsFlagCategory () const
 Determine whether FLAG_CATEGORY is valid.
virtual void flagCategory (Array< Bool > &flagCategories) const
 Return flags for each polarization, channel, category, and row.
virtual void flagRow (Vector< Bool > &rowflags) const
 Return row flag.
virtual void scan (Vector< Int > &scans) const
 Return scan number.
virtual void observationId (Vector< Int > &obsids) const
 Return the OBSERVATION_IDs.
virtual void processorId (Vector< Int > &procids) const
 Return the PROCESSOR_IDs.
virtual void stateId (Vector< Int > &stateids) const
 Return the STATE_IDs.
virtual const MDirectionphaseCenter () const
 Return the current phase center as an MDirection.
virtual Int polFrame () const
 Return frame for polarization (returns PolFrame enum)
virtual void corrType (Vector< Int > &corrTypes) const
 Return the correlation type (returns Stokes enums)
virtual void sigma (Vector< Float > &sig) const
 Return sigma.
virtual void sigmaMat (Matrix< Float > &sigmat) const
 Return sigma matrix (pol-dep)
virtual Int spectralWindow () const
 Return current SpectralWindow.
virtual void spectralWindows (Vector< Int > &spws) const
virtual Int polarizationId () const
 Return current Polarization Id.
virtual Int dataDescriptionId () const
 Return current DataDescription Id.
virtual void dataDescriptionIds (Vector< Int > &ddis) const
virtual void time (Vector< Double > &t) const
 Return MJD midpoint of interval.
virtual void timeCentroid (Vector< Double > &t) const
 Return MJD centroid of interval.
virtual void timeInterval (Vector< Double > &ti) const
 Return nominal time interval.
virtual void exposure (Vector< Double > &expo) const
 Return actual time interval.
virtual void visibilityCorrected (Cube< Complex > &vis) const
 Return the visibilities as found in the MS, Cube(npol,nchan,nrow).
virtual void visibilityModel (Cube< Complex > &vis) const
virtual void visibilityObserved (Cube< Complex > &vis) const
virtual void floatData (Cube< Float > &fcube) const
 Return FLOAT_DATA as a Cube (npol, nchan, nrow) if found in the MS.
virtual IPosition visibilityShape () const
 Return the visibility 4-vector of polarizations for each channel.
virtual void uvw (Matrix< Double > &uvw) const
 Return u,v and w (in meters)
virtual void weight (Vector< Float > &wt) const
 Return weight.
virtual void weightMat (Matrix< Float > &wtmat) const
 Returns the nPol_p x curNumRow_p weight matrix.
Bool existsWeightSpectrum () const
 Determine whether WEIGHT_SPECTRUM exists.
virtual void weightSpectrum (Cube< Float > &wtsp) const
 Return weightspectrum (a weight for each channel)
Vector< IntgetCorrelations () const
 Returns a vector of the correlation types that were selected into the current subchunk's data.
Vector< DoublegetFrequencies (Double time, Int frameOfReference) const
Vector< IntgetChannels (Double time, Int frameOfReference) const
Int getDataDescriptionId () const
 Convert the frequency from the observe frame to lsr frame.
const MeasurementSetgetMeasurementSet () const
Int getMeasurementSetId () const
Int getNAntennas () const
MEpoch getEpoch () const
Vector< FloatgetReceptor0Angle ()
void getRowIds (Vector< uInt > &) const
 Return the row ids as from the original root table.
Bool newFieldId () const
Bool newArrayId () const
 Return True if arrayID has changed since last iteration.
Bool newSpectralWindow () const
 Return True if SpectralWindow has changed since last iteration.
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)
 +-------------------------------+ | | | Internal Management Methods | | | +-------------------------------+
void getFreqInSpwRange (Double &freqStart, Double &freqEnd, MFrequency::Types freqframe=MFrequency::LSRK)
 Get the frequency range of the data selection.
bool existsColumn (VisBufferComponent2 id) const
void originChunks (Bool forceRewind)
 advance the iteration

Static Protected Member Functions

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 String getAipsRcBase ()

Private Attributes

ViImplementation2impl_p

Friends

class VisibilityIteratorImpl2
 These classes are members of the VI/VB framework and need extra access to the non-public methods of this class.
class VisBuffer2Adapter
class VisBufferImpl2
class VisBufferState
class asyncio::VLAT
class AveragingTvi2Factory
 functions VLAT should not access private parts, especially variables

Detailed Description

VisibilityIterator2 iterates through one or more readonly MeasurementSets.

Intended use:

Public interface

Review Status

Date Reviewed:
yyyy/mm/dd

Prerequisite

Etymology

The VisibilityIterator2 is a readonly iterator returning visibilities

Synopsis

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

VisibilityIterator2s 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 VisBuffer components should be prefetched by the VLAT; accessing components not specified in the PrefetchColumns object will result in an exception containing an error message indicating that the VisBuffer does not contain the requested column. In addition to using the appropriate constructor, the CASARC file setting VisibilityIterator2.async.enabled can be used to turn asynchronous I/O off globally; if it's globally enabled then it is still possible for the user to choose to enable/disable it on a VI by VI basis.

+-------------------+ | | | *** 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

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

Debug settings

VisibilityIterator2.async.doStats: true VisibilityIterator2.async.debug.logFile: stderr VisibilityIterator2.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 360 of file VisibilityIterator2.h.


Member Typedef Documentation

Definition at line 400 of file VisibilityIterator2.h.


Member Enumeration Documentation

Enumerator:
Observed 
Model 
Corrected 

Definition at line 402 of file VisibilityIterator2.h.


Constructor & Destructor Documentation

casa::vi::VisibilityIterator2::VisibilityIterator2 ( const MeasurementSet ms,
const Block< Int > &  sortColumns = BlockInt >(),
Bool  isWritable = False,
const VisBufferComponents2 prefetchColumns = 0,
const Bool  addDefaultSortCols = True,
Double  timeInterval = 0 
)

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

These can be specified as MS::ANTENNA1, MS::ARRAY_ID, etc.; they are defined in MSMainEnums.h. 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).

A set of prefetch columns can be specified for asynchronous I/O use. These roughly correspond to the fields accessible from the VisBuffer. Specifying prefetch columns will cause an asynchronous VI to be created if asynchronous I/O is globally enabled. If the user wishes to have application-specific enable/disable of asynchronous I/O then they must implement logic that either either provides prefetch columns (enables) or a null pointer (disables).

casa::vi::VisibilityIterator2::VisibilityIterator2 ( const Block< MeasurementSet > &  mss,
const Block< Int > &  sortColumns = BlockInt >(),
Bool  isWritable = False,
const VisBufferComponents2 prefetchColumns = 0,
const Bool  addDefaultSortCols = True,
Double  timeInterval = 0 
)

Destructor.

VisibilityIterator2 (const VisBufferComponents2 * prefetchColumns, const Block<MeasurementSet>& mss, const Block<Int>& sortColumns, const Bool addDefaultSortCols, Double timeInterval, Bool writable);.


Member Function Documentation

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

void casa::vi::VisibilityIterator2::antenna1 ( Vector< Int > &  ant1) const [protected]

+------------------+ | | | Data Accessors | | | +------------------+

These methods are protected and should only be used by subclasses or befriended framework member classes. Others should access these values via the VisBuffer attached to the VI (see getVisBuffer()).

Return antenna1

void casa::vi::VisibilityIterator2::antenna2 ( Vector< Int > &  ant2) const [protected]

Return antenna2.

return a string mount identifier for each antenna

void casa::vi::VisibilityIterator2::arrayIds ( Vector< Int > &  ) const [protected]

Return the current ArrayId.

const Vector<MDirection>& casa::vi::VisibilityIterator2::azel ( Double  time) const [protected]

Return the antenna AZ/EL Vector(nant)

static void casa::vi::VisibilityIterator2::azel0Calculate ( Double  time,
MSDerivedValues msd,
MDirection azel0,
const MEpoch mEpoch0 
) [static, protected]
static void casa::vi::VisibilityIterator2::azelCalculate ( Double  time,
MSDerivedValues msd,
Vector< MDirection > &  azel,
Int  nAnt,
const MEpoch mEpoch0 
) [static, protected]
void casa::vi::VisibilityIterator2::construct ( const VisBufferComponents2 prefetchColumns,
const Block< MeasurementSet > &  mss,
const Block< Int > &  sortColumns,
const Bool  addDefaultSortCols,
Double  timeInterval,
Bool  writable 
) [protected]
BEGIN Experimental Section* static VisibilityIterator2* casa::vi::VisibilityIterator2::copyingViFactory ( const MeasurementSet srcMs,
MeasurementSet dstMs 
) [static]
virtual void casa::vi::VisibilityIterator2::corrType ( Vector< Int > &  corrTypes) const [protected, virtual]

Return the correlation type (returns Stokes enums)

virtual Int casa::vi::VisibilityIterator2::dataDescriptionId ( ) const [protected, virtual]

Return current DataDescription Id.

virtual void casa::vi::VisibilityIterator2::dataDescriptionIds ( Vector< Int > &  ddis) const [protected, virtual]

Determine whether FLAG_CATEGORY is valid.

Determine whether WEIGHT_SPECTRUM exists.

virtual void casa::vi::VisibilityIterator2::exposure ( Vector< Double > &  expo) const [protected, virtual]

Return actual time interval.

void casa::vi::VisibilityIterator2::feed1 ( Vector< Int > &  fd1) const [protected]

Return feed1.

void casa::vi::VisibilityIterator2::feed2 ( Vector< Int > &  fd2) const [protected]

Return feed2.

const Vector<Float>& casa::vi::VisibilityIterator2::feed_pa ( Double  time) const [protected]

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

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

Return the current FieldId.

Return the current Field Name.

virtual void casa::vi::VisibilityIterator2::flag ( Cube< Bool > &  flags) const [protected, virtual]

Return flag for each polarization, channel and row.

virtual void casa::vi::VisibilityIterator2::flag ( Matrix< Bool > &  flags) const [protected, virtual]

Return flag for each channel & row.

virtual void casa::vi::VisibilityIterator2::flagCategory ( Array< Bool > &  flagCategories) const [protected, virtual]

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

virtual void casa::vi::VisibilityIterator2::flagRow ( Vector< Bool > &  rowflags) const [protected, virtual]

Return row flag.

virtual void casa::vi::VisibilityIterator2::floatData ( Cube< Float > &  fcube) const [protected, virtual]

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

static String casa::vi::VisibilityIterator2::getAipsRcBase ( ) [inline, static, protected]

Definition at line 1037 of file VisibilityIterator2.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.

Vector<Int> casa::vi::VisibilityIterator2::getChannels ( Double  time,
Int  frameOfReference 
) const [protected]

Returns a vector of the correlation types that were selected into the current subchunk's data.

If Vector<Int> c = vi.getCorrelations(); Then c[0] will return the correlation type (as defined in the polarization table) of the first correlation part of a data item (e.g., for a visCube, all elements having the first dimension index of zero will be c[0] type correlations).

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

void casa::vi::VisibilityIterator2::getFreqInSpwRange ( Double freqStart,
Double freqEnd,
MFrequency::Types  freqframe = MFrequency::LSRK 
) [protected]

Get the frequency range of the data selection.

Vector<Double> casa::vi::VisibilityIterator2::getFrequencies ( Double  time,
Int  frameOfReference 
) const [protected]

In this context the interval determines what rows will be contained in a chunk.

A chunk is all the rows in an MS that have the same values in the sort columns, except for time; all rows that otherwise have the same values for the sort columns will be in the chunk if they are no later than "interval" seconds after the first row in the chunk.

This value is unrelated to the interval field of the MS main table.

The reporting frame of reference is the default frame of reference to be used when the user requests the frequencies of the current data selection in a VisBuffer.

This is useful when the user wishes to select the data using one frame of reference but use the frequencies from another frame of reference. If not specified then the default will be to use the frame of reference used to select the data.

These do not change the selection in any way.

RowBlocking is a suggestion to the iterator that it try to use subchunks having the suggested number of rows.

The VI will attempt to honor the suggestion except when there are not enough rows remaining in the chunk or when putting the suggested number of rows in the subchunk cannot be contained in a cube (e.g., there are sets of row with different numbers of frequencies, etc.). The latter case will mainly occur when the row visibility shape changes from one row to the next.

void casa::vi::VisibilityIterator2::getRowIds ( Vector< uInt > &  ) const [protected]

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.

Returns the columns that the VisibilityIterator2 is sorting by.

These are defined in MSMainEnums.h. These can be specified as MS::ANTENNA1, MS::ARRAY_ID, etc.

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

+-------------------------------+ | | | Internal Management Methods | | | +-------------------------------+

Returns the pair (chunk,subchunk) for the current position of the VI.

Only valid after origin has been called.

Returns the VisBuffer permanently attached to this VisibilityIterator.

Return the hour angle for the specified time.

static Double casa::vi::VisibilityIterator2::hourangCalculate ( Double  time,
MSDerivedValues msd,
const MEpoch mEpoch0 
) [static, protected]
Other methods Returns True if this is an asynchronous VI* Bool casa::vi::VisibilityIterator2::isAsynchronous ( ) const

Returns True if async I/O is globally enabled.

Returns True is this is a new MS from the last subchunk.

Returns True if this VI is writable (always False for ROVI and True for VI; see VisibilityIterator class).

void casa::vi::VisibilityIterator2::jonesC ( Vector< SquareMatrix< Complex, 2 > > &  cjones) const [protected]

reference to actual ms in interator

Returns the zero-based index of the current MS in the collection of MSs used to create the VI.

Return number of Ant.

Return True if arrayID has changed since last iteration.

Return True if SpectralWindow has changed since last iteration.

Return the number of rows in the current iteration.

Return the numbers of rows in the current chunk.

Return number of rows in all selected ms's.

Return number of spws, polids, ddids.

virtual void casa::vi::VisibilityIterator2::observationId ( Vector< Int > &  obsids) const [protected, virtual]

Return the OBSERVATION_IDs.

END Experimental Section.

///////////////////////////////////////////////////////////////

///////////////////////////////////////////////////////////////

  Iteration movement methods

  The typical use case for VisibilityIteration looks like

  for (vi.originChunks(); vi.moreChunks(); nextChunk()){
      for (vi.origin (); vi.more(); vi++){
      }
  }

  The outer loop is the "chunk" loop and the inner loop is the "subchunk"
  loop.  A chunk contains all the rows having identical values for the
  sort columns values except time; time can have an optional interval
  value specified either in the constructor or via the setInterval
  method.  If an interval is specified the set of rows will all have
  timestamps that are within that interval of the first row in the
  chunk; if no interval is specified then the chunk will contain only
  rows having the identical timestamp.  If multiple MSs are specified
  in the constructor then changing from one MS to the next will occur
  on a chunk boundary (i.e., a chunk will never contain data from more
  than one MS).

  A subchunk typically contains all the rows in the chunk having identical
  timestamps.  The only exception is when the user calls setRowBlocking(N)
  with a positive value.  In this case, the subchunk *may* contain up to
  N rows; however, this is only a suggestion to the VI.  If there are
  less than N rows remaining in the chunk then fewer than N rows will be
  contained in the chunk.  The number of rows in a subchunk will also be
  less than N if a larger set of rows would create an inconsistently
  shaped visibility cube; this could happen if the number of channels
  changes from one timestamp to another or the framed frequency
  selection selects a different number of channels from one timestamp to
  the next.

  origin () - positions VI to the start of the current chunk
  operator++ - advance VI to next subchunk if it exists
  more - returns True if the VI is pointing to a valid subchunk

  originChunks - Move to the first chunk of data.
  operator++ - advance VI to the next chunk if it exists
  moreChunks - returns True if the VI is pointing to a valid chunk.
void casa::vi::VisibilityIterator2::originChunks ( Bool  forceRewind) [protected]

advance the iteration

const Vector<Float>& casa::vi::VisibilityIterator2::parang ( Double  time) const [protected]

Per antenna:

const Float& casa::vi::VisibilityIterator2::parang0 ( Double  time) const [protected]

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::vi::VisibilityIterator2::parang0Calculate ( Double  time,
MSDerivedValues msd,
const MEpoch epoch0 
) [static, protected]
static Vector<Float> casa::vi::VisibilityIterator2::parangCalculate ( Double  time,
MSDerivedValues msd,
int  nAntennas,
const MEpoch  mEpoch0 
) [static, protected]
virtual const MDirection& casa::vi::VisibilityIterator2::phaseCenter ( ) const [protected, virtual]

Return the current phase center as an MDirection.

virtual Int casa::vi::VisibilityIterator2::polarizationId ( ) const [protected, virtual]

Return current Polarization Id.

virtual Int casa::vi::VisibilityIterator2::polFrame ( ) const [protected, virtual]

Return frame for polarization (returns PolFrame enum)

virtual void casa::vi::VisibilityIterator2::processorId ( Vector< Int > &  procids) const [protected, virtual]

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 void casa::vi::VisibilityIterator2::scan ( Vector< Int > &  scans) const [protected, virtual]

Return scan number.

the data returned is simply the channels that currently map to the selected frequencies for the specified frame of reference* void casa::vi::VisibilityIterator2::setFrequencySelection ( const FrequencySelection )
virtual void casa::vi::VisibilityIterator2::sigma ( Vector< Float > &  sig) const [protected, virtual]

Return sigma.

virtual void casa::vi::VisibilityIterator2::sigmaMat ( Matrix< Float > &  sigmat) const [protected, virtual]

Return sigma matrix (pol-dep)

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.

virtual Int casa::vi::VisibilityIterator2::spectralWindow ( ) const [protected, virtual]

Return current SpectralWindow.

virtual void casa::vi::VisibilityIterator2::spectralWindows ( Vector< Int > &  spws) const [protected, virtual]
virtual void casa::vi::VisibilityIterator2::stateId ( Vector< Int > &  stateids) const [protected, virtual]

Return the STATE_IDs.

Iterator operation methods These methods alter the way that the VI operates After applying any of casa::vi::VisibilityIterator2::these ( except slurp which should be called after  originChunks)
otherwise an exception will be casa::vi::VisibilityIterator2::thrown ( changing these values in the middle of a sweep can lead to unexpected  behavior) [final]
virtual void casa::vi::VisibilityIterator2::time ( Vector< Double > &  t) const [protected, virtual]

Return MJD midpoint of interval.

virtual void casa::vi::VisibilityIterator2::timeCentroid ( Vector< Double > &  t) const [protected, virtual]

Return MJD centroid of interval.

virtual void casa::vi::VisibilityIterator2::timeInterval ( Vector< Double > &  ti) const [protected, virtual]

Return nominal time interval.

Assign a VisImagingWeight object to this iterator.

This object is used to generate imaging weights.

virtual void casa::vi::VisibilityIterator2::uvw ( Matrix< Double > &  uvw) const [protected, virtual]

Return u,v and w (in meters)

virtual void casa::vi::VisibilityIterator2::visibilityCorrected ( Cube< Complex > &  vis) const [protected, virtual]

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

virtual void casa::vi::VisibilityIterator2::visibilityModel ( Cube< Complex > &  vis) const [protected, virtual]
virtual void casa::vi::VisibilityIterator2::visibilityObserved ( Cube< Complex > &  vis) const [protected, virtual]
virtual IPosition casa::vi::VisibilityIterator2::visibilityShape ( ) const [protected, virtual]

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.

virtual void visibilityCorrected (Matrix<CStokesVector> & vis) const; virtual void visibilityModel (Matrix<CStokesVector> & vis) const; virtual void visibilityObserved (Matrix<CStokesVector> & vis) const;

Return the shape of the visibility Cube

virtual void casa::vi::VisibilityIterator2::weight ( Vector< Float > &  wt) const [protected, virtual]

Return weight.

virtual void casa::vi::VisibilityIterator2::weightMat ( Matrix< Float > &  wtmat) const [protected, virtual]

Returns the nPol_p x curNumRow_p weight matrix.

virtual void casa::vi::VisibilityIterator2::weightSpectrum ( Cube< Float > &  wtsp) const [protected, virtual]

Return weightspectrum (a weight for each channel)

Requests that the modified VisBuffer2 be written back to the visibility at the same spot that it came from.

The dirtyComponents feature of VisBuffer is used to mark which portions of the VisBuffer actually need to be written back out.

Write/modify the flags in the data.

This will flag all channels in the original data that contributed to the output channel in the case of channel averaging. All polarizations have the same flag value.

virtual void casa::vi::VisibilityIterator2::writeFlag ( const Cube< Bool > &  flag) [virtual]

Write/modify the flags in the data.

This writes the flags as found in the MS, Cube(npol,nchan,nrow), where nrow is the number of rows in the current iteration (given by nRow()).

virtual void casa::vi::VisibilityIterator2::writeFlagRow ( const Vector< Bool > &  rowflags) [virtual]

Write/modify the flag row column; dimension Vector(nrow)

void casa::vi::VisibilityIterator2::writeModel ( const RecordInterface rec,
Bool  iscomponentlist = True,
Bool  incremental = False 
)

Write/modify the ncorr x nrow SigmaMat.

void writeSigmaMat(const Matrix<Float>& sigmat);

This puts a model into the descriptor of the current ms in the iterator Set iscomponentlist to True if the record represent a componentlist if False then it is a FTMachine Record that holds the model image note the spw and fields selected are going to be associated with this model incremetal =True implies add the model to previous any existant model in the ms for the spw and fields false means any existant model will be replaces.

Write/modify the Sigma.

void casa::vi::VisibilityIterator2::writeVisCorrected ( const Cube< Complex > &  vis)

Write/modify the visibilities.

This is possibly only for a 'reference' MS which has a new DATA column. The first axis of the matrix should equal the selected number of channels in the original MS. If the MS does not contain all polarizations, only the parallel hand polarizations are used.

void writeVisCorrected (const Matrix<CStokesVector>& vis); void writeVisModel (const Matrix<CStokesVector>& vis); void writeVisObserved (const Matrix<CStokesVector>& vis);

Write/modify the visibilities This writes the data as found in the MS, Cube(npol,nchan,nrow).

void casa::vi::VisibilityIterator2::writeVisModel ( const Cube< Complex > &  vis)
void casa::vi::VisibilityIterator2::writeVisObserved ( const Cube< Complex > &  vis)

Write/modify the weights.

virtual void casa::vi::VisibilityIterator2::writeWeightSpectrum ( const Cube< Float > &  wtsp) [virtual]

Write/modify the weightMat.

virtual void writeWeightMat(const Matrix<Float>& wtmat);

Write/modify the weightSpectrum


Friends And Related Function Documentation

friend class asyncio::VLAT [friend]

Definition at line 374 of file VisibilityIterator2.h.

friend class AveragingTvi2Factory [friend]

functions VLAT should not access private parts, especially variables

Definition at line 378 of file VisibilityIterator2.h.

friend class VisBuffer2Adapter [friend]

Definition at line 371 of file VisibilityIterator2.h.

friend class VisBufferImpl2 [friend]

Definition at line 372 of file VisibilityIterator2.h.

friend class VisBufferState [friend]

Definition at line 373 of file VisibilityIterator2.h.

friend class VisibilityIteratorImpl2 [friend]

These classes are members of the VI/VB framework and need extra access to the non-public methods of this class.

Any additions of classes not in this framework is strongly discouraged.

Friends of the class should limit themselves to accessing the protected area of this class so that items in the private area can remeain de facto private.

Definition at line 370 of file VisibilityIterator2.h.


Member Data Documentation

Definition at line 1067 of file VisibilityIterator2.h.


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