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 public:
57 explicit MSInterval(Double interval) : interval_p(interval), offset_p(0) {}
58 virtual ~MSInterval() {}
59 virtual int comp(const void* obj1, const void* obj2) const;
60 Double getOffset() const { return offset_p; }
61 virtual void setOffset(Double offset) { offset_p = offset; }
62 Double getInterval() const { return interval_p; }
63 void setInterval(Double interval) { interval_p = interval; }
64
65 private:
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() << std::endl;
109// cout << msIter.fieldName() << std::endl;
110// cout << msIter.dataDescriptionId() << std::endl;
111// cout << msIter.frequency0() << std::endl;
112// cout << msIter.table().nrow() << std::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() << std::endl;
136// cout << msIter.fieldName() << std::endl;
137// cout << msIter.dataDescriptionId() << std::endl;
138// cout << msIter.frequency0() << std::endl;
139// cout << msIter.table().nrow() << std::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
159class MSIter {
160 public:
161 enum PolFrame {
162 // Circular polarization
164 // Linear polarization
166 };
167
168 // Default constructor - useful only to assign another iterator later.
169 // Use of other member functions on this object is likely to dump core.
171
172 // Construct from MS and a Block of MS column enums specifying the
173 // iteration order, if none are specified, ARRAY_ID, FIELD_ID, DATA_DESC_ID,
174 // and TIME iteration is implicit (unless addDefaultSortColumns=False)
175 // These columns will be added first if they are not specified.
176 // An optional timeInterval can be given to iterate through chunks of time.
177 // The default interval of 0 groups all times together.
178 // Every 'chunk' of data contains all data within a certain time interval
179 // and with identical values of the other iteration columns (e.g.
180 // DATA_DESCRIPTION_ID and FIELD_ID).
181 // See the examples above for the effect of different sort orders.
182 //
183 // The storeSorted parameter determines how the resulting SORT_TABLE is
184 // managed. If storeSorted is true then the table will be stored on disk;
185 // this potentially allows its reuse in the future but has also been shown
186 // to be a problem when the MS is being read in parallel. If storeSorted is
187 // false then the SORTED_TABLE is constructed and used in memory which keeps
188 // concurrent readers from interfering with each other.
189
190 MSIter(const MeasurementSet& ms, const Block<Int>& sortColumns, Double timeInterval = 0,
191 Bool addDefaultSortColumns = True, Bool storeSorted = True);
192
193 // Same as above with multiple MSs as input.
194 MSIter(const Block<MeasurementSet>& mss, const Block<Int>& sortColumns, Double timeInterval = 0,
195 Bool addDefaultSortColumns = True, Bool storeSorted = True);
196
197 // This constructor is similar to the previous ones but the comparison
198 // functions used to group the iterations are given explicitly, making
199 // the constructor more generic. Also, the column is specified as a string,
200 // to support sorting by columns not part of the standard MS definition.
201 // Note that with this constructor TIME is not treated in any special way and
202 // there are no default sorting columns, i.e., the sorting needs have to be
203 // set explicitly.
204 // The last element in vector sortColumns will be the column that will change
205 // faster in the iteration loop, whereas the first element will be the slower.
206 // For instance, if sortColumns[0].first = "DATA_DESC_ID" nad
207 // sortColumns[1].first = "ANTENNA1" then the first iterations will go through
208 // all possible values of ANTENNA1 for the first DDId, then it will start
209 // the iterations for the second DDId and so on.
211 const std::vector<std::pair<String, std::shared_ptr<BaseCompare>>>& sortColumns);
212
213 // Same as above with multiple MSs as input.
215 const std::vector<std::pair<String, std::shared_ptr<BaseCompare>>>& sortColumns);
216
217 // Copy construct. This calls the assigment operator.
218 MSIter(const MSIter& other);
219
220 MSIter* clone() const;
221
222 // Destructor
223 virtual ~MSIter();
224
225 // Assigment. This will reset the iterator to the origin.
226 MSIter& operator=(const MSIter& other);
227
228 // # Members
229
230 // Set or reset the time interval to use for iteration.
231 // You should call origin() to reset the iteration after
232 // calling this.
233 void setInterval(Double timeInterval);
234
235 // Reset iterator to start of data
236 virtual void origin();
237
238 // Return False if there is no more data
239 virtual Bool more() const;
240
241 // Advance iterator through data
242 virtual MSIter& operator++(int);
243 virtual MSIter& operator++();
244
245 // Report Name of slowest column that changes at end of current iteration
246 const String& keyChange() const;
247
248 // Return the current Table iteration
249 Table table() const;
250
251 // Return reference to the current MS
252 const MS& ms() const;
253
254 // Return reference to the current MSColumns
255 const MSColumns& msColumns() const;
256
257 // Return the current MS Id (according to the order in which
258 // they appeared in the constructor)
259 size_t msId() const;
260
261 // Return true if msId has changed since last iteration
262 Bool newMS() const;
263
264 // Return the current ArrayIds for all rows in this iteration
265 const ScalarColumn<Int>& colArrayIds() const;
266
267 // Return the current FieldIds for all rows in this iteration
268 const ScalarColumn<Int>& colFieldIds() const;
269
270 // Return the current DataDescriptionIds for all rows in this iteration
272
273 // Return the ArrayId of the first element in this iteration
274 Int arrayId() const;
275
276 // Return True if ArrayId has changed since last iteration
277 // Note that if MS_ARRAY is not part of the sorting columns this
278 // will always be true.
279 Bool newArray() const;
280
281 // Return the FieldId of the first element in this iteration
282 Int fieldId() const;
283
284 // Return True if FieldId/Source has changed since last iteration
285 // Note that if MS_FIELD_ID is not part of the sorting columns this
286 // will always be true.
287 Bool newField() const;
288
289 // Return SpectralWindow of the first element in this iteration
290 Int spectralWindowId() const;
291
292 // Return True if SpectralWindow has changed since last iteration
293 // Note that if MS_DATA_DESC_ID is not part of the sorting columns this
294 // will always be true.
295 Bool newSpectralWindow() const;
296
297 // Return DataDescriptionId of the first element in this iteration
298 Int dataDescriptionId() const;
299
300 // Return True if DataDescriptionId has changed since last iteration
301 // Note that if MS_DATA_DESC_ID is not part of the sorting columns this
302 // will always be true.
304
305 // Return PolarizationId of the first element in this iteration
306 Int polarizationId() const;
307
308 // Return True if polarization has changed since last iteration
309 // Note that if MS_DATA_DESC_ID is not part of the sorting columns this
310 // will always be true.
311 Bool newPolarizationId() const;
312
313 // Return frame for polarization of the first element in this iteration
314 // @returns PolFrame enum
315 Int polFrame() const;
316
317 // Return the frequencies corresponding to the DATA matrix.
318 const Vector<Double>& frequency() const;
319
320 // Return frequency of first channel of the first element in iteration
321 // with reference frame as a Measure.
322 // The reference frame Epoch is that of the first row, reset it as needed
323 // for each row.
324 // The reference frame Position is the average of the antenna positions.
325 const MFrequency& frequency0() const;
326
327 // Return the rest frequency of the specified line as a Measure
328 const MFrequency& restFrequency(Int line = 0) const;
329
330 // Return the telescope position (if a known telescope) or the
331 // position of the first antenna (if unknown)
332 const MPosition& telescopePosition() const;
333
334 // Return the feed configuration/leakage matrix for feed 0 on each antenna
335 // TODO: CJonesAll can be used instead of this method in all instances
337
338 // Return the feed configuration/leakage matrix for all feeds and antennae
339 // First axis is antennaId, 2nd axis is feedId. Result of CJones() is
340 // a reference to the first column of the matrix returned by this method
342
343 // Return the receptor angle for feed 0 on each antenna.
344 // First axis is receptor number, 2nd axis is antennaId.
345 // TODO: receptorAngles() can be used instead of this method
346 const Matrix<Double>& receptorAngle() const;
347
348 // Return the receptor angles for all feeds and antennae
349 // First axis is a receptor number, 2nd axis is antennaId,
350 // 3rd axis is feedId. Result of receptorAngle() is just a reference
351 // to the first plane of the cube returned by this method
352 const Cube<Double>& receptorAngles() const;
353
354 // Return a string mount identifier for each antenna
355 const Vector<String>& antennaMounts() const;
356
357 // Return a cube containing pairs of coordinate offset for each receptor
358 // of each feed (values are in radians, coordinate system is fixed with
359 // antenna and is the same as used to define the BEAM_OFFSET parameter
360 // in the feed table). The cube axes are receptor, antenna, feed.
362
363 // True if all elements of the cube returned by getBeamOffsets are zero
364 Bool allBeamOffsetsZero() const;
365
366 // Get the spw, start and nchan for all the ms's is this msiter that
367 // match the frequecy "freqstart-freqStep" and "freqEnd+freqStep" range
368
370 Block<Vector<Int>>& nchan, Double freqStart, Double freqEnd,
371 Double freqStep);
372
373 // Get the number of actual ms's associated wth this iterator
374 size_t numMS() const;
375
376 // Get a reference to the nth ms in the list of ms associated with this
377 // iterator. If larger than the list of ms's current ms is returned
378 // So better check wth numMS() before making the call
379 const MS& ms(const size_t n) const;
380
381 // Returns the phasecenter for the first time stamp of the iteration
382 // The time is important for field tables that have polynomial or ephemerides
383 // phasecenters, i.e time varying for a given field_id..
384 // If the iterator is set so as one iteration has more that 1 time stamp
385 // then this version is correct only for fixed phasecenters
386 const MDirection& phaseCenter() const;
387
388 // If the iterator is set so as one iteration has more that 1 value of time stamp
389 // or fieldid
390 // then the caller should use the phasecenter with field id and time explicitly
391 const MDirection phaseCenter(const Int fldID, const Double timeStamp) const;
392
393 // return FIELD table associated current fieldname and sourcename respectively
394 const String& fieldName() const;
395 const String& sourceName() const;
396
397 protected:
398 // handle the construction details
399 void construct(const Block<Int>& sortColumns, Bool addDefaultSortColumns);
400 // handle the construction details using explicit comparison functions
401 void construct(const std::vector<std::pair<String, std::shared_ptr<BaseCompare>>>& sortColumns);
402 // advance the iteration
403 void advance();
404 // set the iteration state
405 virtual void setState();
406 void setMSInfo();
408 void setFeedInfo() const;
409 // Store the current DD, SPW, Pol ID.
410 // It can be called in logically const objects although it modifies
411 // caching (mutable) variables for performance reasons.
412 void cacheCurrentDDInfo() const;
413 // Store extra info related to the DD.
414 // It can be called in logically const objects although it modifies
415 // caching (mutable) variables for performance reasons.
416 void cacheExtraDDInfo() const;
417 void setFieldInfo() const;
418
419 // Determine if the numbers in r1 are a sorted subset of those in r2
421
426
427 // This booleans determine if given columns are part of the sorting
429
430 size_t nMS_p, curMS_p;
431 ssize_t lastMS_p;
432 std::shared_ptr<MSColumns> msc_p;
439 // These variables point to the current (as in this iteration)
440 // DD, SPW and polarization IDs. They are mutable since they are
441 // evaluated in a lazy way, i.e., only when needed. If the DDId is
442 // part of the sorting columns then it is always computed when calling
443 // next(), otherwise it is only computed when some accesor of
444 // metadata that depends on them is called by the application.
446 // These variables point to the IDs of the previous iteration.
451
452 // Variable to know whether the feed info is already computed
453 mutable bool feedInfoCached_p;
454
455 // Globally control disk storage of SORTED_TABLE
457
458 // time selection
460
461 // This column is mutable since it is only attached when it is
462 // neccesary to read the DD Ids. That might happen when calling
463 // a const accesor like dataDescriptionId().
466
469 // cache for access functions
470 mutable Matrix<Double> receptorAnglesFeed0_p; // former receptorAngle_p,
471 // temporary retained for compatibility
472 // contain actually a reference to the
473 // first plane of receptorAngles_p
475 mutable Vector<SquareMatrix<Complex, 2>> CJonesFeed0_p; // a temporary reference
476 // similar to receptorAngle_p
478 Vector<String> antennaMounts_p; // a string mount identifier for each
479 // antenna (e.g. EQUATORIAL, ALT-AZ,...)
480 mutable Cube<RigidVector<Double, 2>> beamOffsets_p; // angular offsets (two values for
481 // each element of the cube in radians)
482 // in the antenna coordinate system.
483 // Cube axes are: receptor, antenna, feed.
484 mutable Bool allBeamOffsetsZero_p; // True if all elements of beamOffsets_p
485 // are zero (to speed things up in a
486 // single beam case)
487 mutable PolFrame polFrame_p; // polarization Frame. It is lazily cached,
488 // hence mutable. See cacheExtraDDInfo()
489 mutable Bool freqCacheOK_p; // signal that the frequency cache is fine
494
495 std::shared_ptr<MSInterval> timeComp_p; // Points to the time comparator.
496 // 0 if not using a time interval.
497};
498
499inline Bool MSIter::more() const { return more_p; }
500inline Table MSIter::table() const { return curTable_p; }
501inline const MS& MSIter::ms() const { return bms_p[curMS_p]; }
502inline const MSColumns& MSIter::msColumns() const { return *msc_p; }
503inline Bool MSIter::newMS() const { return newMS_p; }
504inline Bool MSIter::newArray() const { return newArrayId_p; }
505inline Bool MSIter::newField() const { return newFieldId_p; }
507inline size_t MSIter::msId() const { return curMS_p; }
508inline size_t MSIter::numMS() const { return nMS_p; }
509inline const ScalarColumn<Int>& MSIter::colArrayIds() const { return colArray_p; }
510inline const ScalarColumn<Int>& MSIter::colFieldIds() const { return colField_p; }
512 if (curDataDescIdFirst_p == -1) {
515 }
516 return colDataDesc_p;
517}
518inline Int MSIter::arrayId() const { return curArrayIdFirst_p; }
519inline Int MSIter::fieldId() const {
520 if (curFieldIdFirst_p == -1) setFieldInfo();
521 return curFieldIdFirst_p;
522}
531 if (curPolarizationIdFirst_p == -1) {
534 }
536}
538 if (curDataDescIdFirst_p == -1) {
541 }
543}
546inline Int MSIter::polFrame() const {
547 if (curPolarizationIdFirst_p == -1) {
550 }
551 return polFrame_p;
552}
556 return CJonesFeed0_p;
557}
560 return CJones_p;
561}
565}
568 return receptorAngles_p;
569}
570inline const Vector<String>& MSIter::antennaMounts() const { return antennaMounts_p; }
579
580} // namespace casacore
581
582#endif
abstract base class for comparing two objects
Definition Compare.h:61
Double getInterval() const
Definition MSIter.h:62
Double getOffset() const
Definition MSIter.h:60
void setInterval(Double interval)
Definition MSIter.h:63
virtual int comp(const void *obj1, const void *obj2) const
Compare two objects, and return.
virtual ~MSInterval()
Definition MSIter.h:58
virtual void setOffset(Double offset)
Definition MSIter.h:61
MSInterval(Double interval)
Definition MSIter.h:57
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:428
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:464
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:501
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:504
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:506
virtual ~MSIter()
Destructor.
Bool fieldInSort_p
Definition MSIter.h:428
MSIter * This
Definition MSIter.h:422
Bool newDataDescId_p
Definition MSIter.h:449
const MSColumns & msColumns() const
Return reference to the current MSColumns.
Definition MSIter.h:502
Int curFieldIdFirst_p
Definition MSIter.h:437
@ Linear
Linear polarization.
Definition MSIter.h:165
@ Circular
Circular polarization.
Definition MSIter.h:163
String curFieldNameFirst_p
Definition MSIter.h:435
Bool newPolarizationId_p
Definition MSIter.h:448
void cacheExtraDDInfo() const
Store extra info related to the DD.
ScalarColumn< Int > colArray_p
Definition MSIter.h:465
const Vector< String > & antennaMounts() const
Return a string mount identifier for each antenna.
Definition MSIter.h:570
Bool newSpectralWindowId_p
Definition MSIter.h:448
Int lastPolarizationId_p
Definition MSIter.h:447
Bool newFieldId_p
Definition MSIter.h:448
const Matrix< Double > & receptorAngle() const
Return the receptor angle for feed 0 on each antenna.
Definition MSIter.h:562
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:553
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:518
Matrix< Double > receptorAnglesFeed0_p
cache for access functions
Definition MSIter.h:470
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:503
Bool allBeamOffsetsZero_p
each element of the cube in radians) in the antenna coordinate system.
Definition MSIter.h:484
Bool newArrayId_p
Definition MSIter.h:448
ssize_t lastMS_p
Definition MSIter.h:431
Bool freqCacheOK_p
hence mutable.
Definition MSIter.h:489
Int curSourceIdFirst_p
Definition MSIter.h:434
ScalarColumn< Int > colField_p
Definition MSIter.h:464
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:544
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:499
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:453
std::shared_ptr< MSInterval > timeComp_p
Definition MSIter.h:495
Table table() const
Return the current Table iteration.
Definition MSIter.h:500
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:575
Int lastSpectralWindowId_p
Definition MSIter.h:447
const String & sourceName() const
Table curTable_p
Definition MSIter.h:433
void advance()
advance the iteration
Int lastDataDescId_p
These variables point to the IDs of the previous iteration.
Definition MSIter.h:447
void setInterval(Double timeInterval)
Set or reset the time interval to use for iteration.
bool spwDepFeed_p
Definition MSIter.h:450
PolFrame polFrame_p
are zero (to speed things up in a single beam case)
Definition MSIter.h:487
Vector< SquareMatrix< Complex, 2 > > CJonesFeed0_p
Definition MSIter.h:475
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:546
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:554
const ScalarColumn< Int > & colDataDescriptionIds() const
Return the current DataDescriptionIds for all rows in this iteration.
Definition MSIter.h:511
Bool timeInSort_p
This booleans determine if given columns are part of the sorting.
Definition MSIter.h:428
Bool storeSorted_p
Globally control disk storage of SORTED_TABLE.
Definition MSIter.h:456
MPosition telescopePosition_p
Definition MSIter.h:493
Bool newDataDescriptionId() const
Return True if DataDescriptionId has changed since last iteration Note that if MS_DATA_DESC_ID is not...
Definition MSIter.h:545
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:507
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:571
size_t numMS() const
Get the number of actual ms's associated wth this iterator.
Definition MSIter.h:508
Block< Bool > tabIterAtStart_p
Definition MSIter.h:425
Int curArrayIdFirst_p
Definition MSIter.h:434
Int spectralWindowId() const
Return SpectralWindow of the first element in this iteration.
Definition MSIter.h:523
Int curDataDescIdFirst_p
These variables point to the current (as in this iteration) DD, SPW and polarization IDs.
Definition MSIter.h:445
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:505
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
std::shared_ptr< MSColumns > msc_p
Definition MSIter.h:432
Block< TableIterator * > tabIter_p
Definition MSIter.h:424
MFrequency frequency0_p
Definition MSIter.h:491
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:478
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:558
virtual MSIter & operator++()
Int fieldId() const
Return the FieldId of the first element in this iteration.
Definition MSIter.h:519
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:445
MSIter * clone() const
Cube< RigidVector< Double, 2 > > beamOffsets_p
antenna (e.g.
Definition MSIter.h:480
void setFeedInfo() const
MFrequency restFrequency_p
Definition MSIter.h:492
virtual void setState()
set the iteration state
MDirection phaseCenter_p
Definition MSIter.h:467
Cube< Double > receptorAngles_p
temporary retained for compatibility contain actually a reference to the first plane of receptorAngle...
Definition MSIter.h:474
MSIter & operator=(const MSIter &other)
Assigment.
void setFieldInfo() const
Int curPolarizationIdFirst_p
Definition MSIter.h:445
MSIter(const MSIter &other)
Copy construct.
Block< MeasurementSet > bms_p
Definition MSIter.h:423
Matrix< SquareMatrix< Complex, 2 > > CJones_p
similar to receptorAngle_p
Definition MSIter.h:477
const Cube< Double > & receptorAngles() const
Return the receptor angles for all feeds and antennae First axis is a receptor number,...
Definition MSIter.h:566
Double prevFirstTimeStamp_p
Definition MSIter.h:468
Vector< Double > frequency_p
Definition MSIter.h:490
String curSourceNameFirst_p
Definition MSIter.h:436
const ScalarColumn< Int > & colFieldIds() const
Return the current FieldIds for all rows in this iteration.
Definition MSIter.h:510
Int dataDescriptionId() const
Return DataDescriptionId of the first element in this iteration.
Definition MSIter.h:537
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:509
size_t curMS_p
Definition MSIter.h:430
const Vector< Double > & frequency() const
Return the frequencies corresponding to the DATA matrix.
Double interval_p
time selection
Definition MSIter.h:459
String: the storage and methods of handling collections of characters.
Definition String.h:355
For temporary backward namespace compatibility, use casa as alias for casacore.
Definition mainpage.dox:28
int offset(int, int) const
compute a linear offset from array indicies
MeasurementSet MS
MeasurementSet is too cumbersome for a number of common uses, so we give a typedef here.
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