|
| 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 MSColumns & | msColumns () const |
| Return reference to the current MSColumns. 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 |
|
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.
To Do
-
multiple observatories in a single MS are not handled correctly (need to sort on observation id and check observatory name to set position frame)
Definition at line 163 of file MSIter.h.