casa
5.7.0-16
|
An iterator class for MeasurementSets. More...
#include <MSIter.h>
Public Types | |
enum | PolFrame { Circular, Linear } |
Public Member Functions | |
MSIter () | |
Default constructor - useful only to assign another iterator later. More... | |
MSIter (const MeasurementSet &ms, const Block< Int > &sortColumns, Double timeInterval=0, Bool addDefaultSortColumns=True, Bool storeSorted=True) | |
Construct from MS and a Block of MS column enums specifying the iteration order, if none are specified, ARRAY_ID, FIELD_ID, DATA_DESC_ID, and TIME iteration is implicit (unless addDefaultSortColumns=False) These columns will be added first if they are not specified. More... | |
MSIter (const Block< MeasurementSet > &mss, const Block< Int > &sortColumns, Double timeInterval=0, Bool addDefaultSortColumns=True, Bool storeSorted=True) | |
Same as above with multiple MSs as input. More... | |
MSIter (const MSIter &other) | |
Copy construct. More... | |
MSIter * | clone () const |
virtual | ~MSIter () |
Destructor. More... | |
MSIter & | operator= (const MSIter &other) |
Assigment. More... | |
void | setInterval (Double timeInterval) |
Set or reset the time interval to use for iteration. More... | |
virtual void | origin () |
Reset iterator to start of data. More... | |
virtual Bool | more () const |
Return False if there is no more data. More... | |
virtual MSIter & | operator++ (int) |
Advance iterator through data. More... | |
virtual MSIter & | operator++ () |
const String & | keyChange () const |
Report Name of slowest column that changes at end of current iteration. More... | |
Table | table () const |
Return the current Table iteration. More... | |
const MS & | ms () const |
Return reference to the current MS. More... | |
const ROMSColumns & | msColumns () const |
Return reference to the current ROMSColumns. More... | |
Int | msId () const |
Return the current MS Id (according to the order in which they appeared in the constructor) More... | |
Bool | newMS () const |
Return true if msId has changed since last iteration. More... | |
Int | arrayId () const |
Return the current ArrayId. More... | |
Bool | newArray () const |
Return True if ArrayId has changed since last iteration. More... | |
Int | fieldId () const |
Return the current FieldId. More... | |
Bool | newField () const |
Return True if FieldId/Source has changed since last iteration. More... | |
Int | spectralWindowId () const |
Return current SpectralWindow. More... | |
Bool | newSpectralWindow () const |
Return True if SpectralWindow has changed since last iteration. More... | |
Int | dataDescriptionId () const |
Return current DataDescriptionId. More... | |
Bool | newDataDescriptionId () const |
Return True if DataDescriptionId has changed since last iteration. More... | |
Int | polarizationId () const |
Return current PolarizationId. More... | |
Bool | newPolarizationId () const |
Return True if polarization has changed since last iteration. More... | |
Int | polFrame () const |
Return frame for polarization (returns PolFrame enum) More... | |
const Vector< Double > & | frequency () const |
Return the frequencies corresponding to the DATA matrix. More... | |
const MFrequency & | frequency0 () const |
Return frequency of first channel with reference frame as a Measure. More... | |
const MFrequency & | restFrequency (Int line=0) const |
Return the rest frequency of the specified line as a Measure. More... | |
const MPosition & | telescopePosition () const |
Return the telescope position (if a known telescope) or the position of the first antenna (if unknown) More... | |
const Vector< SquareMatrix < Complex, 2 > > & | CJones () const |
Return the feed configuration/leakage matrix for feed 0 on each antenna TODO: CJonesAll can be used instead of this method in all instances. More... | |
const Matrix< SquareMatrix < Complex, 2 > > & | CJonesAll () const |
Return the feed configuration/leakage matrix for all feeds and antennae First axis is antennaId, 2nd axis is feedId. More... | |
const Matrix< Double > & | receptorAngle () const |
Return the receptor angle for feed 0 on each antenna. More... | |
const Cube< Double > & | receptorAngles () const |
Return the receptor angles for all feeds and antennae First axis is a receptor number, 2nd axis is antennaId, 3rd axis is feedId. More... | |
Int | startChan () const |
Return the channel number of the first channel in the DATA. More... | |
const Vector< String > & | antennaMounts () const |
Return a string mount identifier for each antenna. More... | |
const Cube< RigidVector < Double, 2 > > & | getBeamOffsets () const |
Return a cube containing pairs of coordinate offset for each receptor of each feed (values are in radians, coordinate system is fixed with antenna and is the same as used to define the BEAM_OFFSET parameter in the feed table). More... | |
Bool | allBeamOffsetsZero () const |
True if all elements of the cube returned by getBeamOffsets are zero. More... | |
void | getSpwInFreqRange (Block< Vector< Int > > &spw, Block< Vector< Int > > &start, Block< Vector< Int > > &nchan, Double freqStart, Double freqEnd, Double freqStep) |
Get the spw, start and nchan for all the ms's is this msiter that match the frequecy "freqstart-freqStep" and "freqEnd+freqStep" range. More... | |
Int | numMS () const |
Get the number of actual ms's associated wth this iterator. More... | |
const MS & | ms (const uInt n) const |
Get a reference to the nth ms in the list of ms associated with this iterator. More... | |
const MDirection & | phaseCenter () const |
Returns the phasecenter for the first time stamp of the iteration The time is important for field tables that have polynomial or ephemerides phasecenters, i.e time varying for a given field_id. More... | |
const MDirection | phaseCenter (const Int fldID, const Double timeStamp) const |
If the iterator is set so as one iteration has more that 1 value of time stamp or fieldid then the caller should use the phasecenter with field id and time explicitly. More... | |
const String & | fieldName () const |
return FIELD table associated current fieldname and sourcename respectively More... | |
const String & | sourceName () const |
Protected Member Functions | |
void | construct (const Block< Int > &sortColumns, Bool addDefaultSortColumns) |
handle the construction details More... | |
void | advance () |
advance the iteration More... | |
virtual void | setState () |
set the iteration state More... | |
void | setMSInfo () |
void | setArrayInfo () |
void | setFeedInfo () |
void | setDataDescInfo () |
void | setFieldInfo () |
Bool | isSubSet (const Vector< uInt > &r1, const Vector< uInt > &r2) |
Determine if the numbers in r1 are a sorted subset of those in r2. More... | |
An iterator class for MeasurementSets.
Public interface
MSIter stands for the MeasurementSet Iterator class.
An MSIter is a class to traverse a MeasurementSet in various orders. It automatically adds four predefined sort columns to your selection of sort columns (see constructor) so that it can keep track of changes in frequency or polarization setup, field position and sub-array. Note that this can cause iterations to occur in a different way from what you would expect, see examples below. MSIter implements iteration by time interval for the use of e.g., calibration tasks that want to calculate solutions over some interval of time. You can iterate over multiple MeasurementSets with this class.
This class was originally part of the VisibilityIterator class, but that class was getting too large and complicated. By splitting out the toplevel iteration into this class the code is much easier to understand. It is now also available through the ms tool.
casacore::MSIter::MSIter | ( | ) |
Default constructor - useful only to assign another iterator later.
Use of other member functions on this object is likely to dump core.
casacore::MSIter::MSIter | ( | const MeasurementSet & | ms, |
const Block< Int > & | sortColumns, | ||
Double | timeInterval = 0 , |
||
Bool | addDefaultSortColumns = True , |
||
Bool | storeSorted = True |
||
) |
Construct from MS and a Block of MS column enums specifying the iteration order, if none are specified, ARRAY_ID, FIELD_ID, DATA_DESC_ID, and TIME iteration is implicit (unless addDefaultSortColumns=False) These columns will be added first if they are not specified.
An optional timeInterval 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_DESCRIPTION_ID and FIELD_ID). See the examples above for the effect of different sort orders.
The storeSorted parameter determines how the resulting SORT_TABLE is managed. If storeSorted is true then the table will be stored on disk; this potentially allows its reuse in the future but has also been shown to be a problem when the MS is being read in parallel. If storeSorted is false then the SORTED_TABLE is constructed and used in memory which keeps concurrent readers from interfering with each other.
casacore::MSIter::MSIter | ( | const Block< MeasurementSet > & | mss, |
const Block< Int > & | sortColumns, | ||
Double | timeInterval = 0 , |
||
Bool | addDefaultSortColumns = True , |
||
Bool | storeSorted = True |
||
) |
Same as above with multiple MSs as input.
casacore::MSIter::MSIter | ( | const MSIter & | other | ) |
Copy construct.
This calls the assigment operator.
|
virtual |
Destructor.
|
protected |
advance the iteration
|
inline |
True if all elements of the cube returned by getBeamOffsets are zero.
Definition at line 541 of file MSIter.h.
Referenced by casa::VisibilityIteratorReadImpl::allBeamOffsetsZero().
Return a string mount identifier for each antenna.
Definition at line 536 of file MSIter.h.
Referenced by casa::VisibilityIteratorReadImpl::antennaMounts().
|
inline |
Return the current ArrayId.
Definition at line 517 of file MSIter.h.
Referenced by casa::VisibilityIteratorReadImpl::arrayId().
|
inline |
Return the feed configuration/leakage matrix for feed 0 on each antenna TODO: CJonesAll can be used instead of this method in all instances.
Definition at line 528 of file MSIter.h.
Referenced by casa::VisibilityIteratorReadImpl::CJones().
|
inline |
MSIter* casacore::MSIter::clone | ( | ) | const |
|
protected |
handle the construction details
|
inline |
Return current DataDescriptionId.
Definition at line 522 of file MSIter.h.
Referenced by casa::VisibilityIteratorReadImpl::dataDescriptionId().
|
inline |
Return the current FieldId.
Definition at line 518 of file MSIter.h.
Referenced by casa::VisibilityIteratorReadImpl::fieldId().
const String& casacore::MSIter::fieldName | ( | ) | const |
return FIELD table associated current fieldname and sourcename respectively
Referenced by casa::VisibilityIteratorReadImpl::fieldName().
Return the frequencies corresponding to the DATA matrix.
const MFrequency& casacore::MSIter::frequency0 | ( | ) | const |
Return frequency of first channel with reference frame as a Measure.
The reference frame Epoch is that of the first row, reset it as needed for each row. The reference frame Position is the average of the antenna positions.
|
inline |
Return a cube containing pairs of coordinate offset for each receptor of each feed (values are in radians, coordinate system is fixed with antenna and is the same as used to define the BEAM_OFFSET parameter in the feed table).
The cube axes are receptor, antenna, feed.
Definition at line 538 of file MSIter.h.
Referenced by casa::VisibilityIteratorReadImpl::getBeamOffsets().
void casacore::MSIter::getSpwInFreqRange | ( | Block< Vector< Int > > & | spw, |
Block< Vector< Int > > & | start, | ||
Block< Vector< Int > > & | nchan, | ||
Double | freqStart, | ||
Double | freqEnd, | ||
Double | freqStep | ||
) |
Get the spw, start and nchan for all the ms's is this msiter that match the frequecy "freqstart-freqStep" and "freqEnd+freqStep" range.
Determine if the numbers in r1 are a sorted subset of those in r2.
const String& casacore::MSIter::keyChange | ( | ) | const |
Report Name of slowest column that changes at end of current iteration.
|
inlinevirtual |
Return False if there is no more data.
Definition at line 506 of file MSIter.h.
Referenced by casa::VisibilityIteratorReadImpl::moreChunks(), and casa::ViReadImplAsync::newMS().
|
inline |
Return reference to the current MS.
Definition at line 508 of file MSIter.h.
Referenced by casa::VisibilityIteratorReadImpl::ms().
Get a reference to the nth ms in the list of ms associated with this iterator.
If larger than the list of ms's current ms is returned So better check wth numMS() before making the call
|
inline |
Return reference to the current ROMSColumns.
Definition at line 509 of file MSIter.h.
Referenced by casa::VisibilityIteratorReadImpl::msColumns().
|
inline |
Return the current MS Id (according to the order in which they appeared in the constructor)
Definition at line 515 of file MSIter.h.
Referenced by casa::VisibilityIteratorReadImpl::msId().
|
inline |
Return True if ArrayId has changed since last iteration.
Definition at line 511 of file MSIter.h.
Referenced by casa::VisibilityIteratorReadImpl::newArrayId().
|
inline |
|
inline |
Return True if FieldId/Source has changed since last iteration.
Definition at line 512 of file MSIter.h.
Referenced by casa::VisibilityIteratorReadImpl::newFieldId().
|
inline |
Return true if msId has changed since last iteration.
Definition at line 510 of file MSIter.h.
Referenced by casa::VisibilityIteratorReadImpl::newMS().
|
inline |
|
inline |
Return True if SpectralWindow has changed since last iteration.
Definition at line 513 of file MSIter.h.
Referenced by casa::VisibilityIteratorReadImpl::newSpectralWindow().
|
inline |
|
virtual |
Advance iterator through data.
|
virtual |
Assigment.
This will reset the iterator to the origin.
|
virtual |
Reset iterator to start of data.
Reimplemented in casa::vi::MSIter2.
const MDirection& casacore::MSIter::phaseCenter | ( | ) | const |
Returns the phasecenter for the first time stamp of the iteration The time is important for field tables that have polynomial or ephemerides phasecenters, i.e time varying for a given field_id.
If the iterator is set so as one iteration has more that 1 time stamp then this version is correct only for fixed phasecenters
Referenced by casa::VisibilityIteratorReadImpl::phaseCenter().
const MDirection casacore::MSIter::phaseCenter | ( | const Int | fldID, |
const Double | timeStamp | ||
) | const |
If the iterator is set so as one iteration has more that 1 value of time stamp or fieldid then the caller should use the phasecenter with field id and time explicitly.
|
inline |
Return current PolarizationId.
Definition at line 521 of file MSIter.h.
Referenced by casa::VisibilityIteratorReadImpl::polarizationId().
|
inline |
Return frame for polarization (returns PolFrame enum)
Definition at line 525 of file MSIter.h.
Referenced by casa::VisibilityIteratorReadImpl::polFrame().
Return the receptor angle for feed 0 on each antenna.
First axis is receptor number, 2nd axis is antennaId. TODO: receptorAngles() can be used instead of this method
Return the receptor angles for all feeds and antennae First axis is a receptor number, 2nd axis is antennaId, 3rd axis is feedId.
Result of receptorAngle() is just a reference to the first plane of the cube returned by this method
Definition at line 534 of file MSIter.h.
Referenced by casa::VisibilityIteratorReadImpl::receptorAngles().
const MFrequency& casacore::MSIter::restFrequency | ( | Int | line = 0 | ) | const |
Return the rest frequency of the specified line as a Measure.
|
protected |
|
protected |
|
protected |
|
protected |
void casacore::MSIter::setInterval | ( | Double | timeInterval | ) |
Set or reset the time interval to use for iteration.
You should call origin() to reset the iteration after calling this.
Referenced by casa::VisibilityIteratorReadImpl::setInterval().
|
protected |
|
protectedvirtual |
set the iteration state
Reimplemented in casa::vi::MSIter2.
const String& casacore::MSIter::sourceName | ( | ) | const |
Referenced by casa::VisibilityIteratorReadImpl::sourceName().
|
inline |
Return current SpectralWindow.
Definition at line 519 of file MSIter.h.
Referenced by casa::VisibilityIteratorReadImpl::channelGroupSize(), casa::VisibilityIteratorReadImpl::channelIndex(), and casa::VisibilityIteratorReadImpl::spectralWindow().
|
inline |
|
inline |
Return the current Table iteration.
Definition at line 507 of file MSIter.h.
Referenced by casa::VisibilityIteratorReadImpl::nRowChunk().
|
inline |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |