casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
VisibilityIteratorImplAsync2.h
Go to the documentation of this file.
1 //# VisibilityIterator.h: Step through the MeasurementEquation by visibility
2 //# Copyright (C) 1996,1997,1998,1999,2000,2001,2002,2003
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: aips2-request@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 //# $Id: VisibilityIterator2.h,v 19.14 2006/02/28 04:48:58 mvoronko Exp $
27 
28 #ifndef MSVIS_VISIBILITYITERATORIMPLASYNC2_H
29 #define MSVIS_VISIBILITYITERATORIMPLASYNC2_H
30 
31 #include <casa/Arrays/Cube.h>
32 #include <casa/Arrays/Matrix.h>
33 #include <casa/Arrays/Slicer.h>
34 #include <casa/BasicSL/String.h>
35 #include <casa/Quanta/MVDoppler.h>
36 #include <casa/aips.h>
54 
55 #include <map>
56 #include <vector>
57 
58 namespace casa { //# NAMESPACE CASA - BEGIN
59 
60 namespace vi {
61 
62 //# forward decl
63 
64 class AsynchronousInterface;
65 class VisBuffer2;
66 class VisBufferAsyncWrapper2;
67 class VlaData;
68 
69 // <summary>
70 // VisibilityIterator2 iterates through one or more readonly MeasurementSets
71 // </summary>
72 
73 // <use visibility=export>
74 
75 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
76 // </reviewed>
77 
78 // <prerequisite>
79 // <li> <linkto class="MSIter">MSIter</linkto>
80 // <li> <linkto class="casacore::MeasurementSet">casacore::MeasurementSet</linkto>
81 // <li> <linkto class="VisSet">VisSet</linkto>
82 // </prerequisite>
83 //
84 // <etymology>
85 // The VisibilityIterator2 is a readonly iterator returning visibilities
86 // </etymology>
87 //
88 // <synopsis>
89 // VisibilityIterator2 provides iteration with various sort orders
90 // for one or more MSs. It has member functions to retrieve the fields
91 // commonly needed in synthesis calibration and imaging.
92 //
93 // One should use <linkto class="VisBuffer">VisBuffer</linkto>
94 // to access chunks of data.
95 // </synopsis>
96 //
97 // <example>
98 // <code>
99 // //
100 // </code>
101 // </example>
102 //
103 // <motivation>
104 // For imaging and calibration you need to access an casacore::MS in some consistent
105 // order (by field, spectralwindow, time interval etc.). This class provides
106 // that access.
107 // </motivation>
108 //
109 // <thrown>
110 // <li>
111 // <li>
112 // </thrown>
113 //
114 // <todo asof="1997/05/30">
115 // <li> cleanup the currently dual interface for visibilities and flags
116 // <li> sort out what to do with weights when interpolating
117 // </todo>
118 
120 
121  friend class AsyncEnabler;
122  friend class ViImplAsync2;
123  friend class VisibilityIterator2;
124  friend class VLAT; // allow VI lookahead thread class to access protected functions
125  // VLAT should not access private parts, especially variables
126 
127 public:
128 
129  //# the following is a copy of the enum in MSIter
130  //# can't think of a way to get one that known to the outside world from here
131  // enum PolFrame {
132  // // Circular polarization
133  // Circular=0,
134  // // Linear polarization
135  // Linear=1
136  // };
137  //
138  // enum DataColumn {
139  // // Observed data
140  // Observed=0,
141  // // Model data
142  // Model,
143  // // Corrected data
144  // Corrected
145  // };
146 
147  // class AsyncEnabler {
148  // public:
149  // AsyncEnabler (VisibilityIterator2 &);
150  // AsyncEnabler (VisibilityIterator2 *);
151  // ~AsyncEnabler ();
152  //
153  // void release ();
154  //
155  // private:
156  //
157  // casacore::Bool oldEnabledState_p;
158  // VisibilityIterator2 * roVisibilityIterator2_p;
159  // };
160 
161  // Default constructor - useful only to assign another iterator later
163 
164  // Construct from an casacore::MS and a casacore::Block of casacore::MS column enums specifying the
165  // iteration order. If no order is specified, it uses the default sort
166  // order of MSIter, which is not necessarily the raw order of ms!
167  // The default ordering is ARRAY_ID, FIELD_ID, DATA_DESC_ID,
168  // and TIME, but check MSIter.h to be sure.
169  // These columns will be added first if they are not specified.
170  //
171  // An optional timeInterval (in seconds) can be given to iterate through
172  // chunks of time. The default interval of 0 groups all times together.
173  // Every 'chunk' of data contains all data within a certain time interval and
174  // with identical values of the other iteration columns (e.g. DATA_DESC_ID
175  // and FIELD_ID). Using selectChannel (), a number of groups of channels can
176  // be requested. At present the channel group iteration will always occur
177  // before the interval iteration.
178 // VisibilityIteratorImplAsync (const casacore::MeasurementSet & ms,
179 // const casacore::Block<casacore::Int> & sortColumns,
180 // casacore::Double timeInterval = 0);
181 
182  // Same as above, but with the option of using the raw order of ms
183  // (addDefaultSortCols=false).
184 // VisibilityIteratorImplAsync (const casacore::MeasurementSet & ms,
185 // const casacore::Block<casacore::Int> & sortColumns, const casacore::Bool addDefaultSortCols,
186 // casacore::Double timeInterval = 0);
187 
188  // Same as previous constructors, but with multiple MSs to iterate over.
189 // VisibilityIteratorImplAsync (const casacore::Block<casacore::MeasurementSet> & mss,
190 // const casacore::Block<casacore::Int> & sortColumns,
191 // casacore::Double timeInterval = 0);
192 
195  const casacore::Block<casacore::Int> & sortColumns,
196  casacore::Bool addDefaultSortCols,
198  casacore::Bool createVb,
200 
201  // Copy construct. This calls the assigment operator.
203  VisibilityIterator2 * rovi);
204 
205  // Destructor
207 
208  // Members
209 
210  // Reset iterator to origin/start of data (of current chunk)
211  virtual void origin ();
212  // Reset iterator to true start of data (first chunk)
213  virtual void originChunks ();
214 
215  // Return the time interval (in seconds) used for iteration.
216  // This is not the same as the INTERVAL column.
217 
218  // Set or reset the time interval (in seconds) to use for iteration.
219  // You should call originChunks () to reset the iteration after
220  // calling this.
221 
223 
224  // Set the 'blocking' size for returning data.
225  // With the default (0) only a single integration is returned at a time, this
226  // is what is currently required for the calibration software. With blocking
227  // set, up to nRows can be returned in one go. The chunk
228  // size determines the actual maximum.
229 
230  virtual void setRowBlocking (casacore::Int nRows = 0);
231 
233 
234  // Return false if no more data (in current chunk)
235 
236  virtual casacore::Bool more () const;
237 
238  virtual Subchunk getSubchunkId () const;
239 
240  virtual void setFrequencySelections (const FrequencySelections & selection);
241 
242  // Return false if no more 'Chunks' of data left
243 
244  virtual casacore::Bool moreChunks () const;
245 
246  // Check if ms has change since last iteration
247 
248  virtual casacore::Bool isNewArrayId () const;
249  virtual casacore::Bool isNewFieldId () const;
250  virtual casacore::Bool isNewMs () const;
251  virtual casacore::Bool isNewSpectralWindow () const;
252 
253  virtual casacore::Int msId () const;
254 
255  //reference to actual ms in interator
256  virtual const casacore::MeasurementSet & ms () const;
257 
258  // Advance to the next Chunk of data
259  virtual void nextChunk ();
260 
261  // Return antenna1
262  virtual void antenna1 (casacore::Vector<casacore::Int> & ant1) const;
263 
264  // Return antenna2
265  virtual void antenna2 (casacore::Vector<casacore::Int> & ant2) const;
266 
267  // Return feed1
268  virtual void feed1 (casacore::Vector<casacore::Int> & fd1) const;
269 
270  // Return feed2
271  virtual void feed2 (casacore::Vector<casacore::Int> & fd2) const;
272 
273 
274  // Return feed configuration matrix for specified antenna
276 
277  // Return receptor angles for all antennae and feeds
278  // First axis of the cube is a receptor number,
279  // 2nd is antennaId, 3rd is feedId
280  // Note: the method is intended to provide an access to MSIter::receptorAngles
281  // for VisBuffer in the multi-feed case. It may be worth to change the
282  // interface of feed_pa to return the information for all feeds.
283  virtual const casacore::Cube<casacore::Double> & receptorAngles () const;
284 
285  // return a string mount identifier for each antenna
286  virtual const casacore::Vector<casacore::String> & antennaMounts () const;
287 
288  // Return a cube containing pairs of coordinate offsets for each
289  // receptor of each feed (values are in radians, coordinate system is fixed
290  // with antenna and is the same one as used to define the BEAM_OFFSET
291  // parameter in the feed table). The cube axes are receptor, antenna, feed.
293 
294  // Return the current FieldId
295 
296  virtual casacore::Int fieldId () const;
297 
298  // Return the current ArrayId
299  virtual casacore::Int arrayId () const;
300 
301  // Return flag for each polarization, channel and row
302  virtual void flag (casacore::Cube<casacore::Bool> & flags) const;
303 
304  // Return flag for each channel & row
305  virtual void flag (casacore::Matrix<casacore::Bool> & flags) const;
306 
307  // Determine whether FLAG_CATEGORY is valid.
309 
310  // Return flags for each polarization, channel, category, and row.
311  virtual void flagCategory (casacore::Array<casacore::Bool> & flagCategories) const;
312 
313  // Return row flag
314  virtual void flagRow (casacore::Vector<casacore::Bool> & rowflags) const;
315 
316  // Return scan number
317  virtual void scan (casacore::Vector<casacore::Int> & scans) const;
318 
319  // Return the OBSERVATION_IDs
320  virtual void observationId (casacore::Vector<casacore::Int> & obsids) const;
321 
322  // Return the PROCESSOR_IDs
323  virtual void processorId (casacore::Vector<casacore::Int> & procids) const;
324 
325  // Return the STATE_IDs
326  virtual void stateId (casacore::Vector<casacore::Int> & stateids) const;
327 
328  // Return the current phase center as an MDirection
329  virtual const casacore::MDirection & phaseCenter () const;
330 
331  // Return frame for polarization (returns PolFrame enum)
332  virtual casacore::Int polFrame () const;
333 
334  // Return the correlation type (returns casacore::Stokes enums)
335  virtual void corrType (casacore::Vector<casacore::Int> & corrTypes) const;
336 
337  // Return sigma
338  virtual void sigma (casacore::Vector<casacore::Float> & sig) const;
339 
340  // Return sigma matrix (pol-dep)
341  virtual void sigmaMat (casacore::Matrix<casacore::Float> & sigmat) const;
342 
343  // Return current SpectralWindow
344  virtual casacore::Int spectralWindow () const;
345 
346  // Return current Polarization Id
347  virtual casacore::Int polarizationId () const;
348 
349  // Return current DataDescription Id
350  virtual casacore::Int dataDescriptionId () const;
351 
352  // Return MJD midpoint of interval.
353  virtual void time (casacore::Vector<casacore::Double> & t) const;
354 
355  // Return MJD centroid of interval.
356  virtual void timeCentroid (casacore::Vector<casacore::Double> & t) const;
357 
358  // Return nominal time interval
359  virtual void timeInterval (casacore::Vector<casacore::Double> & ti) const;
360 
361  // Return actual time interval
362  virtual void exposure (casacore::Vector<casacore::Double> & expo) const;
363 
364  // Return the visibilities as found in the casacore::MS, casacore::Cube (npol,nchan,nrow).
365  virtual void visibilityCorrected (casacore::Cube<casacore::Complex> & vis) const;
366  virtual void visibilityModel (casacore::Cube<casacore::Complex> & vis) const;
367  virtual void visibilityObserved (casacore::Cube<casacore::Complex> & vis) const;
368 
369  // Return FLOAT_DATA as a casacore::Cube (npol, nchan, nrow) if found in the MS.
370  virtual void floatData (casacore::Cube<casacore::Float> & fcube) const;
371 
372  // Return the visibility 4-vector of polarizations for each channel.
373  // If the casacore::MS doesn't contain all polarizations, it is assumed it
374  // contains one or two parallel hand polarizations.
375  virtual void visibilityCorrected (casacore::Matrix<CStokesVector> & vis) const;
376  virtual void visibilityModel (casacore::Matrix<CStokesVector> & vis) const;
377  virtual void visibilityObserved (casacore::Matrix<CStokesVector> & vis) const;
378 
379  // Return the shape of the visibility Cube
380  virtual casacore::IPosition visibilityShape () const;
381 
382  // Return u,v and w (in meters)
383 
384  virtual void uvw (casacore::Matrix<casacore::Double> & uvwmat) const;
385 
386  // Return weight
387  virtual void weight (casacore::Vector<casacore::Float> & wt) const;
388 
389  // Returns the nPol_p x curNumRow_p weight matrix
390  virtual void weightMat (casacore::Matrix<casacore::Float> & wtmat) const;
391 
392  // Determine whether WEIGHT_SPECTRUM exists.
394 
395  // Return weightspectrum (a weight for each channel)
396  virtual void weightSpectrum (casacore::Cube<casacore::Float> & wtsp) const;
397 
398  // Return imaging weight (a weight for each channel)
399  //virtual casacore::Matrix<casacore::Float> & imagingWeight (casacore::Matrix<casacore::Float> & wt) const;
401 
402  // Return true if FieldId/Source has changed since last iteration
403  virtual casacore::Bool newFieldId () const;
404 
405  // Return true if arrayID has changed since last iteration
406  virtual casacore::Bool newArrayId () const;
407 
408  // Return true if SpectralWindow has changed since last iteration
409  virtual casacore::Bool newSpectralWindow () const;
410 
411  // Return the number of correlations in the current iteration
412 
413  virtual casacore::Int nPolarizations () const;
414 
415  // Return the number of rows in the current iteration
416  virtual casacore::Int nRows () const;
417 
418  // Return the row ids as from the original root table. This is useful
419  // to find correspondance between a given row in this iteration to the
420  // original ms row
421  virtual void getRowIds (casacore::Vector<casacore::uInt> & rowids) const;
422 
423  // Return the numbers of rows in the current chunk
424 
425  virtual casacore::Int nRowsInChunk () const;
426 
427  // Return the number of sub-intervals in the current chunk
428 
429  //virtual casacore::Int nSubInterval () const;
430 
431  // Call to use the slurp i/o method for all scalar columns. This
432  // will set the casacore::BucketCache cache size to the full column length
433  // and cause the full column to be cached in memory, if
434  // any value of the column is used. In case of out-of-memory,
435  // it will automatically fall-back on the smaller cache size.
436  // Slurping the column is to be considered as a work-around for the
437  // casacore::Table i/o code, which uses casacore::BucketCache and performs extremely bad
438  // for random access. Slurping is useful when iterating non-sequentially
439  // an casacore::MS or parts of an casacore::MS, it is not tested with multiple MSs.
440  virtual void slurp () const;
441 
442  // Get the spw, start and nchan for all the ms's is this Visiter that
443  // match the frequecy "freqstart-freqStep" and "freqEnd+freqStep" range
444  // Can help in doing channel selection above..
445  // freqFrame is the frame the caller frequency values are in (freqStart and freqEnd)
446  // These will be converted to the frame of the selected spw to match
447 
448 // virtual void getSpwInFreqRange (casacore::Block<casacore::Vector<casacore::Int> > & spw,
449 // casacore::Block<casacore::Vector<casacore::Int> > & start,
450 // casacore::Block<casacore::Vector<casacore::Int> > & nchan,
451 // casacore::Double freqStart, casacore::Double freqEnd,
452 // casacore::Double freqStep, casacore::MFrequency::Types freqFrame = casacore::MFrequency::LSRK) const;
453 
454  // Get the range of frequency convered by the selected data in the frame requested
455 
456 // virtual void getFreqInSpwRange(casacore::Double& freqStart, casacore::Double& freqEnd, casacore::MFrequency::Types freqframe = casacore::MFrequency::LSRK) const;
457 
458  // Access the current casacore::ROMSColumns object in MSIter
459  virtual const vi::SubtableColumns & subtableColumns () const;
460 
461  // get back the selected spectral windows and spectral channels for
462  // current ms
463 
464  virtual const SpectralWindowChannels & getSpectralWindowChannels (casacore::Int msId, casacore::Int spectralWindowId) const;
465 
466  //assign a VisImagingWeight object to this iterator
467  virtual void useImagingWeight (const VisImagingWeight & imWgt);
468  //return number of Ant
469  virtual casacore::Int numberAnt ();
470  //Return number of rows in all selected ms's
471  virtual casacore::Int numberCoh ();
472 
473  // Return number of spws, polids, ddids
474  virtual casacore::Int numberSpw ();
475  virtual casacore::Int numberPol ();
476  virtual casacore::Int numberDDId ();
477 
481  casacore::Int getNAntennas () const;
482  virtual casacore::MEpoch getEpoch () const;
486 
487  // Write/modify the flags in the data.
488  // This will flag all channels in the original data that contributed to
489  // the output channel in the case of channel averaging.
490  // All polarizations have the same flag value.
491  virtual void writeFlag (const casacore::Matrix<casacore::Bool> & flag);
492 
493  // Write/modify the flags in the data.
494  // This writes the flags as found in the casacore::MS, casacore::Cube (npol,nchan,nrow),
495  // where nrow is the number of rows in the current iteration (given by
496  // nRow ()).
497  virtual void writeFlag (const casacore::Cube<casacore::Bool> & flag);
498 
499  // Write/modify the flag row column; dimension casacore::Vector (nrow)
500  virtual void writeFlagRow (const casacore::Vector<casacore::Bool> & rowflags);
501 
503 
504  // Write/modify the visibilities.
505  // This is possibly only for a 'reference' casacore::MS which has a new DATA column.
506  // The first axis of the matrix should equal the selected number of channels
507  // in the original MS.
508  // If the casacore::MS does not contain all polarizations, only the parallel
509  // hand polarizations are used.
510  void writeVisCorrected (const casacore::Matrix<CStokesVector> & visibilityStokes);
511  void writeVisModel (const casacore::Matrix<CStokesVector> & visibilityStokes);
512  void writeVisObserved (const casacore::Matrix<CStokesVector> & visibilityStokes);
513 
514  // Write/modify the visibilities
515  // This writes the data as found in the casacore::MS, casacore::Cube (npol,nchan,nrow).
516  virtual void writeVisCorrected (const casacore::Cube<casacore::Complex> & vis);
517  virtual void writeVisModel (const casacore::Cube<casacore::Complex> & vis);
518  virtual void writeVisObserved (const casacore::Cube<casacore::Complex> & vis);
519 
520  // Write/modify the weights
521  virtual void writeWeight (const casacore::Vector<casacore::Float> & wt);
522 
523  // Write/modify the weightMat
524  virtual void writeWeightMat (const casacore::Matrix<casacore::Float> & wtmat);
525 
526  // Write/modify the weightSpectrum
527  virtual void writeWeightSpectrum (const casacore::Cube<casacore::Float> & wtsp);
528 
529  // Write/modify the Sigma
530  virtual void writeSigma (const casacore::Vector<casacore::Float> & sig);
531 
532  // Write/modify the ncorr x nrow SigmaMat.
533  virtual void writeSigmaMat (const casacore::Matrix<casacore::Float> & sigmat);
534 
535  virtual void writeBackChanges (VisBuffer2 *);
536 
537 protected:
538 
539  void attachColumnsSafe (const casacore::Table & t);
540 
541  // attach the column objects to the currently selected table
542 
543  virtual void attachColumns (const casacore::Table & t);
544 
545  // returns the table, to which columns are attached,
546  // can be overridden in derived classes
547 
548  virtual const casacore::Table attachTable () const;
549 
550  // advance the iteration
551 
552  virtual void advance ();
553 
554  virtual void applyPendingChanges ();
555 
556  // set the iteration state
557 
558  virtual void configureNewChunk ();
559 
560  // set the currently selected table
561 
562  virtual void configureNewSubchunk ();
563 
564  const ChannelSelector *
566 
567  virtual const ChannelSelector * determineChannelSelection (casacore::Double time);
568 
570  const SpectralWindowChannels & spectralWindowChannels);
571 
572  void fillVisBuffer ();
573 
574  // Methods to get the data out of a table column according to whatever selection
575  // criteria (e.g., slicing) is in effect.
576 
577  template <typename T>
578  void getColumnRows (const casacore::ArrayColumn<T> & column, casacore::Array<T> & array) const;
579 
580  template <typename T>
581  void
583 
584  template <typename T>
585  void getColumnRows (const casacore::ScalarColumn<T> & column, casacore::Vector<T> & array) const;
586 
589 
591 
592  // Returns the casacore::MS objects that this VI is iterating over.
593 
594  std::vector<casacore::MeasurementSet> getMeasurementSets () const;
595 
596  // Provides access to the casacore::MS-derived values object
597 
598  const casacore::MSDerivedValues & getMsd () const; // for use by Async I/O *ONLY*
599 
600  const MsIterInfo & getMsIterInfo () const;
601 
602  // Get privileged (non-const) access to the containing ROVI
603 
605  VisBufferAsyncWrapper2 * getVisBufferWrapper () const;
606 
607  VisibilityIterator2 * getViP () const;
608 
610  const casacore::ArrayColumn<casacore::Complex> & column) const;
611 
612  // Ctor auxiliary method
613 
614  virtual void initialize (const casacore::Block<casacore::MeasurementSet> & mss);
615 
616  // Returns true if casacore::MS Iterator is currently pointing to a selected
617  // spectral window
618 
620 
621  // Creates a channel selection for the current subchunk based on the channel
622  // or frequency selection made by the user.
623 
624  ChannelSelector *
625  makeChannelSelectorC (const FrequencySelection & selection,
627 
628  ChannelSelector *
629  makeChannelSelectorF (const FrequencySelection & selection,
631 
633  casacore::Bool toObservedFrame) const;
634 
635 
636  // Method to reset the VI back to the start. Unlike the public version
637  // there is a parameter to allow forcing the rewind even if the
638  // casacore::MS Iter is already at the origin.
639 
640  virtual void originChunks (casacore::Bool forceRewind);
641 
642  // Advances the casacore::MS Iterator until it points at a spectral window
643  // that is part of the frequency selection.
644 
646 
647  void readComplete ();
648 
649  // Sets the default frequency reporting frame of reference. This
650  // affects the default frame for obtaining the frequencies in a
651  // VisBuffer.
652 
654 
655  // Adjusts the tile cache for some columns so that the cache size is
656  // optimized for the current input state (e.g., a new data description).
657 
658  virtual void setTileCache ();
659 
660  // Throws exception if there is a pending (i.e., unapplied) change to
661  // the VI's properties. Called when the VI is advanced since the user
662  // probably forgot to apply the changes.
663 
664  virtual void throwIfPendingChanges ();
665 
666 
667  // Returns true if the named column uses a tiled data manager in the specified MS
668 
670 
671 private:
672 
675 
676 };
677 
678 } // end namespace vi
679 
680 } //# NAMESPACE CASA - END
681 
682 #endif
683 
A Vector of integers, for indexing into Array&lt;T&gt; objects.
Definition: IPosition.h:119
virtual void setRowBlocking(casacore::Int nRows=0)
Set the &#39;blocking&#39; size for returning data.
A Measure: astronomical direction.
Definition: MDirection.h:174
A Measure: position on Earth.
Definition: MPosition.h:79
casacore::MFrequency::Types getObservatoryFrequencyType() const
int Int
Definition: aipstype.h:50
virtual casacore::Bool newFieldId() const
Return true if FieldId/Source has changed since last iteration.
MSDerivedValues calculates values derived from a MS.
virtual const casacore::MeasurementSet & ms() const
reference to actual ms in interator
virtual casacore::Int numberDDId()
virtual casacore::Int numberPol()
virtual void feed1(casacore::Vector< casacore::Int > &fd1) const
Return feed1.
virtual const vi::SubtableColumns & subtableColumns() const
Get the spw, start and nchan for all the ms&#39;s is this Visiter that match the frequecy &quot;freqstart-freq...
virtual casacore::MEpoch getEpoch() const
virtual casacore::Vector&lt;casacore::MPosition&gt; antennaPositions () const; casacore::MSDerivedValues m...
virtual void slurp() const
Return the number of sub-intervals in the current chunk.
casacore::Slice findChannelsInRange(casacore::Double lowerFrequency, casacore::Double upperFrequency, const SpectralWindowChannels &spectralWindowChannels)
virtual void visibilityCorrected(casacore::Cube< casacore::Complex > &vis) const
Return the visibilities as found in the casacore::MS, casacore::Cube (npol,nchan,nrow).
virtual void scan(casacore::Vector< casacore::Int > &scans) const
Return scan number.
const ChannelSelector * createDefaultChannelSelector(casacore::Double time, casacore::Int msId, casacore::Int spectralWindowId)
Object to hold type of imaging weight scheme to be used on the fly and to provide facilities to do th...
void positionMsIterToASelectedSpectralWindow()
Advances the casacore::MS Iterator until it points at a spectral window that is part of the frequency...
Main interface class to a read/write table.
Definition: Table.h:153
VisibilityIterator2 iterates through one or more readonly MeasurementSets.
casacore::Bool existsWeightSpectrum() const
Determine whether WEIGHT_SPECTRUM exists.
casacore::Int getNAntennas() const
ChannelSelector * makeChannelSelectorF(const FrequencySelection &selection, casacore::Double time, casacore::Int msId, casacore::Int spectralWindowId)
virtual casacore::Int nRows() const
Return the number of rows in the current iteration.
TableExprNode array(const TableExprNode &values, const TableExprNodeSet &shape)
Create an array of the given shape and fill it with the values.
Definition: ExprNode.h:1886
virtual void stateId(casacore::Vector< casacore::Int > &stateids) const
Return the STATE_IDs.
virtual void setInterval(casacore::Double timeInterval)
Return the time interval (in seconds) used for iteration.
virtual void observationId(casacore::Vector< casacore::Int > &obsids) const
Return the OBSERVATION_IDs.
std::vector< casacore::MeasurementSet > getMeasurementSets() const
Returns the casacore::MS objects that this VI is iterating over.
VisibilityIteratorImplAsync2(VisibilityIterator2 *rovi, const casacore::Block< casacore::MeasurementSet > &mss, const casacore::Block< casacore::Int > &sortColumns, casacore::Bool addDefaultSortCols, casacore::Double timeInterval, casacore::Bool createVb, casacore::Bool isWritable)
VLAT should not access private parts, especially variables.
virtual casacore::Int numberSpw()
Return number of spws, polids, ddids.
virtual casacore::Bool isNewArrayId() const
Check if ms has change since last iteration.
virtual casacore::Bool moreChunks() const
Return false if no more &#39;Chunks&#39; of data left.
void jonesC(casacore::Vector< casacore::SquareMatrix< casacore::Complex, 2 > > &cjones) const
Return feed configuration matrix for specified antenna.
virtual void writeFlag(const casacore::Matrix< casacore::Bool > &flag)
Write/modify the flags in the data.
virtual casacore::Bool more() const
Return false if no more data (in current chunk)
casacore::Vector< casacore::Double > getFrequencies(casacore::Double time, casacore::Int frameOfReference) const
virtual const casacore::Vector< casacore::String > & antennaMounts() const
return a string mount identifier for each antenna
void setReportingFrameOfReference(casacore::Int)
Sets the default frequency reporting frame of reference.
virtual casacore::Int polarizationId() const
Return current Polarization Id.
virtual void sigma(casacore::Vector< casacore::Float > &sig) const
Return sigma.
virtual void weightSpectrum(casacore::Cube< casacore::Float > &wtsp) const
Return weightspectrum (a weight for each channel)
virtual casacore::Int spectralWindow() const
Return current SpectralWindow.
void attachColumnsSafe(const casacore::Table &t)
virtual casacore::Int polFrame() const
Return frame for polarization (returns PolFrame enum)
virtual void flagRow(casacore::Vector< casacore::Bool > &rowflags) const
Return row flag.
A Measure: instant in time.
Definition: MEpoch.h:104
virtual void throwIfPendingChanges()
Throws exception if there is a pending (i.e., unapplied) change to the VI&#39;s properties.
virtual casacore::Bool existsColumn(VisBufferComponent2 id) const
void getVisibilityAsStokes(casacore::Matrix< CStokesVector > &visibilityStokes, const casacore::ArrayColumn< casacore::Complex > &column) const
virtual const casacore::Cube< casacore::RigidVector< casacore::Double, 2 > > & getBeamOffsets() const
Return a cube containing pairs of coordinate offsets for each receptor of each feed (values are in ra...
virtual void setTileCache()
Adjusts the tile cache for some columns so that the cache size is optimized for the current input sta...
virtual void antenna2(casacore::Vector< casacore::Int > &ant2) const
Return antenna2.
void getColumnRowsMatrix(const casacore::ArrayColumn< T > &column, casacore::Matrix< T > &array) const
virtual void attachColumns(const casacore::Table &t)
attach the column objects to the currently selected table
virtual casacore::Bool isNewMs() const
virtual void flag(casacore::Cube< casacore::Bool > &flags) const
Return flag for each polarization, channel and row.
virtual const casacore::Table attachTable() const
returns the table, to which columns are attached, can be overridden in derived classes ...
const casacore::MeasurementSet & getMeasurementSet() const
virtual const casacore::MDirection & phaseCenter() const
Return the current phase center as an MDirection.
virtual void initialize(const casacore::Block< casacore::MeasurementSet > &mss)
Ctor auxiliary method.
virtual void feed2(casacore::Vector< casacore::Int > &fd2) const
Return feed2.
casacore::Vector< casacore::Float > getReceptor0Angle()
Fast Square Matrix class with fixed (templated) size.
VisibilityIterator2 iterates through one or more readonly MeasurementSets.
virtual void getRowIds(casacore::Vector< casacore::uInt > &rowids) const
Return the row ids as from the original root table.
virtual void configureNewChunk()
set the iteration state
define a (start,length,increment) along an axis
Definition: Slice.h:93
virtual void writeFlagRow(const casacore::Vector< casacore::Bool > &rowflags)
Write/modify the flag row column; dimension casacore::Vector (nrow)
casacore::MFrequency::Convert makeFrequencyConverter(casacore::Double time, casacore::Int otherFrameOfReference, casacore::Bool toObservedFrame) const
virtual casacore::Bool isWritable() const override
double Double
Definition: aipstype.h:55
virtual void sigmaMat(casacore::Matrix< casacore::Float > &sigmat) const
Return sigma matrix (pol-dep)
virtual casacore::Int fieldId() const
Return the current FieldId.
virtual void uvw(casacore::Matrix< casacore::Double > &uvwmat) const
Return u,v and w (in meters)
void writeVisObserved(const casacore::Matrix< CStokesVector > &visibilityStokes)
void writeVisModel(const casacore::Matrix< CStokesVector > &visibilityStokes)
VisBufferImplAsync2 * getVisBufferAsync() const
Get privileged (non-const) access to the containing ROVI.
virtual casacore::Int numberCoh()
Return number of rows in all selected ms&#39;s.
virtual casacore::Int msId() const
reference to actual ms in interator
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
virtual void processorId(casacore::Vector< casacore::Int > &procids) const
Return the PROCESSOR_IDs.
VisBufferAsyncWrapper2 * getVisBufferWrapper() const
Read and write access to an array table column with arbitrary data type.
Definition: Reweighter.h:48
virtual Subchunk getSubchunkId() const
virtual void writeSigma(const casacore::Vector< casacore::Float > &sig)
Write/modify the Sigma.
virtual ~VisibilityIteratorImplAsync2()
Destructor.
virtual casacore::Int nPolarizations() const
Return the number of correlations in the current iteration.
virtual void writeBackChanges(VisBuffer2 *)
+----------------—+ | | | Writeback Methods | | | +----------------—+
virtual const ChannelSelector * determineChannelSelection(casacore::Double time)
casacore::Bool isInASelectedSpectralWindow() const
Returns true if casacore::MS Iterator is currently pointing to a selected spectral window...
virtual void flagCategory(casacore::Array< casacore::Bool > &flagCategories) const
Return flags for each polarization, channel, category, and row.
virtual void writeWeight(const casacore::Vector< casacore::Float > &wt)
Write/modify the weights.
virtual void timeInterval(casacore::Vector< casacore::Double > &ti) const
Return nominal time interval.
casacore::Bool usesTiledDataManager(const casacore::String &columnName, const casacore::MeasurementSet &ms) const
Returns true if the named column uses a tiled data manager in the specified MS.
virtual const SpectralWindowChannels & getSpectralWindowChannels(casacore::Int msId, casacore::Int spectralWindowId) const
get back the selected spectral windows and spectral channels for current ms
const MsIterInfo & getMsIterInfo() const
virtual casacore::Int numberAnt()
return number of Ant
A Table intended to hold astronomical data (a set of Measurements).
virtual casacore::IPosition visibilityShape() const
Return the shape of the visibility Cube.
virtual void floatData(casacore::Cube< casacore::Float > &fcube) const
Return FLOAT_DATA as a casacore::Cube (npol, nchan, nrow) if found in the MS.
const casacore::MSDerivedValues & getMsd() const
Provides access to the casacore::MS-derived values object.
virtual void configureNewSubchunk()
set the currently selected table
void getColumnRows(const casacore::ArrayColumn< T > &column, casacore::Array< T > &array) const
Methods to get the data out of a table column according to whatever selection criteria (e...
void writeFlagCategory(const casacore::Array< casacore::Bool > &fc)
void writeVisCorrected(const casacore::Matrix< CStokesVector > &visibilityStokes)
Write/modify the visibilities.
virtual void writeSigmaMat(const casacore::Matrix< casacore::Float > &sigmat)
Write/modify the ncorr x nrow SigmaMat.
virtual void writeWeightSpectrum(const casacore::Cube< casacore::Float > &wtsp)
Write/modify the weightSpectrum.
virtual void antenna1(casacore::Vector< casacore::Int > &ant1) const
Return antenna1.
virtual void time(casacore::Vector< casacore::Double > &t) const
Return MJD midpoint of interval.
virtual casacore::Bool newSpectralWindow() const
Return true if SpectralWindow has changed since last iteration.
virtual void corrType(casacore::Vector< casacore::Int > &corrTypes) const
Return the correlation type (returns casacore::Stokes enums)
casacore::Int getReportingFrameOfReference() const
virtual void advance()
advance the iteration
virtual void exposure(casacore::Vector< casacore::Double > &expo) const
Return actual time interval.
casacore::MPosition getObservatoryPosition() const
VisBuffer2s encapsulate one chunk of visibility data for processing.
Definition: VisBuffer2.h:141
virtual casacore::Bool newArrayId() const
Return true if arrayID has changed since last iteration.
virtual casacore::Bool isNewSpectralWindow() const
virtual void originChunks()
Reset iterator to true start of data (first chunk)
virtual void writeWeightMat(const casacore::Matrix< casacore::Float > &wtmat)
Write/modify the weightMat.
virtual const casacore::Cube< casacore::Double > & receptorAngles() const
Return receptor angles for all antennae and feeds First axis of the cube is a receptor number...
const VisImagingWeight & getImagingWeightGenerator() const
Return imaging weight (a weight for each channel) virtual casacore::Matrix&lt;casacore::Float&gt; &amp; imagin...
String: the storage and methods of handling collections of characters.
Definition: String.h:223
virtual void weight(casacore::Vector< casacore::Float > &wt) const
Return weight.
virtual void useImagingWeight(const VisImagingWeight &imWgt)
assign a VisImagingWeight object to this iterator
casacore::Bool existsFlagCategory() const
Determine whether FLAG_CATEGORY is valid.
casacore::Int getMeasurementSetId() const
virtual casacore::Int arrayId() const
Return the current ArrayId.
casacore::Int getDataDescriptionId() const
Access to a scalar table column with arbitrary data type.
Definition: MSFitsOutput.h:41
Types
Types of known MFrequencies Warning: The order defines the order in the translation matrix FromTo in...
Definition: MFrequency.h:176
virtual casacore::Bool isNewFieldId() const
virtual void visibilityObserved(casacore::Cube< casacore::Complex > &vis) const
virtual void timeCentroid(casacore::Vector< casacore::Double > &t) const
Return MJD centroid of interval.
casacore::Vector< casacore::Int > getChannels(casacore::Double time, casacore::Int frameOfReference) const
virtual void nextChunk()
Advance to the next Chunk of data.
virtual void weightMat(casacore::Matrix< casacore::Float > &wtmat) const
Returns the nPol_p x curNumRow_p weight matrix.
virtual void visibilityModel(casacore::Cube< casacore::Complex > &vis) const
virtual void setFrequencySelections(const FrequencySelections &selection)
Select the channels to be returned.
virtual casacore::Int nRowsInChunk() const
Return the numbers of rows in the current chunk.
virtual casacore::Int dataDescriptionId() const
Return current DataDescription Id.
ChannelSelector * makeChannelSelectorC(const FrequencySelection &selection, casacore::Double time, casacore::Int msId, casacore::Int spectralWindowId)
Creates a channel selection for the current subchunk based on the channel or frequency selection made...
VisibilityIterator2 * getViP() const