Loading...
Searching...
No Matches
MSIter.h
Go to the documentation of this file.
//# MSIter.h: Step through the MeasurementEquation by table
//# Copyright (C) 1996,1999,2000,2001,2002
//# Associated Universities, Inc. Washington DC, USA.
//#
//# This library is free software; you can redistribute it and/or modify it
//# under the terms of the GNU Library General Public License as published by
//# the Free Software Foundation; either version 2 of the License, or (at your
//# option) any later version.
//#
//# This library is distributed in the hope that it will be useful, but WITHOUT
//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
//# License for more details.
//#
//# You should have received a copy of the GNU Library General Public License
//# along with this library; if not, write to the Free Software Foundation,
//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
//#
//# Correspondence concerning AIPS++ should be addressed as follows:
//# Internet email: casa-feedback@nrao.edu.
//# Postal address: AIPS++ Project Office
//# National Radio Astronomy Observatory
//# 520 Edgemont Road
//# Charlottesville, VA 22903-2475 USA
#ifndef MS_MSITER_H
#define MS_MSITER_H
#include <casacore/casa/aips.h>
#include <casacore/casa/Arrays/Matrix.h>
#include <casacore/casa/Arrays/Cube.h>
#include <casacore/ms/MeasurementSets/MeasurementSet.h>
#include <casacore/measures/Measures/MFrequency.h>
#include <casacore/measures/Measures/MDirection.h>
#include <casacore/measures/Measures/MPosition.h>
#include <casacore/tables/Tables/ScalarColumn.h>
#include <casacore/casa/Utilities/Compare.h>
#include <casacore/casa/BasicSL/String.h>
#include <casacore/scimath/Mathematics/SquareMatrix.h>
#include <casacore/scimath/Mathematics/RigidVector.h>
namespace casacore { //# NAMESPACE CASACORE - BEGIN
//# forward decl
class MSColumns;
class TableIterator;
// <summary>
// Small helper class to specify an 'interval' comparison
// </summary>
// <synopsis>
// Small helper class to specify an 'interval' comparison for table iteration
// by time interval.
// </synopsis>
class MSInterval : public BaseCompare
{
public:
explicit MSInterval(Double interval) : interval_p(interval), offset_p(0) {}
virtual ~MSInterval() {}
virtual int comp(const void * obj1, const void * obj2) const;
Double getOffset() const {return offset_p;}
virtual void setOffset(Double offset) {offset_p=offset;}
Double getInterval() const {return interval_p;}
void setInterval(Double interval) {interval_p=interval;}
private:
Double interval_p;
mutable Double offset_p;
};
// <summary>
// An iterator class for MeasurementSets
// </summary>
// <use visibility=export>
// <prerequisite>
// <li> <linkto class="MeasurementSet:description">MeasurementSet</linkto>
// </prerequisite>
//
// <etymology>
// MSIter stands for the MeasurementSet Iterator class.
// </etymology>
//
// <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.
// </synopsis>
//
// <example>
// <srcblock>
// // The following code iterates by by ARRAY_ID, FIELD_ID, DATA_DESC_ID and
// // TIME (all implicitly added columns) and then by baseline (antenna pair),
// // in 3000s intervals.
// MeasurementSet ms("3C273XC1.ms");
// Block<int> sort(2);
// sort[0] = MS::ANTENNA1;
// sort[1] = MS::ANTENNA2;
// Double timeInterval = 3000;
// MSIter msIter(ms,sort,timeInteval);
// for (msIter.origin(); msIter.more(); msIter++) {
// // print out some of the iteration state
// cout << msIter.fieldId() << endl;
// cout << msIter.fieldName() << endl;
// cout << msIter.dataDescriptionId() << endl;
// cout << msIter.frequency0() << endl;
// cout << msIter.table().nrow() << endl;
// process(msIter.table()); // process the data in the current iteration
// }
// // Output shows only 1 row at a time because the table is sorted on TIME
// // first and ANTENNA1, ANTENNA2 next and each baseline occurs only once per
// // TIME stamp. The interval has no effect in this case.
// </srcblock>
// </example>
// <example>
// <srcblock>
// // The following code iterates by baseline (antenna pair), TIME, and,
// // implicitly, by ARRAY_ID, FIELD_ID and DATA_DESC_ID in 3000s
// // intervals.
// MeasurementSet ms("3C273XC1.ms");
// Block<int> sort(3);
// sort[0] = MS::ANTENNA1;
// sort[1] = MS::ANTENNA2;
// sort[2] = MS::TIME;
// Double timeInterval = 3000;
// MSIter msIter(ms,sort,timeInteval);
// for (msIter.origin(); msIter.more(); msIter++) {
// // print out some of the iteration state
// cout << msIter.fieldId() << endl;
// cout << msIter.fieldName() << endl;
// cout << msIter.dataDescriptionId() << endl;
// cout << msIter.frequency0() << endl;
// cout << msIter.table().nrow() << endl;
// process(msIter.table()); // process the data in the current iteration
// // Now the output shows 7 rows at a time, all with identical ANTENNA1
// // and ANTENNA2 values and TIME values within a 3000s interval.
// }
// </srcblock>
// </example>
//
// <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.
// </motivation>
//
// <todo>
// <li> multiple observatories in a single MS are not handled correctly (need to
// sort on observation id and check observatory name to set position frame)
// </todo>
class MSIter
{
public:
enum PolFrame {
// Circular polarization
Circular=0,
// Linear polarization
Linear=1
};
// Default constructor - useful only to assign another iterator later.
// Use of other member functions on this object is likely to dump core.
MSIter();
// 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.
MSIter(const MeasurementSet& ms, const Block<Int>& sortColumns,
Double timeInterval=0, Bool addDefaultSortColumns=True,
Bool storeSorted=True);
// Same as above with multiple MSs as input.
MSIter(const Block<MeasurementSet>& mss, const Block<Int>& sortColumns,
Double timeInterval=0, Bool addDefaultSortColumns=True,
Bool storeSorted=True);
// This constructor is similar to the previous ones but the comparison
// functions used to group the iterations are given explicitly, making
// the constructor more generic. Also, the column is specified as a string,
// to support sorting by columns not part of the standard MS definition.
// Note that with this constructor TIME is not treated in any special way and
// there are no default sorting columns, i.e., the sorting needs have to be
// set explicitly.
// The last element in vector sortColumns will be the column that will change
// faster in the iteration loop, whereas the first element will be the slower.
// For instance, if sortColumns[0].first = "DATA_DESC_ID" nad
// sortColumns[1].first = "ANTENNA1" then the first iterations will go through
// all possible values of ANTENNA1 for the first DDId, then it will start
// the iterations for the second DDId and so on.
MSIter(const MeasurementSet& ms,
const std::vector<std::pair<String, std::shared_ptr<BaseCompare>>>& sortColumns);
// Same as above with multiple MSs as input.
MSIter(const Block<MeasurementSet>& mss,
const std::vector<std::pair<String, std::shared_ptr<BaseCompare>>>& sortColumns);
// Copy construct. This calls the assigment operator.
MSIter(const MSIter & other);
MSIter *clone() const;
// Destructor
virtual ~MSIter();
// Assigment. This will reset the iterator to the origin.
MSIter & operator=(const MSIter &other);
//# Members
// Set or reset the time interval to use for iteration.
// You should call origin() to reset the iteration after
// calling this.
void setInterval(Double timeInterval);
// Reset iterator to start of data
virtual void origin();
// Return False if there is no more data
virtual Bool more() const;
// Advance iterator through data
virtual MSIter & operator++(int);
virtual MSIter & operator++();
// Report Name of slowest column that changes at end of current iteration
const String& keyChange() const;
// Return the current Table iteration
Table table() const;
// Return reference to the current MS
const MS& ms() const;
// Return reference to the current MSColumns
const MSColumns& msColumns() const;
// Return the current MS Id (according to the order in which
// they appeared in the constructor)
size_t msId() const;
// Return true if msId has changed since last iteration
Bool newMS() const;
// Return the current ArrayIds for all rows in this iteration
const ScalarColumn<Int>& colArrayIds() const;
// Return the current FieldIds for all rows in this iteration
const ScalarColumn<Int>& colFieldIds() const;
// Return the current DataDescriptionIds for all rows in this iteration
const ScalarColumn<Int>& colDataDescriptionIds() const;
// Return the ArrayId of the first element in this iteration
Int arrayId() const;
// Return True if ArrayId has changed since last iteration
// Note that if MS_ARRAY is not part of the sorting columns this
// will always be true.
Bool newArray() const;
// Return the FieldId of the first element in this iteration
Int fieldId() const;
// Return True if FieldId/Source has changed since last iteration
// Note that if MS_FIELD_ID is not part of the sorting columns this
// will always be true.
Bool newField() const;
// Return SpectralWindow of the first element in this iteration
Int spectralWindowId() const;
// Return True if SpectralWindow has changed since last iteration
// Note that if MS_DATA_DESC_ID is not part of the sorting columns this
// will always be true.
Bool newSpectralWindow() const;
// Return DataDescriptionId of the first element in this iteration
Int dataDescriptionId() const;
// Return True if DataDescriptionId has changed since last iteration
// Note that if MS_DATA_DESC_ID is not part of the sorting columns this
// will always be true.
Bool newDataDescriptionId() const;
// Return PolarizationId of the first element in this iteration
Int polarizationId() const;
// Return True if polarization has changed since last iteration
// Note that if MS_DATA_DESC_ID is not part of the sorting columns this
// will always be true.
Bool newPolarizationId() const;
// Return frame for polarization of the first element in this iteration
// @returns PolFrame enum
Int polFrame() const;
// Return the frequencies corresponding to the DATA matrix.
const Vector<Double>& frequency() const;
// Return frequency of first channel of the first element in iteration
// 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.
const MFrequency& frequency0() const;
// Return the rest frequency of the specified line as a Measure
const MFrequency& restFrequency(Int line=0) const;
// Return the telescope position (if a known telescope) or the
// position of the first antenna (if unknown)
const MPosition& telescopePosition() 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
const Vector<SquareMatrix<Complex,2> >& CJones() const;
// Return the feed configuration/leakage matrix for all feeds and antennae
// First axis is antennaId, 2nd axis is feedId. Result of CJones() is
// a reference to the first column of the matrix returned by this method
const Matrix<SquareMatrix<Complex,2> >& CJonesAll() const;
// 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
const Matrix<Double>& receptorAngle() const;
// 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
const Cube<Double>& receptorAngles() const;
// Return a string mount identifier for each antenna
const Vector<String>& antennaMounts() 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). The cube axes are receptor, antenna, feed.
const Cube<RigidVector<Double, 2> >& getBeamOffsets() const;
// True if all elements of the cube returned by getBeamOffsets are zero
Bool allBeamOffsetsZero() const;
// Get the spw, start and nchan for all the ms's is this msiter that
// match the frequecy "freqstart-freqStep" and "freqEnd+freqStep" range
void getSpwInFreqRange(Block<Vector<Int> >& spw,
Block<Vector<Int> >& start,
Block<Vector<Int> >& nchan,
Double freqStart, Double freqEnd,
Double freqStep);
//Get the number of actual ms's associated wth this iterator
size_t numMS() const;
//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
const MS& ms(const size_t n) 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
const MDirection& phaseCenter() 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
const MDirection phaseCenter(const Int fldID, const Double timeStamp) const ;
//return FIELD table associated current fieldname and sourcename respectively
const String& fieldName() const;
const String& sourceName() const;
protected:
// handle the construction details
void construct(const Block<Int>& sortColumns, Bool addDefaultSortColumns);
// handle the construction details using explicit comparison functions
void construct(const std::vector<std::pair<String, std::shared_ptr<BaseCompare>>>& sortColumns);
// advance the iteration
void advance();
// set the iteration state
virtual void setState();
void setMSInfo();
void setArrayInfo();
void setFeedInfo() const;
// Store the current DD, SPW, Pol ID.
// It can be called in logically const objects although it modifies
// caching (mutable) variables for performance reasons.
void cacheCurrentDDInfo() const;
// Store extra info related to the DD.
// It can be called in logically const objects although it modifies
// caching (mutable) variables for performance reasons.
void cacheExtraDDInfo() const;
void setFieldInfo() const;
// Determine if the numbers in r1 are a sorted subset of those in r2
Bool isSubSet(const Vector<rownr_t>& r1, const Vector<rownr_t>& r2);
MSIter* This;
Block<MeasurementSet> bms_p;
PtrBlock<TableIterator* > tabIter_p;
Block<Bool> tabIterAtStart_p;
// This booleans determine if given columns are part of the sorting
Bool timeInSort_p, arrayInSort_p, ddInSort_p, fieldInSort_p;
size_t nMS_p, curMS_p;
ssize_t lastMS_p;
std::shared_ptr<MSColumns> msc_p;
Table curTable_p;
Int curArrayIdFirst_p, lastArrayId_p, curSourceIdFirst_p;
mutable String curFieldNameFirst_p;
String curSourceNameFirst_p;
mutable Int curFieldIdFirst_p;
Int lastFieldId_p;
// These variables point to the current (as in this iteration)
// DD, SPW and polarization IDs. They are mutable since they are
// evaluated in a lazy way, i.e., only when needed. If the DDId is
// part of the sorting columns then it is always computed when calling
// next(), otherwise it is only computed when some accesor of
// metadata that depends on them is called by the application.
mutable Int curDataDescIdFirst_p, curSpectralWindowIdFirst_p,
curPolarizationIdFirst_p;
// These variables point to the IDs of the previous iteration.
Int lastDataDescId_p, lastSpectralWindowId_p, lastPolarizationId_p;
Bool more_p, newMS_p, newArrayId_p, newFieldId_p, newSpectralWindowId_p,
newPolarizationId_p, newDataDescId_p;
mutable bool spwDepFeed_p, checkFeed_p;
// Variable to know whether the feed info is already computed
mutable bool feedInfoCached_p;
// Globally control disk storage of SORTED_TABLE
Bool storeSorted_p;
// time selection
Double interval_p;
// This column is mutable since it is only attached when it is
// neccesary to read the DD Ids. That might happen when calling
// a const accesor like dataDescriptionId().
mutable ScalarColumn<Int> colDataDesc_p, colField_p;
ScalarColumn<Int> colArray_p;
mutable MDirection phaseCenter_p;
mutable Double prevFirstTimeStamp_p;
//cache for access functions
mutable Matrix<Double> receptorAnglesFeed0_p; // former receptorAngle_p,
// temporary retained for compatibility
// contain actually a reference to the
// first plane of receptorAngles_p
mutable Cube<Double> receptorAngles_p;
mutable Vector<SquareMatrix<Complex,2> > CJonesFeed0_p; // a temporary reference
// similar to receptorAngle_p
mutable Matrix<SquareMatrix<Complex,2> > CJones_p;
Vector<String> antennaMounts_p; // a string mount identifier for each
// antenna (e.g. EQUATORIAL, ALT-AZ,...)
mutable Cube<RigidVector<Double, 2> > beamOffsets_p;// angular offsets (two values for
// each element of the cube in radians)
// in the antenna coordinate system.
// Cube axes are: receptor, antenna, feed.
mutable Bool allBeamOffsetsZero_p; // True if all elements of beamOffsets_p
// are zero (to speed things up in a
// single beam case)
mutable PolFrame polFrame_p; // polarization Frame. It is lazily cached,
// hence mutable. See cacheExtraDDInfo()
mutable Bool freqCacheOK_p; // signal that the frequency cache is fine
mutable Vector<Double> frequency_p;
MFrequency frequency0_p;
MFrequency restFrequency_p;
MPosition telescopePosition_p;
std::shared_ptr<MSInterval> timeComp_p; // Points to the time comparator.
// 0 if not using a time interval.
};
inline Bool MSIter::more() const { return more_p;}
inline Table MSIter::table() const {return curTable_p;}
inline const MS& MSIter::ms() const {return bms_p[curMS_p];}
inline const MSColumns& MSIter::msColumns() const { return *msc_p;}
inline Bool MSIter::newMS() const { return newMS_p;}
inline Bool MSIter::newArray() const {return newArrayId_p;}
inline Bool MSIter::newField() const { return newFieldId_p;}
inline Bool MSIter::newSpectralWindow() const
{ return newSpectralWindowId_p;}
inline size_t MSIter::msId() const { return curMS_p;}
inline size_t MSIter::numMS() const { return nMS_p;}
inline const ScalarColumn<Int>& MSIter::colArrayIds() const
{ return colArray_p;}
inline const ScalarColumn<Int>& MSIter::colFieldIds() const
{ return colField_p;}
inline const ScalarColumn<Int>& MSIter::colDataDescriptionIds() const
{if(curDataDescIdFirst_p==-1) {cacheCurrentDDInfo(); cacheExtraDDInfo();}
return colDataDesc_p;}
inline Int MSIter::arrayId() const {return curArrayIdFirst_p;}
inline Int MSIter::fieldId() const {if(curFieldIdFirst_p==-1) setFieldInfo(); return curFieldIdFirst_p;}
inline Int MSIter::spectralWindowId() const
{if(curSpectralWindowIdFirst_p==-1) {cacheCurrentDDInfo(); cacheExtraDDInfo();}
return curSpectralWindowIdFirst_p;}
inline Int MSIter::polarizationId() const
{if(curPolarizationIdFirst_p==-1) {cacheCurrentDDInfo(); cacheExtraDDInfo();}
return curPolarizationIdFirst_p;}
inline Int MSIter::dataDescriptionId() const
{if(curDataDescIdFirst_p==-1) {cacheCurrentDDInfo(); cacheExtraDDInfo();}
return curDataDescIdFirst_p;}
inline Bool MSIter::newPolarizationId() const { return newPolarizationId_p;}
inline Bool MSIter::newDataDescriptionId() const { return newDataDescId_p;}
inline Int MSIter::polFrame() const
{if(curPolarizationIdFirst_p==-1) {cacheCurrentDDInfo(); cacheExtraDDInfo();}
return polFrame_p;}
inline const MPosition& MSIter::telescopePosition() const
{ return telescopePosition_p;}
inline const Vector<SquareMatrix<Complex,2> >& MSIter::CJones() const
{if(!feedInfoCached_p) setFeedInfo(); return CJonesFeed0_p;}
inline const Matrix<SquareMatrix<Complex,2> >& MSIter::CJonesAll() const
{if(!feedInfoCached_p) setFeedInfo(); return CJones_p;}
inline const Matrix<Double>& MSIter::receptorAngle() const
{if(!feedInfoCached_p) setFeedInfo(); return receptorAnglesFeed0_p;}
inline const Cube<Double>& MSIter::receptorAngles() const
{if(!feedInfoCached_p) setFeedInfo(); return receptorAngles_p;}
inline const Vector<String>& MSIter::antennaMounts() const
{return antennaMounts_p;}
inline const Cube<RigidVector<Double, 2> >& MSIter::getBeamOffsets() const
{if(!feedInfoCached_p) setFeedInfo(); return beamOffsets_p;}
inline Bool MSIter::allBeamOffsetsZero() const
{if(!feedInfoCached_p) setFeedInfo(); return allBeamOffsetsZero_p;}
} //# NAMESPACE CASACORE - END
#endif
casacore::BaseCompare
abstract base class for comparing two objects
Definition Compare.h:63
casacore::Block
simple 1-D array
Definition Block.h:198
casacore::Cube
Definition Cube.h:72
casacore::MDirection
Definition MDirection.h:171
casacore::MFrequency
Definition MFrequency.h:158
casacore::MPosition
Definition MPosition.h:76
casacore::MSColumns
Definition MSColumns.h:115
casacore::MSInterval::getInterval
Double getInterval() const
Definition MSIter.h:63
casacore::MSInterval::getOffset
Double getOffset() const
Definition MSIter.h:61
casacore::MSInterval::offset_p
Double offset_p
Definition MSIter.h:67
casacore::MSInterval::setInterval
void setInterval(Double interval)
Definition MSIter.h:64
casacore::MSInterval::comp
virtual int comp(const void *obj1, const void *obj2) const
Compare two objects, and return.
casacore::MSInterval::~MSInterval
virtual ~MSInterval()
Definition MSIter.h:59
casacore::MSInterval::setOffset
virtual void setOffset(Double offset)
Definition MSIter.h:62
casacore::MSInterval::interval_p
Double interval_p
Definition MSIter.h:66
casacore::MSInterval::MSInterval
MSInterval(Double interval)
Definition MSIter.h:58
casacore::MSIter::operator++
virtual MSIter & operator++(int)
Advance iterator through data.
casacore::MSIter::polarizationId
Int polarizationId() const
Return PolarizationId of the first element in this iteration.
Definition MSIter.h:530
casacore::MSIter::arrayInSort_p
Bool arrayInSort_p
Definition MSIter.h:434
casacore::MSIter::colDataDesc_p
ScalarColumn< Int > colDataDesc_p
This column is mutable since it is only attached when it is neccesary to read the DD Ids.
Definition MSIter.h:472
casacore::MSIter::construct
void construct(const std::vector< std::pair< String, std::shared_ptr< BaseCompare > > > &sortColumns)
handle the construction details using explicit comparison functions
casacore::MSIter::ms
const MS & ms() const
Return reference to the current MS.
Definition MSIter.h:509
casacore::MSIter::isSubSet
Bool isSubSet(const Vector< rownr_t > &r1, const Vector< rownr_t > &r2)
Determine if the numbers in r1 are a sorted subset of those in r2.
casacore::MSIter::newArray
Bool newArray() const
Return True if ArrayId has changed since last iteration Note that if MS_ARRAY is not part of the sort...
Definition MSIter.h:512
casacore::MSIter::newSpectralWindow
Bool newSpectralWindow() const
Return True if SpectralWindow has changed since last iteration Note that if MS_DATA_DESC_ID is not pa...
Definition MSIter.h:514
casacore::MSIter::~MSIter
virtual ~MSIter()
Destructor.
casacore::MSIter::fieldInSort_p
Bool fieldInSort_p
Definition MSIter.h:434
casacore::MSIter::This
MSIter * This
Definition MSIter.h:428
casacore::MSIter::newDataDescId_p
Bool newDataDescId_p
Definition MSIter.h:456
casacore::MSIter::msColumns
const MSColumns & msColumns() const
Return reference to the current MSColumns.
Definition MSIter.h:510
casacore::MSIter::curFieldIdFirst_p
Int curFieldIdFirst_p
Definition MSIter.h:443
casacore::MSIter::PolFrame
PolFrame
Definition MSIter.h:162
casacore::MSIter::Linear
@ Linear
Linear polarization.
Definition MSIter.h:166
casacore::MSIter::Circular
@ Circular
Circular polarization.
Definition MSIter.h:164
casacore::MSIter::curFieldNameFirst_p
String curFieldNameFirst_p
Definition MSIter.h:441
casacore::MSIter::newPolarizationId_p
Bool newPolarizationId_p
Definition MSIter.h:456
casacore::MSIter::cacheExtraDDInfo
void cacheExtraDDInfo() const
Store extra info related to the DD.
casacore::MSIter::colArray_p
ScalarColumn< Int > colArray_p
Definition MSIter.h:473
casacore::MSIter::antennaMounts
const Vector< String > & antennaMounts() const
Return a string mount identifier for each antenna.
Definition MSIter.h:551
casacore::MSIter::newSpectralWindowId_p
Bool newSpectralWindowId_p
Definition MSIter.h:455
casacore::MSIter::lastPolarizationId_p
Int lastPolarizationId_p
Definition MSIter.h:454
casacore::MSIter::newFieldId_p
Bool newFieldId_p
Definition MSIter.h:455
casacore::MSIter::receptorAngle
const Matrix< Double > & receptorAngle() const
Return the receptor angle for feed 0 on each antenna.
Definition MSIter.h:547
casacore::MSIter::getSpwInFreqRange
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-freqS...
casacore::MSIter::telescopePosition
const MPosition & telescopePosition() const
Return the telescope position (if a known telescope) or the position of the first antenna (if unknown...
Definition MSIter.h:541
casacore::MSIter::setMSInfo
void setMSInfo()
casacore::MSIter::phaseCenter
const MDirection & phaseCenter() const
Returns the phasecenter for the first time stamp of the iteration The time is important for field tab...
casacore::MSIter::arrayId
Int arrayId() const
Return the ArrayId of the first element in this iteration.
Definition MSIter.h:525
casacore::MSIter::receptorAnglesFeed0_p
Matrix< Double > receptorAnglesFeed0_p
cache for access functions
Definition MSIter.h:478
casacore::MSIter::CJonesFeed0_p
Vector< SquareMatrix< Complex, 2 > > CJonesFeed0_p
Definition MSIter.h:483
casacore::MSIter::frequency0
const MFrequency & frequency0() const
Return frequency of first channel of the first element in iteration with reference frame as a Measure...
casacore::MSIter::newMS
Bool newMS() const
Return true if msId has changed since last iteration.
Definition MSIter.h:511
casacore::MSIter::allBeamOffsetsZero_p
Bool allBeamOffsetsZero_p
each element of the cube in radians) in the antenna coordinate system.
Definition MSIter.h:492
casacore::MSIter::newArrayId_p
Bool newArrayId_p
Definition MSIter.h:455
casacore::MSIter::lastMS_p
ssize_t lastMS_p
Definition MSIter.h:437
casacore::MSIter::freqCacheOK_p
Bool freqCacheOK_p
hence mutable.
Definition MSIter.h:497
casacore::MSIter::nMS_p
size_t nMS_p
Definition MSIter.h:436
casacore::MSIter::curSourceIdFirst_p
Int curSourceIdFirst_p
Definition MSIter.h:440
casacore::MSIter::colField_p
ScalarColumn< Int > colField_p
Definition MSIter.h:472
casacore::MSIter::newPolarizationId
Bool newPolarizationId() const
Return True if polarization has changed since last iteration Note that if MS_DATA_DESC_ID is not part...
Definition MSIter.h:536
casacore::MSIter::MSIter
MSIter(const MeasurementSet &ms, const std::vector< std::pair< String, std::shared_ptr< BaseCompare > > > &sortColumns)
This constructor is similar to the previous ones but the comparison functions used to group the itera...
casacore::MSIter::more
virtual Bool more() const
Return False if there is no more data.
Definition MSIter.h:507
casacore::MSIter::origin
virtual void origin()
Reset iterator to start of data.
casacore::MSIter::feedInfoCached_p
bool feedInfoCached_p
Variable to know whether the feed info is already computed.
Definition MSIter.h:460
casacore::MSIter::timeComp_p
std::shared_ptr< MSInterval > timeComp_p
Definition MSIter.h:503
casacore::MSIter::table
Table table() const
Return the current Table iteration.
Definition MSIter.h:508
casacore::MSIter::restFrequency
const MFrequency & restFrequency(Int line=0) const
Return the rest frequency of the specified line as a Measure.
casacore::MSIter::keyChange
const String & keyChange() const
Report Name of slowest column that changes at end of current iteration.
casacore::MSIter::ddInSort_p
Bool ddInSort_p
Definition MSIter.h:434
casacore::MSIter::allBeamOffsetsZero
Bool allBeamOffsetsZero() const
True if all elements of the cube returned by getBeamOffsets are zero.
Definition MSIter.h:555
casacore::MSIter::lastSpectralWindowId_p
Int lastSpectralWindowId_p
Definition MSIter.h:454
casacore::MSIter::sourceName
const String & sourceName() const
casacore::MSIter::curTable_p
Table curTable_p
Definition MSIter.h:439
casacore::MSIter::checkFeed_p
bool checkFeed_p
Definition MSIter.h:457
casacore::MSIter::advance
void advance()
advance the iteration
casacore::MSIter::lastDataDescId_p
Int lastDataDescId_p
These variables point to the IDs of the previous iteration.
Definition MSIter.h:454
casacore::MSIter::setInterval
void setInterval(Double timeInterval)
Set or reset the time interval to use for iteration.
casacore::MSIter::spwDepFeed_p
bool spwDepFeed_p
Definition MSIter.h:457
casacore::MSIter::polFrame_p
PolFrame polFrame_p
are zero (to speed things up in a single beam case)
Definition MSIter.h:495
casacore::MSIter::MSIter
MSIter()
Default constructor - useful only to assign another iterator later.
casacore::MSIter::polFrame
Int polFrame() const
Return frame for polarization of the first element in this iteration.
Definition MSIter.h:538
casacore::MSIter::CJones
const Vector< SquareMatrix< Complex, 2 > > & CJones() const
Return the feed configuration/leakage matrix for feed 0 on each antenna TODO: CJonesAll can be used i...
Definition MSIter.h:543
casacore::MSIter::colDataDescriptionIds
const ScalarColumn< Int > & colDataDescriptionIds() const
Return the current DataDescriptionIds for all rows in this iteration.
Definition MSIter.h:522
casacore::MSIter::timeInSort_p
Bool timeInSort_p
This booleans determine if given columns are part of the sorting.
Definition MSIter.h:434
casacore::MSIter::storeSorted_p
Bool storeSorted_p
Globally control disk storage of SORTED_TABLE.
Definition MSIter.h:464
casacore::MSIter::telescopePosition_p
MPosition telescopePosition_p
Definition MSIter.h:501
casacore::MSIter::newDataDescriptionId
Bool newDataDescriptionId() const
Return True if DataDescriptionId has changed since last iteration Note that if MS_DATA_DESC_ID is not...
Definition MSIter.h:537
casacore::MSIter::MSIter
MSIter(const Block< MeasurementSet > &mss, const std::vector< std::pair< String, std::shared_ptr< BaseCompare > > > &sortColumns)
Same as above with multiple MSs as input.
casacore::MSIter::msId
size_t msId() const
Return the current MS Id (according to the order in which they appeared in the constructor).
Definition MSIter.h:516
casacore::MSIter::setArrayInfo
void setArrayInfo()
casacore::MSIter::getBeamOffsets
const Cube< RigidVector< Double, 2 > > & getBeamOffsets() const
Return a cube containing pairs of coordinate offset for each receptor of each feed (values are in rad...
Definition MSIter.h:553
casacore::MSIter::numMS
size_t numMS() const
Get the number of actual ms's associated wth this iterator.
Definition MSIter.h:517
casacore::MSIter::tabIterAtStart_p
Block< Bool > tabIterAtStart_p
Definition MSIter.h:431
casacore::MSIter::curArrayIdFirst_p
Int curArrayIdFirst_p
Definition MSIter.h:440
casacore::MSIter::spectralWindowId
Int spectralWindowId() const
Return SpectralWindow of the first element in this iteration.
Definition MSIter.h:527
casacore::MSIter::curDataDescIdFirst_p
Int curDataDescIdFirst_p
These variables point to the current (as in this iteration) DD, SPW and polarization IDs.
Definition MSIter.h:451
casacore::MSIter::newField
Bool newField() const
Return True if FieldId/Source has changed since last iteration Note that if MS_FIELD_ID is not part o...
Definition MSIter.h:513
casacore::MSIter::phaseCenter
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 ca...
casacore::MSIter::fieldName
const String & fieldName() const
return FIELD table associated current fieldname and sourcename respectively
casacore::MSIter::CJones_p
Matrix< SquareMatrix< Complex, 2 > > CJones_p
similar to receptorAngle_p
Definition MSIter.h:485
casacore::MSIter::msc_p
std::shared_ptr< MSColumns > msc_p
Definition MSIter.h:438
casacore::MSIter::lastArrayId_p
Int lastArrayId_p
Definition MSIter.h:440
casacore::MSIter::lastFieldId_p
Int lastFieldId_p
Definition MSIter.h:444
casacore::MSIter::frequency0_p
MFrequency frequency0_p
Definition MSIter.h:499
casacore::MSIter::ms
const MS & ms(const size_t n) const
Get a reference to the nth ms in the list of ms associated with this iterator.
casacore::MSIter::antennaMounts_p
Vector< String > antennaMounts_p
Definition MSIter.h:486
casacore::MSIter::CJonesAll
const Matrix< SquareMatrix< Complex, 2 > > & CJonesAll() const
Return the feed configuration/leakage matrix for all feeds and antennae First axis is antennaId,...
Definition MSIter.h:545
casacore::MSIter::operator++
virtual MSIter & operator++()
casacore::MSIter::fieldId
Int fieldId() const
Return the FieldId of the first element in this iteration.
Definition MSIter.h:526
casacore::MSIter::cacheCurrentDDInfo
void cacheCurrentDDInfo() const
Store the current DD, SPW, Pol ID.
casacore::MSIter::construct
void construct(const Block< Int > &sortColumns, Bool addDefaultSortColumns)
handle the construction details
casacore::MSIter::curSpectralWindowIdFirst_p
Int curSpectralWindowIdFirst_p
Definition MSIter.h:451
casacore::MSIter::clone
MSIter * clone() const
casacore::MSIter::beamOffsets_p
Cube< RigidVector< Double, 2 > > beamOffsets_p
antenna (e.g.
Definition MSIter.h:488
casacore::MSIter::setFeedInfo
void setFeedInfo() const
casacore::MSIter::restFrequency_p
MFrequency restFrequency_p
Definition MSIter.h:500
casacore::MSIter::setState
virtual void setState()
set the iteration state
casacore::MSIter::phaseCenter_p
MDirection phaseCenter_p
Definition MSIter.h:475
casacore::MSIter::receptorAngles_p
Cube< Double > receptorAngles_p
temporary retained for compatibility contain actually a reference to the first plane of receptorAngle...
Definition MSIter.h:482
casacore::MSIter::operator=
MSIter & operator=(const MSIter &other)
Assigment.
casacore::MSIter::tabIter_p
PtrBlock< TableIterator * > tabIter_p
Definition MSIter.h:430
casacore::MSIter::setFieldInfo
void setFieldInfo() const
casacore::MSIter::curPolarizationIdFirst_p
Int curPolarizationIdFirst_p
Definition MSIter.h:452
casacore::MSIter::MSIter
MSIter(const MSIter &other)
Copy construct.
casacore::MSIter::bms_p
Block< MeasurementSet > bms_p
Definition MSIter.h:429
casacore::MSIter::receptorAngles
const Cube< Double > & receptorAngles() const
Return the receptor angles for all feeds and antennae First axis is a receptor number,...
Definition MSIter.h:549
casacore::MSIter::newMS_p
Bool newMS_p
Definition MSIter.h:455
casacore::MSIter::more_p
Bool more_p
Definition MSIter.h:455
casacore::MSIter::prevFirstTimeStamp_p
Double prevFirstTimeStamp_p
Definition MSIter.h:476
casacore::MSIter::frequency_p
Vector< Double > frequency_p
Definition MSIter.h:498
casacore::MSIter::curSourceNameFirst_p
String curSourceNameFirst_p
Definition MSIter.h:442
casacore::MSIter::colFieldIds
const ScalarColumn< Int > & colFieldIds() const
Return the current FieldIds for all rows in this iteration.
Definition MSIter.h:520
casacore::MSIter::dataDescriptionId
Int dataDescriptionId() const
Return DataDescriptionId of the first element in this iteration.
Definition MSIter.h:533
casacore::MSIter::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
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 specifie...
casacore::MSIter::colArrayIds
const ScalarColumn< Int > & colArrayIds() const
Return the current ArrayIds for all rows in this iteration.
Definition MSIter.h:518
casacore::MSIter::curMS_p
size_t curMS_p
Definition MSIter.h:436
casacore::MSIter::frequency
const Vector< Double > & frequency() const
Return the frequencies corresponding to the DATA matrix.
casacore::MSIter::interval_p
Double interval_p
time selection
Definition MSIter.h:467
casacore::Matrix
Definition Matrix.h:87
casacore::MeasurementSet
Definition MeasurementSet.h:278
casacore::PtrBlock
A drop-in replacement for Block<T*>.
Definition Block.h:812
casacore::ScalarColumn
Definition ScalarColumn.h:83
casacore::String
String: the storage and methods of handling collections of characters.
Definition String.h:223
casacore::TableIterator
Definition TableIter.h:116
casacore::Table
Definition Table.h:157
casacore::Vector
Definition Vector.h:82
casacore
this file contains all the compiler specific defines
Definition mainpage.dox:28
casacore::offset
int offset(int, int) const
compute a linear offset from array indicies
casacore::MS
MeasurementSet MS
MeasurementSet is too cumbersome for a number of common uses, so we give a typedef here.
Definition MeasurementSet.h:149
casacore::Int
int Int
Definition aipstype.h:48
casacore::Bool
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40
casacore::True
const Bool True
Definition aipstype.h:41
casacore::Double
double Double
Definition aipstype.h:53