casacore
Loading...
Searching...
No Matches
MSIter.h
Go to the documentation of this file.
1//# MSIter.h: Step through the MeasurementEquation by table
2//# Copyright (C) 1996,1999,2000,2001,2002
3//# Associated Universities, Inc. Washington DC, USA.
4//#
5//# This library is free software; you can redistribute it and/or modify it
6//# under the terms of the GNU Library General Public License as published by
7//# the Free Software Foundation; either version 2 of the License, or (at your
8//# option) any later version.
9//#
10//# This library is distributed in the hope that it will be useful, but WITHOUT
11//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13//# License for more details.
14//#
15//# You should have received a copy of the GNU Library General Public License
16//# along with this library; if not, write to the Free Software Foundation,
17//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18//#
19//# Correspondence concerning AIPS++ should be addressed as follows:
20//# Internet email: casa-feedback@nrao.edu.
21//# Postal address: AIPS++ Project Office
22//# National Radio Astronomy Observatory
23//# 520 Edgemont Road
24//# Charlottesville, VA 22903-2475 USA
25
26#ifndef MS_MSITER_H
27#define MS_MSITER_H
28
29#include <casacore/casa/aips.h>
30#include <casacore/casa/Arrays/Matrix.h>
31#include <casacore/casa/Arrays/Cube.h>
32#include <casacore/ms/MeasurementSets/MeasurementSet.h>
33#include <casacore/measures/Measures/MFrequency.h>
34#include <casacore/measures/Measures/MDirection.h>
35#include <casacore/measures/Measures/MPosition.h>
36#include <casacore/tables/Tables/ScalarColumn.h>
37#include <casacore/casa/Utilities/Compare.h>
38#include <casacore/casa/BasicSL/String.h>
39#include <casacore/scimath/Mathematics/SquareMatrix.h>
40#include <casacore/scimath/Mathematics/RigidVector.h>
41
42namespace casacore { //# NAMESPACE CASACORE - BEGIN
43
44//# forward decl
45class MSColumns;
46class TableIterator;
47
48// <summary>
49// Small helper class to specify an 'interval' comparison
50// </summary>
51// <synopsis>
52// Small helper class to specify an 'interval' comparison for table iteration
53// by time interval.
54// </synopsis>
55class MSInterval : public BaseCompare
56{
57public:
58 explicit MSInterval(Double interval) : interval_p(interval), offset_p(0) {}
59 virtual ~MSInterval() {}
60 virtual int comp(const void * obj1, const void * obj2) const;
61 Double getOffset() const {return offset_p;}
62 virtual void setOffset(Double offset) {offset_p=offset;}
63 Double getInterval() const {return interval_p;}
64 void setInterval(Double interval) {interval_p=interval;}
65private:
68};
69
70// <summary>
71// An iterator class for MeasurementSets
72// </summary>
73
74// <use visibility=export>
75
76// <prerequisite>
77// <li> <linkto class="MeasurementSet:description">MeasurementSet</linkto>
78// </prerequisite>
79//
80// <etymology>
81// MSIter stands for the MeasurementSet Iterator class.
82// </etymology>
83//
84// <synopsis>
85// An MSIter is a class to traverse a MeasurementSet in various orders. It
86// automatically adds four predefined sort columns to your selection of sort
87// columns (see constructor) so that it can keep track of changes in frequency
88// or polarization setup, field position and sub-array. Note that this can
89// cause iterations to occur in a different way from what you would expect, see
90// examples below. MSIter implements iteration by time interval for the use of
91// e.g., calibration tasks that want to calculate solutions over some interval
92// of time. You can iterate over multiple MeasurementSets with this class.
93// </synopsis>
94//
95// <example>
96// <srcblock>
97// // The following code iterates by by ARRAY_ID, FIELD_ID, DATA_DESC_ID and
98// // TIME (all implicitly added columns) and then by baseline (antenna pair),
99// // in 3000s intervals.
100// MeasurementSet ms("3C273XC1.ms");
101// Block<int> sort(2);
102// sort[0] = MS::ANTENNA1;
103// sort[1] = MS::ANTENNA2;
104// Double timeInterval = 3000;
105// MSIter msIter(ms,sort,timeInteval);
106// for (msIter.origin(); msIter.more(); msIter++) {
107// // print out some of the iteration state
108// cout << msIter.fieldId() << endl;
109// cout << msIter.fieldName() << endl;
110// cout << msIter.dataDescriptionId() << endl;
111// cout << msIter.frequency0() << endl;
112// cout << msIter.table().nrow() << endl;
113// process(msIter.table()); // process the data in the current iteration
114// }
115// // Output shows only 1 row at a time because the table is sorted on TIME
116// // first and ANTENNA1, ANTENNA2 next and each baseline occurs only once per
117// // TIME stamp. The interval has no effect in this case.
118// </srcblock>
119// </example>
120
121// <example>
122// <srcblock>
123// // The following code iterates by baseline (antenna pair), TIME, and,
124// // implicitly, by ARRAY_ID, FIELD_ID and DATA_DESC_ID in 3000s
125// // intervals.
126// MeasurementSet ms("3C273XC1.ms");
127// Block<int> sort(3);
128// sort[0] = MS::ANTENNA1;
129// sort[1] = MS::ANTENNA2;
130// sort[2] = MS::TIME;
131// Double timeInterval = 3000;
132// MSIter msIter(ms,sort,timeInteval);
133// for (msIter.origin(); msIter.more(); msIter++) {
134// // print out some of the iteration state
135// cout << msIter.fieldId() << endl;
136// cout << msIter.fieldName() << endl;
137// cout << msIter.dataDescriptionId() << endl;
138// cout << msIter.frequency0() << endl;
139// cout << msIter.table().nrow() << endl;
140// process(msIter.table()); // process the data in the current iteration
141// // Now the output shows 7 rows at a time, all with identical ANTENNA1
142// // and ANTENNA2 values and TIME values within a 3000s interval.
143// }
144// </srcblock>
145// </example>
146//
147// <motivation>
148// This class was originally part of the VisibilityIterator class, but that
149// class was getting too large and complicated. By splitting out the toplevel
150// iteration into this class the code is much easier to understand. It is now
151// also available through the ms tool.
152// </motivation>
153//
154// <todo>
155// <li> multiple observatories in a single MS are not handled correctly (need to
156// sort on observation id and check observatory name to set position frame)
157// </todo>
158
160{
161public:
162 enum PolFrame {
163 // Circular polarization
165 // Linear polarization
166 Linear=1
167 };
168
169 // Default constructor - useful only to assign another iterator later.
170 // Use of other member functions on this object is likely to dump core.
172
173 // Construct from MS and a Block of MS column enums specifying the
174 // iteration order, if none are specified, ARRAY_ID, FIELD_ID, DATA_DESC_ID,
175 // and TIME iteration is implicit (unless addDefaultSortColumns=False)
176 // These columns will be added first if they are not specified.
177 // An optional timeInterval can be given to iterate through chunks of time.
178 // The default interval of 0 groups all times together.
179 // Every 'chunk' of data contains all data within a certain time interval
180 // and with identical values of the other iteration columns (e.g.
181 // DATA_DESCRIPTION_ID and FIELD_ID).
182 // See the examples above for the effect of different sort orders.
183 //
184 // The storeSorted parameter determines how the resulting SORT_TABLE is
185 // managed. If storeSorted is true then the table will be stored on disk;
186 // this potentially allows its reuse in the future but has also been shown
187 // to be a problem when the MS is being read in parallel. If storeSorted is
188 // false then the SORTED_TABLE is constructed and used in memory which keeps
189 // concurrent readers from interfering with each other.
190
191 MSIter(const MeasurementSet& ms, const Block<Int>& sortColumns,
192 Double timeInterval=0, Bool addDefaultSortColumns=True,
193 Bool storeSorted=True);
194
195 // Same as above with multiple MSs as input.
196 MSIter(const Block<MeasurementSet>& mss, const Block<Int>& sortColumns,
197 Double timeInterval=0, Bool addDefaultSortColumns=True,
198 Bool storeSorted=True);
199
200 // This constructor is similar to the previous ones but the comparison
201 // functions used to group the iterations are given explicitly, making
202 // the constructor more generic. Also, the column is specified as a string,
203 // to support sorting by columns not part of the standard MS definition.
204 // Note that with this constructor TIME is not treated in any special way and
205 // there are no default sorting columns, i.e., the sorting needs have to be
206 // set explicitly.
207 // The last element in vector sortColumns will be the column that will change
208 // faster in the iteration loop, whereas the first element will be the slower.
209 // For instance, if sortColumns[0].first = "DATA_DESC_ID" nad
210 // sortColumns[1].first = "ANTENNA1" then the first iterations will go through
211 // all possible values of ANTENNA1 for the first DDId, then it will start
212 // the iterations for the second DDId and so on.
214 const std::vector<std::pair<String, std::shared_ptr<BaseCompare>>>& sortColumns);
215
216 // Same as above with multiple MSs as input.
218 const std::vector<std::pair<String, std::shared_ptr<BaseCompare>>>& sortColumns);
219
220 // Copy construct. This calls the assigment operator.
221 MSIter(const MSIter & other);
222
223 MSIter *clone() const;
224
225 // Destructor
226 virtual ~MSIter();
227
228 // Assigment. This will reset the iterator to the origin.
229 MSIter & operator=(const MSIter &other);
230
231 //# Members
232
233 // Set or reset the time interval to use for iteration.
234 // You should call origin() to reset the iteration after
235 // calling this.
236 void setInterval(Double timeInterval);
237
238 // Reset iterator to start of data
239 virtual void origin();
240
241 // Return False if there is no more data
242 virtual Bool more() const;
243
244 // Advance iterator through data
245 virtual MSIter & operator++(int);
246 virtual MSIter & operator++();
247
248 // Report Name of slowest column that changes at end of current iteration
249 const String& keyChange() const;
250
251 // Return the current Table iteration
252 Table table() const;
253
254 // Return reference to the current MS
255 const MS& ms() const;
256
257 // Return reference to the current MSColumns
258 const MSColumns& msColumns() const;
259
260 // Return the current MS Id (according to the order in which
261 // they appeared in the constructor)
262 size_t msId() const;
263
264 // Return true if msId has changed since last iteration
265 Bool newMS() const;
266
267 // Return the current ArrayIds for all rows in this iteration
268 const ScalarColumn<Int>& colArrayIds() const;
269
270 // Return the current FieldIds for all rows in this iteration
271 const ScalarColumn<Int>& colFieldIds() const;
272
273 // Return the current DataDescriptionIds for all rows in this iteration
275
276 // Return the ArrayId of the first element in this iteration
277 Int arrayId() const;
278
279 // Return True if ArrayId has changed since last iteration
280 // Note that if MS_ARRAY is not part of the sorting columns this
281 // will always be true.
282 Bool newArray() const;
283
284 // Return the FieldId of the first element in this iteration
285 Int fieldId() const;
286
287 // Return True if FieldId/Source has changed since last iteration
288 // Note that if MS_FIELD_ID is not part of the sorting columns this
289 // will always be true.
290 Bool newField() const;
291
292 // Return SpectralWindow of the first element in this iteration
293 Int spectralWindowId() const;
294
295 // Return True if SpectralWindow has changed since last iteration
296 // Note that if MS_DATA_DESC_ID is not part of the sorting columns this
297 // will always be true.
298 Bool newSpectralWindow() const;
299
300 // Return DataDescriptionId of the first element in this iteration
301 Int dataDescriptionId() const;
302
303 // Return True if DataDescriptionId has changed since last iteration
304 // Note that if MS_DATA_DESC_ID is not part of the sorting columns this
305 // will always be true.
307
308 // Return PolarizationId of the first element in this iteration
309 Int polarizationId() const;
310
311 // Return True if polarization has changed since last iteration
312 // Note that if MS_DATA_DESC_ID is not part of the sorting columns this
313 // will always be true.
314 Bool newPolarizationId() const;
315
316
317 // Return frame for polarization of the first element in this iteration
318 // @returns PolFrame enum
319 Int polFrame() const;
320
321 // Return the frequencies corresponding to the DATA matrix.
322 const Vector<Double>& frequency() const;
323
324 // Return frequency of first channel of the first element in iteration
325 // with reference frame as a Measure.
326 // The reference frame Epoch is that of the first row, reset it as needed
327 // for each row.
328 // The reference frame Position is the average of the antenna positions.
329 const MFrequency& frequency0() const;
330
331 // Return the rest frequency of the specified line as a Measure
332 const MFrequency& restFrequency(Int line=0) const;
333
334 // Return the telescope position (if a known telescope) or the
335 // position of the first antenna (if unknown)
336 const MPosition& telescopePosition() const;
337
338 // Return the feed configuration/leakage matrix for feed 0 on each antenna
339 // TODO: CJonesAll can be used instead of this method in all instances
340 const Vector<SquareMatrix<Complex,2> >& CJones() const;
341
342 // Return the feed configuration/leakage matrix for all feeds and antennae
343 // First axis is antennaId, 2nd axis is feedId. Result of CJones() is
344 // a reference to the first column of the matrix returned by this method
346
347 // Return the receptor angle for feed 0 on each antenna.
348 // First axis is receptor number, 2nd axis is antennaId.
349 // TODO: receptorAngles() can be used instead of this method
350 const Matrix<Double>& receptorAngle() const;
351
352 // Return the receptor angles for all feeds and antennae
353 // First axis is a receptor number, 2nd axis is antennaId,
354 // 3rd axis is feedId. Result of receptorAngle() is just a reference
355 // to the first plane of the cube returned by this method
356 const Cube<Double>& receptorAngles() const;
357
358 // Return a string mount identifier for each antenna
359 const Vector<String>& antennaMounts() const;
360
361 // Return a cube containing pairs of coordinate offset for each receptor
362 // of each feed (values are in radians, coordinate system is fixed with
363 // antenna and is the same as used to define the BEAM_OFFSET parameter
364 // in the feed table). The cube axes are receptor, antenna, feed.
366
367 // True if all elements of the cube returned by getBeamOffsets are zero
368 Bool allBeamOffsetsZero() const;
369
370 // Get the spw, start and nchan for all the ms's is this msiter that
371 // match the frequecy "freqstart-freqStep" and "freqEnd+freqStep" range
372
374 Block<Vector<Int> >& start,
375 Block<Vector<Int> >& nchan,
376 Double freqStart, Double freqEnd,
377 Double freqStep);
378
379 //Get the number of actual ms's associated wth this iterator
380 size_t numMS() const;
381
382 //Get a reference to the nth ms in the list of ms associated with this
383 // iterator. If larger than the list of ms's current ms is returned
384 // So better check wth numMS() before making the call
385 const MS& ms(const size_t n) const;
386
387 //Returns the phasecenter for the first time stamp of the iteration
388 //The time is important for field tables that have polynomial or ephemerides
389 //phasecenters, i.e time varying for a given field_id..
390 //If the iterator is set so as one iteration has more that 1 time stamp
391 //then this version is correct only for fixed phasecenters
392 const MDirection& phaseCenter() const;
393
394 //If the iterator is set so as one iteration has more that 1 value of time stamp
395 // or fieldid
396 //then the caller should use the phasecenter with field id and time explicitly
397 const MDirection phaseCenter(const Int fldID, const Double timeStamp) const ;
398
399 //return FIELD table associated current fieldname and sourcename respectively
400 const String& fieldName() const;
401 const String& sourceName() const;
402
403protected:
404 // handle the construction details
405 void construct(const Block<Int>& sortColumns, Bool addDefaultSortColumns);
406 // handle the construction details using explicit comparison functions
407 void construct(const std::vector<std::pair<String, std::shared_ptr<BaseCompare>>>& sortColumns);
408 // advance the iteration
409 void advance();
410 // set the iteration state
411 virtual void setState();
412 void setMSInfo();
414 void setFeedInfo() const;
415 // Store the current DD, SPW, Pol ID.
416 // It can be called in logically const objects although it modifies
417 // caching (mutable) variables for performance reasons.
418 void cacheCurrentDDInfo() const;
419 // Store extra info related to the DD.
420 // It can be called in logically const objects although it modifies
421 // caching (mutable) variables for performance reasons.
422 void cacheExtraDDInfo() const;
423 void setFieldInfo() const;
424
425// Determine if the numbers in r1 are a sorted subset of those in r2
427
432
433 // This booleans determine if given columns are part of the sorting
435
436 size_t nMS_p, curMS_p;
437 ssize_t lastMS_p;
438 std::shared_ptr<MSColumns> msc_p;
445 // These variables point to the current (as in this iteration)
446 // DD, SPW and polarization IDs. They are mutable since they are
447 // evaluated in a lazy way, i.e., only when needed. If the DDId is
448 // part of the sorting columns then it is always computed when calling
449 // next(), otherwise it is only computed when some accesor of
450 // metadata that depends on them is called by the application.
453 // These variables point to the IDs of the previous iteration.
458
459 // Variable to know whether the feed info is already computed
460 mutable bool feedInfoCached_p;
461
462
463 // Globally control disk storage of SORTED_TABLE
465
466 // time selection
468
469 // This column is mutable since it is only attached when it is
470 // neccesary to read the DD Ids. That might happen when calling
471 // a const accesor like dataDescriptionId().
474
477 //cache for access functions
478 mutable Matrix<Double> receptorAnglesFeed0_p; // former receptorAngle_p,
479 // temporary retained for compatibility
480 // contain actually a reference to the
481 // first plane of receptorAngles_p
483 mutable Vector<SquareMatrix<Complex,2> > CJonesFeed0_p; // a temporary reference
484 // similar to receptorAngle_p
486 Vector<String> antennaMounts_p; // a string mount identifier for each
487 // antenna (e.g. EQUATORIAL, ALT-AZ,...)
488 mutable Cube<RigidVector<Double, 2> > beamOffsets_p;// angular offsets (two values for
489 // each element of the cube in radians)
490 // in the antenna coordinate system.
491 // Cube axes are: receptor, antenna, feed.
492 mutable Bool allBeamOffsetsZero_p; // True if all elements of beamOffsets_p
493 // are zero (to speed things up in a
494 // single beam case)
495 mutable PolFrame polFrame_p; // polarization Frame. It is lazily cached,
496 // hence mutable. See cacheExtraDDInfo()
497 mutable Bool freqCacheOK_p; // signal that the frequency cache is fine
502
503 std::shared_ptr<MSInterval> timeComp_p; // Points to the time comparator.
504 // 0 if not using a time interval.
505};
506
507inline Bool MSIter::more() const { return more_p;}
508inline Table MSIter::table() const {return curTable_p;}
509inline const MS& MSIter::ms() const {return bms_p[curMS_p];}
510inline const MSColumns& MSIter::msColumns() const { return *msc_p;}
511inline Bool MSIter::newMS() const { return newMS_p;}
512inline Bool MSIter::newArray() const {return newArrayId_p;}
513inline Bool MSIter::newField() const { return newFieldId_p;}
516inline size_t MSIter::msId() const { return curMS_p;}
517inline size_t MSIter::numMS() const { return nMS_p;}
519{ return colArray_p;}
521{ return colField_p;}
525inline Int MSIter::arrayId() const {return curArrayIdFirst_p;}
542{ return telescopePosition_p;}
552{return antennaMounts_p;}
557
558} //# NAMESPACE CASACORE - END
559
560#endif
abstract base class for comparing two objects
Definition Compare.h:63
simple 1-D array
Definition Block.h:198
Double getInterval() const
Definition MSIter.h:63
Double getOffset() const
Definition MSIter.h:61
void setInterval(Double interval)
Definition MSIter.h:64
virtual int comp(const void *obj1, const void *obj2) const
Compare two objects, and return.
virtual ~MSInterval()
Definition MSIter.h:59
virtual void setOffset(Double offset)
Definition MSIter.h:62
MSInterval(Double interval)
Definition MSIter.h:58
An iterator class for MeasurementSets.
Definition MSIter.h:160
virtual MSIter & operator++(int)
Advance iterator through data.
Int polarizationId() const
Return PolarizationId of the first element in this iteration.
Definition MSIter.h:530
Bool arrayInSort_p
Definition MSIter.h:434
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
void construct(const std::vector< std::pair< String, std::shared_ptr< BaseCompare > > > &sortColumns)
handle the construction details using explicit comparison functions
const MS & ms() const
Return reference to the current MS.
Definition MSIter.h:509
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...
Definition MSIter.h:512
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
virtual ~MSIter()
Destructor.
Bool fieldInSort_p
Definition MSIter.h:434
MSIter * This
Definition MSIter.h:428
Bool newDataDescId_p
Definition MSIter.h:456
const MSColumns & msColumns() const
Return reference to the current MSColumns.
Definition MSIter.h:510
Int curFieldIdFirst_p
Definition MSIter.h:443
@ Linear
Linear polarization.
Definition MSIter.h:166
@ Circular
Circular polarization.
Definition MSIter.h:164
String curFieldNameFirst_p
Definition MSIter.h:441
Bool newPolarizationId_p
Definition MSIter.h:456
void cacheExtraDDInfo() const
Store extra info related to the DD.
ScalarColumn< Int > colArray_p
Definition MSIter.h:473
const Vector< String > & antennaMounts() const
Return a string mount identifier for each antenna.
Definition MSIter.h:551
Bool newSpectralWindowId_p
Definition MSIter.h:455
Int lastPolarizationId_p
Definition MSIter.h:454
Bool newFieldId_p
Definition MSIter.h:455
const Matrix< Double > & receptorAngle() const
Return the receptor angle for feed 0 on each antenna.
Definition MSIter.h:547
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...
Definition MSIter.h:541
const MDirection & phaseCenter() const
Returns the phasecenter for the first time stamp of the iteration The time is important for field tab...
Int arrayId() const
Return the ArrayId of the first element in this iteration.
Definition MSIter.h:525
Matrix< Double > receptorAnglesFeed0_p
cache for access functions
Definition MSIter.h:478
Vector< SquareMatrix< Complex, 2 > > CJonesFeed0_p
Definition MSIter.h:483
const MFrequency & frequency0() const
Return frequency of first channel of the first element in iteration with reference frame as a Measure...
Bool newMS() const
Return true if msId has changed since last iteration.
Definition MSIter.h:511
Bool allBeamOffsetsZero_p
each element of the cube in radians) in the antenna coordinate system.
Definition MSIter.h:492
Bool newArrayId_p
Definition MSIter.h:455
ssize_t lastMS_p
Definition MSIter.h:437
Bool freqCacheOK_p
hence mutable.
Definition MSIter.h:497
Int curSourceIdFirst_p
Definition MSIter.h:440
ScalarColumn< Int > colField_p
Definition MSIter.h:472
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
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...
virtual Bool more() const
Return False if there is no more data.
Definition MSIter.h:507
virtual void origin()
Reset iterator to start of data.
bool feedInfoCached_p
Variable to know whether the feed info is already computed.
Definition MSIter.h:460
std::shared_ptr< MSInterval > timeComp_p
Definition MSIter.h:503
Table table() const
Return the current Table iteration.
Definition MSIter.h:508
const MFrequency & restFrequency(Int line=0) const
Return the rest frequency of the specified line as a Measure.
const String & keyChange() const
Report Name of slowest column that changes at end of current iteration.
Bool allBeamOffsetsZero() const
True if all elements of the cube returned by getBeamOffsets are zero.
Definition MSIter.h:555
Int lastSpectralWindowId_p
Definition MSIter.h:454
const String & sourceName() const
Table curTable_p
Definition MSIter.h:439
void advance()
advance the iteration
Int lastDataDescId_p
These variables point to the IDs of the previous iteration.
Definition MSIter.h:454
void setInterval(Double timeInterval)
Set or reset the time interval to use for iteration.
bool spwDepFeed_p
Definition MSIter.h:457
PolFrame polFrame_p
are zero (to speed things up in a single beam case)
Definition MSIter.h:495
MSIter()
Default constructor - useful only to assign another iterator later.
Int polFrame() const
Return frame for polarization of the first element in this iteration.
Definition MSIter.h:538
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
const ScalarColumn< Int > & colDataDescriptionIds() const
Return the current DataDescriptionIds for all rows in this iteration.
Definition MSIter.h:522
Bool timeInSort_p
This booleans determine if given columns are part of the sorting.
Definition MSIter.h:434
Bool storeSorted_p
Globally control disk storage of SORTED_TABLE.
Definition MSIter.h:464
MPosition telescopePosition_p
Definition MSIter.h:501
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
MSIter(const Block< MeasurementSet > &mss, const std::vector< std::pair< String, std::shared_ptr< BaseCompare > > > &sortColumns)
Same as above with multiple MSs as input.
size_t msId() const
Return the current MS Id (according to the order in which they appeared in the constructor)
Definition MSIter.h:516
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
size_t numMS() const
Get the number of actual ms's associated wth this iterator.
Definition MSIter.h:517
Block< Bool > tabIterAtStart_p
Definition MSIter.h:431
Int curArrayIdFirst_p
Definition MSIter.h:440
Int spectralWindowId() const
Return SpectralWindow of the first element in this iteration.
Definition MSIter.h:527
Int curDataDescIdFirst_p
These variables point to the current (as in this iteration) DD, SPW and polarization IDs.
Definition MSIter.h:451
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
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...
const String & fieldName() const
return FIELD table associated current fieldname and sourcename respectively
Matrix< SquareMatrix< Complex, 2 > > CJones_p
similar to receptorAngle_p
Definition MSIter.h:485
std::shared_ptr< MSColumns > msc_p
Definition MSIter.h:438
MFrequency frequency0_p
Definition MSIter.h:499
const MS & ms(const size_t n) const
Get a reference to the nth ms in the list of ms associated with this iterator.
Vector< String > antennaMounts_p
Definition MSIter.h:486
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
virtual MSIter & operator++()
Int fieldId() const
Return the FieldId of the first element in this iteration.
Definition MSIter.h:526
void cacheCurrentDDInfo() const
Store the current DD, SPW, Pol ID.
void construct(const Block< Int > &sortColumns, Bool addDefaultSortColumns)
handle the construction details
Int curSpectralWindowIdFirst_p
Definition MSIter.h:451
MSIter * clone() const
Cube< RigidVector< Double, 2 > > beamOffsets_p
antenna (e.g.
Definition MSIter.h:488
void setFeedInfo() const
MFrequency restFrequency_p
Definition MSIter.h:500
virtual void setState()
set the iteration state
MDirection phaseCenter_p
Definition MSIter.h:475
Cube< Double > receptorAngles_p
temporary retained for compatibility contain actually a reference to the first plane of receptorAngle...
Definition MSIter.h:482
MSIter & operator=(const MSIter &other)
Assigment.
PtrBlock< TableIterator * > tabIter_p
Definition MSIter.h:430
void setFieldInfo() const
Int curPolarizationIdFirst_p
Definition MSIter.h:452
MSIter(const MSIter &other)
Copy construct.
Block< MeasurementSet > bms_p
Definition MSIter.h:429
const Cube< Double > & receptorAngles() const
Return the receptor angles for all feeds and antennae First axis is a receptor number,...
Definition MSIter.h:549
Double prevFirstTimeStamp_p
Definition MSIter.h:476
Vector< Double > frequency_p
Definition MSIter.h:498
String curSourceNameFirst_p
Definition MSIter.h:442
const ScalarColumn< Int > & colFieldIds() const
Return the current FieldIds for all rows in this iteration.
Definition MSIter.h:520
Int dataDescriptionId() const
Return DataDescriptionId of the first element in this iteration.
Definition MSIter.h:533
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...
const ScalarColumn< Int > & colArrayIds() const
Return the current ArrayIds for all rows in this iteration.
Definition MSIter.h:518
size_t curMS_p
Definition MSIter.h:436
const Vector< Double > & frequency() const
Return the frequencies corresponding to the DATA matrix.
Double interval_p
time selection
Definition MSIter.h:467
A drop-in replacement for Block<T*>.
Definition Block.h:812
String: the storage and methods of handling collections of characters.
Definition String.h:223
this file contains all the compiler specific defines
Definition mainpage.dox:28
int Int
Definition aipstype.h:48
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40
const Bool True
Definition aipstype.h:41
double Double
Definition aipstype.h:53