|
| 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...
|
|
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...
|
|
void | origin () |
| Reset iterator to start of data. More...
|
|
Bool | more () const |
| Return False if there is no more data. More...
|
|
MSIter & | operator++ (int) |
| Advance iterator through data. More...
|
|
MSIter & | operator++ () |
|
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...
|
|
const String & | fieldName () const |
| Return the current Field Name. More...
|
|
const String & | sourceName () const |
| Return the current Source Name. 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...
|
|
const MDirection & | phaseCenter () const |
| Return the current phase center as MDirection. 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...
|
|
An iterator class for MeasurementSets.
Intended use:
Public interface
Prerequisite
Etymology
MSIter stands for the MeasurementSet Iterator class.
Synopsis
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.
Example
MeasurementSet
ms(
"3C273XC1.ms");
Block<int> sort(2);
for (msIter.origin(); msIter.more(); msIter++) {
cout << msIter.fieldId() << endl;
cout << msIter.fieldName() << endl;
cout << msIter.dataDescriptionId() << endl;
cout << msIter.frequency0() << endl;
cout << msIter.table().nrow() << endl;
process(msIter.table());
}
Example
MeasurementSet
ms(
"3C273XC1.ms");
Block<int> sort(3);
for (msIter.origin(); msIter.more(); msIter++) {
cout << msIter.fieldId() << endl;
cout << msIter.fieldName() << endl;
cout << msIter.dataDescriptionId() << endl;
cout << msIter.frequency0() << endl;
cout << msIter.table().nrow() << endl;
process(msIter.table());
}
Motivation
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.
Definition at line 162 of file MSIter.h.
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.