31 #include <casacore/casa/aips.h>
32 #include <casacore/casa/Arrays/Matrix.h>
33 #include <casacore/casa/Arrays/Cube.h>
34 #include <casacore/ms/MeasurementSets/MeasurementSet.h>
35 #include <casacore/measures/Measures/MFrequency.h>
36 #include <casacore/measures/Measures/MDirection.h>
37 #include <casacore/measures/Measures/MPosition.h>
38 #include <casacore/tables/Tables/ScalarColumn.h>
39 #include <casacore/casa/Utilities/Compare.h>
40 #include <casacore/casa/BasicSL/String.h>
41 #include <casacore/scimath/Mathematics/SquareMatrix.h>
42 #include <casacore/scimath/Mathematics/RigidVector.h>
62 virtual int comp(
const void * obj1,
const void * obj2)
const;
257 const MS&
ms()
const;
382 size_t numMS()
const;
387 const MS&
ms(
const size_t n)
const;
abstract base class for comparing two objects
Referenced counted pointer for constant data.
Double getInterval() const
void setInterval(Double interval)
virtual int comp(const void *obj1, const void *obj2) const
Compare two objects, and return.
virtual void setOffset(Double offset)
MSInterval(Double interval)
An iterator class for MeasurementSets.
Int polarizationId() const
Return PolarizationId of the first element in this iteration.
ScalarColumn< Int > colDataDesc_p
This column is mutable since it is only attached when it is neccesary to read the DD Ids.
const MS & ms() const
Return reference to the current MS.
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.
Bool newArray() const
Return True if ArrayId has changed since last iteration Note that if MS_ARRAY is not part of the sort...
Bool newSpectralWindow() const
Return True if SpectralWindow has changed since last iteration Note that if MS_DATA_DESC_ID is not pa...
virtual ~MSIter()
Destructor.
const MSColumns & msColumns() const
Return reference to the current MSColumns.
@ Linear
Linear polarization.
@ Circular
Circular polarization.
String curFieldNameFirst_p
void cacheExtraDDInfo() const
Store extra info related to the DD.
ScalarColumn< Int > colArray_p
const Vector< String > & antennaMounts() const
Return a string mount identifier for each antenna.
Bool newSpectralWindowId_p
CountedPtr< MSInterval > timeComp_p
const Matrix< Double > & receptorAngle() const
Return the receptor angle for feed 0 on each antenna.
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...
const MPosition & telescopePosition() const
Return the telescope position (if a known telescope) or the position of the first antenna (if unknown...
Int arrayId() const
Return the ArrayId of the first element in this iteration.
Matrix< Double > receptorAnglesFeed0_p
cache for access functions
Vector< SquareMatrix< Complex, 2 > > CJonesFeed0_p
Bool newMS() const
Return true if msId has changed since last iteration.
const String & keyChange() const
Report Name of slowest column that changes at end of current iteration.
Bool allBeamOffsetsZero_p
each element of the cube in radians) in the antenna coordinate system.
const Vector< Double > & frequency() const
Return the frequencies corresponding to the DATA matrix.
Bool freqCacheOK_p
hence mutable.
void construct(const std::vector< std::pair< String, CountedPtr< BaseCompare >>> &sortColumns)
handle the construction details using explicit comparison functions
ScalarColumn< Int > colField_p
Bool newPolarizationId() const
Return True if polarization has changed since last iteration Note that if MS_DATA_DESC_ID is not part...
virtual Bool more() const
Return False if there is no more data.
virtual void origin()
Reset iterator to start of data.
bool feedInfoCached_p
Variable to know whether the feed info is already computed.
const MFrequency & restFrequency(Int line=0) const
Return the rest frequency of the specified line as a Measure.
MSIter(const Block< MeasurementSet > &mss, const std::vector< std::pair< String, CountedPtr< BaseCompare >>> &sortColumns)
Same as above with multiple MSs as input.
Table table() const
Return the current Table iteration.
const MS & ms(const size_t n) const
Get a reference to the nth ms in the list of ms associated with this iterator.
Bool allBeamOffsetsZero() const
True if all elements of the cube returned by getBeamOffsets are zero.
Int lastSpectralWindowId_p
void advance()
advance the iteration
Int lastDataDescId_p
These variables point to the IDs of the previous iteration.
void setInterval(Double timeInterval)
Set or reset the time interval to use for iteration.
const MDirection & phaseCenter() const
Returns the phasecenter for the first time stamp of the iteration The time is important for field tab...
PolFrame polFrame_p
are zero (to speed things up in a single beam case)
MSIter()
Default constructor - useful only to assign another iterator later.
Int polFrame() const
Return frame for polarization of the first element in this iteration.
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...
const ScalarColumn< Int > & colDataDescriptionIds() const
Return the current DataDescriptionIds for all rows in this iteration.
const String & sourceName() const
Bool timeInSort_p
This booleans determine if given columns are part of the sorting.
Bool storeSorted_p
Globally control disk storage of SORTED_TABLE.
MPosition telescopePosition_p
Bool newDataDescriptionId() const
Return True if DataDescriptionId has changed since last iteration Note that if MS_DATA_DESC_ID is not...
virtual MSIter & operator++()
size_t msId() const
Return the current MS Id (according to the order in which they appeared in the constructor)
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...
size_t numMS() const
Get the number of actual ms's associated wth this iterator.
Block< Bool > tabIterAtStart_p
Int spectralWindowId() const
Return SpectralWindow of the first element in this iteration.
Int curDataDescIdFirst_p
These variables point to the current (as in this iteration) DD, SPW and polarization IDs.
Bool newField() const
Return True if FieldId/Source has changed since last iteration Note that if MS_FIELD_ID is not part o...
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...
virtual MSIter & operator++(int)
Advance iterator through data.
Matrix< SquareMatrix< Complex, 2 > > CJones_p
similar to receptorAngle_p
Vector< String > antennaMounts_p
const Matrix< SquareMatrix< Complex, 2 > > & CJonesAll() const
Return the feed configuration/leakage matrix for all feeds and antennae First axis is antennaId,...
Int fieldId() const
Return the FieldId of the first element in this iteration.
void cacheCurrentDDInfo() const
Store the current DD, SPW, Pol ID.
const String & fieldName() const
return FIELD table associated current fieldname and sourcename respectively
void construct(const Block< Int > &sortColumns, Bool addDefaultSortColumns)
handle the construction details
Int curSpectralWindowIdFirst_p
MSIter(const MeasurementSet &ms, const std::vector< std::pair< String, CountedPtr< BaseCompare >>> &sortColumns)
This constructor is similar to the previous ones but the comparison functions used to group the itera...
Cube< RigidVector< Double, 2 > > beamOffsets_p
antenna (e.g.
MFrequency restFrequency_p
virtual void setState()
set the iteration state
Cube< Double > receptorAngles_p
temporary retained for compatibility contain actually a reference to the first plane of receptorAngle...
PtrBlock< TableIterator * > tabIter_p
void setFieldInfo() const
Int curPolarizationIdFirst_p
MSIter(const MSIter &other)
Copy construct.
Block< MeasurementSet > bms_p
const Cube< Double > & receptorAngles() const
Return the receptor angles for all feeds and antennae First axis is a receptor number,...
MSIter & operator=(const MSIter &other)
Assigment.
Double prevFirstTimeStamp_p
Vector< Double > frequency_p
String curSourceNameFirst_p
const ScalarColumn< Int > & colFieldIds() const
Return the current FieldIds for all rows in this iteration.
Int dataDescriptionId() const
Return DataDescriptionId of the first element in this iteration.
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.
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...
CountedPtr< MSColumns > msc_p
const ScalarColumn< Int > & colArrayIds() const
Return the current ArrayIds for all rows in this iteration.
Double interval_p
time selection
const MFrequency & frequency0() const
Return frequency of first channel of the first element in iteration with reference frame as a Measure...
A drop-in replacement for Block<T*>.
String: the storage and methods of handling collections of characters.
this file contains all the compiler specific defines
bool Bool
Define the standard types used by Casacore.