casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ViImplementation2.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 #if ! defined (MSVIS_ViImplementation2_H_121115_0950)
29 #define MSVIS_ViImplementation2_H_121115_0950
30 
31 #include <casa/aips.h>
32 #include <casa/BasicSL.h>
37 
38 #include <map>
39 #include <vector>
40 
41 //Forward declarations
42 namespace casacore{
43 
44 template <typename T> class Array;
45 template <typename T> class Block;
46 template <typename T> class Cube;
47 template <typename T> class Matrix;
48 class MDirection;
49 class MeasurementSet;
50 class MEpoch;
51 class MPosition;
52 class MSDerivedValues;
53 class RecordInterface;
54 template <typename T, Int n> class RigidVector;
55 class Slice;
56 class String;
57 template <typename T, Int n> class SquareMatrix;
58 template <typename T> class Vector;
59 class ROMSAntennaColumns;
61 class ROMSFeedColumns;
62 class ROMSFieldColumns;
63 class ROMSFlagCmdColumns;
64 class ROMSHistoryColumns;
70 class ROMSStateColumns;
71 class ROMSDopplerColumns;
73 class ROMSSourceColumns;
74 class ROMSSysCalColumns;
75 class ROMSWeatherColumns;
76 }
77 
78 namespace casa { //# NAMESPACE CASA - BEGIN
79 
80 //class CStokesVector;
81 class VisImagingWeight;
82 
83 namespace vi {
84 
85 
86 //# forward decl
87 
88 class ChannelSelector;
89 class ChannelSelectorCache;
90 class FrequencySelections;
91 class SortColumns;
92 class SpectralWindowChannels;
93 class SpectralWindowChannelsCache;
94 class Subchunk;
95 class SubtableColumns;
96 class VisBuffer2;
97 class VisibilityIterator2;
98 class WeightScaling;
99 enum VisBufferType : int;
100 enum VisBufferOptions : int;
101 
102 // <summary>
103 // VisibilityIterator2 iterates through one or more readonly MeasurementSets
104 // </summary>
105 
106 // <use visibility=export>
107 
108 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
109 // </reviewed>
110 
111 // <prerequisite>
112 // <li> <linkto class="MSIter">MSIter</linkto>
113 // <li> <linkto class="casacore::MeasurementSet">casacore::MeasurementSet</linkto>
114 // <li> <linkto class="VisSet">VisSet</linkto>
115 // </prerequisite>
116 //
117 // <etymology>
118 // The VisibilityIterator2 is a readonly iterator returning visibilities
119 // </etymology>
120 //
121 // <synopsis>
122 // VisibilityIterator2 provides iteration with various sort orders
123 // for one or more MSs. It has member functions to retrieve the fields
124 // commonly needed in synthesis calibration and imaging.
125 //
126 // One should use <linkto class="VisBuffer">VisBuffer</linkto>
127 // to access chunks of data.
128 // </synopsis>
129 //
130 // <example>
131 // <code>
132 // //
133 // </code>
134 // </example>
135 //
136 // <motivation>
137 // For imaging and calibration you need to access an casacore::MS in some consistent
138 // order (by field, spectralwindow, time interval etc.). This class provides
139 // that access.
140 // </motivation>
141 //
142 // <thrown>
143 // <li>
144 // <li>
145 // </thrown>
146 //
147 // <todo asof="1997/05/30">
148 // <li> cleanup the currently dual interface for visibilities and flags
149 // <li> sort out what to do with weights when interpolating
150 // </todo>
151 
153 
154  friend class VisibilityIterator2;
155 
156 public:
157 
158  // make noncopyable...
159  ViImplementation2( const ViImplementation2& ) = delete;
160  ViImplementation2& operator=( const ViImplementation2& ) = delete;
162 
163  // Destructor
164 
165  virtual ~ViImplementation2 () {}
166 
167  // Report the the ViImplementation type
168  virtual casacore::String ViiType() const = 0;
169 
170  // +==================================+
171  // | |
172  // | Iteration Control and Monitoring |
173  // | |
174  // +==================================+
175 
176  // Methods to control and monitor subchunk iteration
177 
178  virtual void origin () = 0;
179  virtual casacore::Bool more () const = 0;
180  virtual void next () = 0;
181  virtual Subchunk getSubchunkId () const = 0;
182 
183  // Methods to control chunk iterator
184 
185  virtual void originChunks (casacore::Bool forceRewind = false) = 0;
186  virtual casacore::Bool moreChunks () const = 0;
187  virtual void nextChunk () = 0;
188 
189  // Report Name of slowest column that changes at end of current iteration
190  virtual casacore::String keyChange() const = 0;
191 
192  virtual casacore::Bool isWritable () const = 0;
193 
194  // Return the time interval (in seconds) used for iteration.
195  // This is not the same as the INTERVAL column. Setting the
196  // the interval requires calling origin chunks before performing
197  // further iterator.
198 
199  virtual casacore::Double getInterval() const = 0;
200  virtual void setInterval (casacore::Double timeInterval) = 0;
201 
202  // Select the channels to be returned. Requires calling originChunks before
203  // performing additional iteration.
204 
205  virtual void setFrequencySelections (const FrequencySelections & selection) = 0;
206 
207  // Set the 'blocking' size for returning data.
208  // With the default (0) only a single integration is returned at a time, this
209  // is what is currently required for the calibration software. With blocking
210  // set, up to nRows can be returned in one go. The chunk
211  // size determines the actual maximum.
212 
213  virtual void setRowBlocking (casacore::Int nRows = 0) = 0;
214 
215  virtual casacore::Bool existsColumn (VisBufferComponent2 id) const = 0;
216 
217  virtual const SortColumns & getSortColumns() const = 0;
218 
219  virtual casacore::Bool isNewArrayId () const = 0;
220  virtual casacore::Bool isNewFieldId () const = 0;
221  virtual casacore::Bool isNewMs () const = 0;
222  virtual casacore::Bool isNewSpectralWindow () const = 0;
223 
224  // Return the number of rows in the current iteration
225 
226  virtual casacore::Int nRows () const = 0;
227 
228  // Return the row ids as from the original root table. This is useful
229  // to find correspondance between a given row in this iteration to the
230  // original ms row
231 
232  virtual void getRowIds (casacore::Vector<casacore::uInt> & rowids) const = 0;
233 
234  virtual VisBuffer2 * getVisBuffer () const = 0;
235 
236 
237  // +=========================+
238  // | |
239  // | Subchunk Data Accessors |
240  // | |
241  // +=========================+
242 
243  // Return antenna1
244 
245  virtual void antenna1 (casacore::Vector<casacore::Int> & ant1) const = 0;
246 
247  // Return antenna2
248 
249  virtual void antenna2 (casacore::Vector<casacore::Int> & ant2) const = 0;
250 
251  // Return the correlation type (returns casacore::Stokes enums)
252 
253  virtual void corrType (casacore::Vector<casacore::Int> & corrTypes) const = 0;
254 
255  // Return current DataDescription Id
256 
257  virtual casacore::Int dataDescriptionId () const = 0;
258 
259  virtual void dataDescriptionIds (casacore::Vector<casacore::Int> & ddis) const = 0;
260 
261  // Return actual time interval
262 
263  virtual void exposure (casacore::Vector<casacore::Double> & expo) const = 0;
264 
265  // Return feed1
266 
267  virtual void feed1 (casacore::Vector<casacore::Int> & fd1) const = 0;
268 
269  // Return feed2
270 
271  virtual void feed2 (casacore::Vector<casacore::Int> & fd2) const = 0;
272 
273  // Return the current FieldId
274 
275  virtual void fieldIds (casacore::Vector<casacore::Int>&) const = 0;
276 
277  // Return the current ArrayId
278 
279  virtual void arrayIds (casacore::Vector<casacore::Int>&) const = 0;
280 
281  // Return the current Field Name
282 
283  virtual casacore::String fieldName () const = 0;
284 
285  // Return flag for each polarization, channel and row
286 
287  virtual void flag (casacore::Cube<casacore::Bool> & flags) const = 0;
288 
289  // Return flag for each channel & row
290 
291  virtual void flag (casacore::Matrix<casacore::Bool> & flags) const = 0;
292 
293  // Determine whether FLAG_CATEGORY is valid.
294 
295  virtual casacore::Bool flagCategoryExists () const = 0;
296 
297  // Return flags for each polarization, channel, category, and row.
298 
299  virtual void flagCategory (casacore::Array<casacore::Bool> & flagCategories) const = 0;
300 
301  // Return row flag
302 
303  virtual void flagRow (casacore::Vector<casacore::Bool> & rowflags) const = 0;
304 
305  // Return the OBSERVATION_IDs
306 
307  virtual void observationId (casacore::Vector<casacore::Int> & obsids) const = 0;
308 
309  // Return current Polarization Id
310 
311  virtual casacore::Int polarizationId () const = 0;
312 
313  // Return the PROCESSOR_IDs
314 
315  virtual void processorId (casacore::Vector<casacore::Int> & procids) const = 0;
316 
317  // Return scan number
318 
319  virtual void scan (casacore::Vector<casacore::Int> & scans) const = 0;
320 
321  // Return the current Source Name
322 
323  virtual casacore::String sourceName () const = 0;
324 
325  // Return the STATE_IDs
326 
327  virtual void stateId (casacore::Vector<casacore::Int> & stateids) const = 0;
328 
329 
330  // Return feed configuration matrix for specified antenna
331 
332  virtual void jonesC (casacore::Vector<casacore::SquareMatrix<casacore::Complex, 2> > & cjones) const = 0;
333 
334  // Return frame for polarization (returns PolFrame enum)
335 
336  virtual casacore::Int polFrame () const = 0;
337 
338  // Return sigma
339 
340  virtual void sigma (casacore::Matrix<casacore::Float> & sigmat) const = 0;
341 
342  // Return current SpectralWindow
343 
344  virtual casacore::Int spectralWindow () const = 0;
345 
346  virtual void spectralWindows (casacore::Vector<casacore::Int> & spws) const = 0;
347 
348  // Return MJD midpoint of interval.
349 
350  virtual void time (casacore::Vector<casacore::Double> & t) const = 0;
351 
352  // Return MJD centroid of interval.
353 
354  virtual void timeCentroid (casacore::Vector<casacore::Double> & t) const = 0;
355 
356  // Return nominal time interval
357 
358  virtual void timeInterval (casacore::Vector<casacore::Double> & ti) const = 0;
359 
360  // Return u,v and w (in meters)
361 
362  virtual void uvw (casacore::Matrix<casacore::Double> & uvwmat) const = 0;
363 
364  // Return the visibilities as found in the casacore::MS, casacore::Cube (npol,nchan,nrow).
365 
366  virtual void visibilityCorrected (casacore::Cube<casacore::Complex> & vis) const = 0;
367  virtual void visibilityModel (casacore::Cube<casacore::Complex> & vis) const = 0;
368  virtual void visibilityObserved (casacore::Cube<casacore::Complex> & vis) const = 0;
369 
370  // Return FLOAT_DATA as a casacore::Cube (npol, nchan, nrow) if found in the MS.
371 
372  virtual void floatData (casacore::Cube<casacore::Float> & fcube) const = 0;
373 
374  // Return the visibility 4-vector of polarizations for each channel.
375  // If the casacore::MS doesn't contain all polarizations, it is assumed it
376  // contains one or two parallel hand polarizations.
377 
378 // virtual void visibilityCorrected (casacore::Matrix<CStokesVector> & vis) const = 0;
379 // virtual void visibilityModel (casacore::Matrix<CStokesVector> & vis) const = 0;
380 // virtual void visibilityObserved (casacore::Matrix<CStokesVector> & vis) const = 0;
381 
382  // Return the shape of the visibility Cube
383 
384  virtual casacore::IPosition visibilityShape () const = 0;
385 
386  // Return weight
387 
388  virtual void weight (casacore::Matrix<casacore::Float> & wtmat) const = 0;
389 
390  // Determine whether WEIGHT_SPECTRUM exists.
391 
392  virtual casacore::Bool weightSpectrumExists () const = 0;
393 
394  // Determine whether SIGMA_SPECTRUM exists.
395 
396  virtual casacore::Bool sigmaSpectrumExists () const = 0;
397 
398  // Return weightspectrum (a weight for each channel)
399 
400  virtual void weightSpectrum (casacore::Cube<casacore::Float> & wtsp) const = 0;
401 
402  // Return sgimaspectrum (a sigma for each channel)
403 
404  virtual void sigmaSpectrum (casacore::Cube<casacore::Float> & wtsp) const = 0;
405 
406 
407  virtual void setWeightScaling (casacore::CountedPtr<WeightScaling> weightscaling) = 0;
408  virtual casacore::Bool hasWeightScaling () const = 0;
410 
411  // Return the number of sub-intervals in the current chunk
412 
413  // +------------------------+
414  // | |
415  // | Angular Data Providers |
416  // | |
417  // +------------------------+
418 
419  // true if all elements of the cube returned by getBeamOffsets are zero
420 
421  virtual casacore::Bool allBeamOffsetsZero () const = 0;
422 
423  // Return the antenna AZ/EL casacore::Vector (nant)
424 
425  virtual casacore::MDirection azel0 (casacore::Double time) const = 0;
427  casacore::MDirection & azel0, const casacore::MEpoch & mEpoch0);
428 
431  casacore::Int nAnt, const casacore::MEpoch & mEpoch0);
432 
433  // Return feed parallactic angles casacore::Vector (nant) (1 feed/ant)
434 
437  casacore::Int nAntennas, const casacore::MEpoch & mEpoch0,
438  const casacore::Vector<casacore::Float> & receptor0Angle);
439 
440  // Return a cube containing pairs of coordinate offsets for each
441  // receptor of each feed (values are in radians, coordinate system is fixed
442  // with antenna and is the same one as used to define the BEAM_OFFSET
443  // parameter in the feed table). The cube axes are receptor, antenna, feed.
444 
446 
447  virtual std::pair<bool, casacore::MDirection> getPointingAngle (int antenna, double time) const = 0;
448 
449  // Return the hour angle for the specified time
450 
451  virtual casacore::Double hourang (casacore::Double time) const = 0;
453 
454  // Return nominal parallactic angle at specified time
455  // (does not include feed position angle offset--see feed_pa)
456  // A global value for all antennas (e.g., small array)
457 
458  virtual const casacore::Float & parang0 (casacore::Double time) const = 0;
460 
461  // Per antenna:
462 
465  int nAntennas, const casacore::MEpoch mEpoch0);
466 
467  // Return the current phase center as an MDirection
468 
469  virtual const casacore::MDirection & phaseCenter () const = 0;
470 
471  // Return receptor angles for all antennae and feeds
472  // First axis of the cube is a receptor number,
473  // 2nd is antennaId, 3rd is feedId
474  // Note: the method is intended to provide an access to MSIter::receptorAngles
475  // for VisBuffer in the multi-feed case. It may be worth to change the
476  // interface of feed_pa to return the information for all feeds.
477 
478  virtual const casacore::Cube<casacore::Double> & receptorAngles () const = 0;
479 
480  // +=========================+
481  // | |
482  // | Chunk and MS Level Data |
483  // | |
484  // +=========================+
485 
486  // return a string mount identifier for each antenna
487 
488  virtual const casacore::Vector<casacore::String> & antennaMounts () const = 0;
489  // virtual casacore::Vector<casacore::MPosition> antennaPositions () const;
490  //casacore::MSDerivedValues makeMsd ();
491 
492  virtual casacore::MEpoch getEpoch () const = 0;
493 
494  // Return imaging weight (a weight for each channel)
495  //virtual casacore::Matrix<casacore::Float> & imagingWeight (casacore::Matrix<casacore::Float> & wt) const = 0;
496 
497  virtual const VisImagingWeight & getImagingWeightGenerator () const = 0;
498 
499  virtual casacore::MFrequency::Types getObservatoryFrequencyType () const = 0; //???
500  virtual casacore::MPosition getObservatoryPosition () const = 0;
502 
503  virtual casacore::Int getReportingFrameOfReference () const = 0;
504  virtual void setReportingFrameOfReference (casacore::Int frame) = 0;
505 
509 
510  virtual casacore::Vector<casacore::Int> getChannels (casacore::Double time, casacore::Int frameOfReference, casacore::Int spectralWndow = -1,
511  casacore::Int msId = -1) const = 0;
513  casacore::Int msId = -1) const = 0;
514 
515 
516  //reference to actual ms in interator
517 
518  virtual casacore::Int msId () const = 0; // zero-based index of current casacore::MS in set of MSs
519  virtual const casacore::MeasurementSet & ms () const = 0;
520  virtual casacore::Int getNMs () const = 0;
521 
522  // Name of current nominal MS
523  virtual casacore::String msName() const = 0;
524 
525  // Call to use the slurp i/o method for all scalar columns. This
526  // will set the casacore::BucketCache cache size to the full column length
527  // and cause the full column to be cached in memory, if
528  // any value of the column is used. In case of out-of-memory,
529  // it will automatically fall-back on the smaller cache size.
530  // Slurping the column is to be considered as a work-around for the
531  // casacore::Table i/o code, which uses casacore::BucketCache and performs extremely bad
532  // for random access. Slurping is useful when iterating non-sequentially
533  // an casacore::MS or parts of an casacore::MS, it is not tested with multiple MSs.
534 
535  virtual void slurp () const = 0;
536 
537  // Access the current casacore::ROMSColumns object in MSIter
538 
539  virtual const vi::SubtableColumns & subtableColumns () const = 0;
540 
541  // get back the selected spectral windows and spectral channels for
542  // current ms
543 
544  virtual const SpectralWindowChannels & getSpectralWindowChannels (casacore::Int msId, casacore::Int spectralWindowId) const = 0;
545 
546  //assign a VisImagingWeight object to this iterator
547 
548  virtual void useImagingWeight (const VisImagingWeight & imWgt) = 0;
549 
550  // Return number of antennasm spws, polids, ddids
551 
552  virtual casacore::Int nAntennas () const = 0;
553  virtual casacore::Int nDataDescriptionIds () const = 0;
554  virtual casacore::Int nPolarizationIds () const = 0;
555  virtual casacore::Int nRowsInChunk () const = 0; // number rows in current chunk
556  virtual casacore::Int nRowsViWillSweep () const = 0; // number of rows in all selected ms's
557  virtual casacore::Int nSpectralWindows () const = 0;
558 
559  // +-------------------+
560  // | |
561  // | Writeback Methods |
562  // | |
563  // +-------------------+
564 
565  // This method writes back any changed (dirty) components of the provided
566  // VisBuffer and is the preferred method for writing data out.
567 
568  virtual void writeBackChanges (VisBuffer2 * vb) = 0;
569 
570  // Write/modify the flags in the data.
571  // This will flag all channels in the original data that contributed to
572  // the output channel in the case of channel averaging.
573  // All polarizations have the same flag value.
574 // virtual void writeFlag (const casacore::Matrix<casacore::Bool> & flag) = 0;
575 
576  // Write/modify the flags in the data.
577  // This writes the flags as found in the casacore::MS, casacore::Cube (npol,nchan,nrow),
578  // where nrow is the number of rows in the current iteration (given by
579  // nRow ()).
580  virtual void writeFlag (const casacore::Cube<casacore::Bool> & flag) = 0;
581 
582  // Write/modify the flag row column = 0; dimension casacore::Vector (nrow)
583  virtual void writeFlagRow (const casacore::Vector<casacore::Bool> & rowflags) = 0;
584 
585  virtual void writeFlagCategory(const casacore::Array<casacore::Bool>& fc) = 0;
586 
587  // Write/modify the visibilities.
588  // This is possibly only for a 'reference' casacore::MS which has a new DATA column.
589  // The first axis of the matrix should equal the selected number of channels
590  // in the original MS.
591  // If the casacore::MS does not contain all polarizations, only the parallel
592  // hand polarizations are used.
593 // virtual void writeVisCorrected (const casacore::Matrix<CStokesVector> & visibilityStokes) = 0;
594 // virtual void writeVisModel (const casacore::Matrix<CStokesVector> & visibilityStokes) = 0;
595 // virtual void writeVisObserved (const casacore::Matrix<CStokesVector> & visibilityStokes) = 0;
596 
597  // Write/modify the visibilities
598  // This writes the data as found in the casacore::MS, casacore::Cube (npol,nchan,nrow).
599  virtual void writeVisCorrected (const casacore::Cube<casacore::Complex> & vis) = 0;
600  virtual void writeVisModel (const casacore::Cube<casacore::Complex> & vis) = 0;
601  virtual void writeVisObserved (const casacore::Cube<casacore::Complex> & vis) = 0;
602 
603  // Write/modify the weights
604  virtual void writeWeight (const casacore::Matrix<casacore::Float> & wt) = 0;
605 
606  // Write/modify the weightMat
607  //virtual void writeWeightMat (const casacore::Matrix<casacore::Float> & wtmat) = 0;
608 
609  // Write/modify the weightSpectrum
610  virtual void writeWeightSpectrum (const casacore::Cube<casacore::Float> & wtsp) = 0;
611 
612  // Initialize the weightSpectrum
613  virtual void initWeightSpectrum (const casacore::Cube<casacore::Float> & /* wtsp */) {};
614 
615  // Write/modify the sigmaSpectrum
616  virtual void writeSigmaSpectrum (const casacore::Cube<casacore::Float> & sigsp) = 0;
617 
618  // Initialize the sigmaSpectrum
619  virtual void initSigmaSpectrum (const casacore::Cube<casacore::Float> & /* sigsp */) {};
620 
621  // Write/modify the Sigma
622  virtual void writeSigma (const casacore::Matrix<casacore::Float> & sig) = 0;
623 
624  // Write/modify the ncorr x nrow SigmaMat.
625  //virtual void writeSigmaMat (const casacore::Matrix<casacore::Float> & sigmat) = 0;
626 
627  // Write the information needed to generate on-the-fly model visibilities.
628 
629  virtual void writeModel(const casacore::RecordInterface& rec, casacore::Bool iscomponentlist=true,
630  casacore::Bool incremental=false) = 0;
631 
632  //**********************************************************************
633  // Methods to access the subtables.
634  // Note that for some subclasses, like TransformingTVI, those tables
635  // might be created on the fly, rather than read from the MS.
636  //**********************************************************************
637 
638  // Access to antenna subtable
639  virtual const casacore::ROMSAntennaColumns& antennaSubtablecols() const = 0;
640 
641  // Access to dataDescription subtable
643 
644  // Access to feed subtable
645  virtual const casacore::ROMSFeedColumns& feedSubtablecols() const = 0;
646 
647  // Access to field subtable
648  virtual const casacore::ROMSFieldColumns& fieldSubtablecols() const = 0;
649 
650  // Access to flagCmd subtable
651  virtual const casacore::ROMSFlagCmdColumns& flagCmdSubtablecols() const = 0;
652 
653  // Access to history subtable
654  virtual const casacore::ROMSHistoryColumns& historySubtablecols() const = 0;
655 
656  // Access to observation subtable
658 
659  // Access to pointing subtable
660  virtual const casacore::ROMSPointingColumns& pointingSubtablecols() const = 0;
661 
662  // Access to polarization subtable
664 
665  // Access to processor subtable
666  virtual const casacore::ROMSProcessorColumns& processorSubtablecols() const = 0;
667 
668  // Access to spectralWindow subtable
670 
671  // Access to state subtable
672  virtual const casacore::ROMSStateColumns& stateSubtablecols() const = 0;
673 
674  // Access to doppler subtable
675  virtual const casacore::ROMSDopplerColumns& dopplerSubtablecols() const = 0;
676 
677  // Access to freqOffset subtable
678  virtual const casacore::ROMSFreqOffsetColumns& freqOffsetSubtablecols() const = 0;
679 
680  // Access to source subtable
681  virtual const casacore::ROMSSourceColumns& sourceSubtablecols() const = 0;
682 
683  // Access to sysCal subtable
684  virtual const casacore::ROMSSysCalColumns& sysCalSubtablecols() const = 0;
685 
686  // Access to weather subtable
687  virtual const casacore::ROMSWeatherColumns& weatherSubtablecols() const = 0;
688 
689 
690 protected:
691 
693 
695 
697  WeightScaling * scaling,
698  const casacore::Array<casacore::Float>& unscaled,
700  //static void setVisBufferFillable (VisBuffer2 * vb, bool fillable);
701 };
702 
703 } // end namespace vi
704 
705 } //# NAMESPACE CASA - END
706 
707 #endif // ! defined (MSVIS_ViImplementation2_H_121115_0950)
708 
709 
virtual void timeInterval(casacore::Vector< casacore::Double > &ti) const =0
Return nominal time interval.
virtual const casacore::ROMSFlagCmdColumns & flagCmdSubtablecols() const =0
Access to flagCmd subtable.
virtual const casacore::Vector< casacore::Float > & feed_pa(casacore::Double time) const =0
Return feed parallactic angles casacore::Vector (nant) (1 feed/ant)
A Vector of integers, for indexing into Array&lt;T&gt; objects.
Definition: IPosition.h:119
A Measure: astronomical direction.
Definition: MDirection.h:174
A 1-D Specialization of the Array class.
virtual casacore::Vector< casacore::Int > getCorrelations() const =0
A Measure: position on Earth.
Definition: MPosition.h:79
int Int
Definition: aipstype.h:50
virtual void writeFlagRow(const casacore::Vector< casacore::Bool > &rowflags)=0
Write/modify the flag row column = 0; dimension casacore::Vector (nrow)
MSDerivedValues calculates values derived from a MS.
virtual const casacore::ROMSSpWindowColumns & spectralWindowSubtablecols() const =0
Access to spectralWindow subtable.
virtual const casacore::ROMSFreqOffsetColumns & freqOffsetSubtablecols() const =0
Access to freqOffset subtable.
virtual void setFrequencySelections(const FrequencySelections &selection)=0
Select the channels to be returned.
virtual const casacore::MDirection & phaseCenter() const =0
Return the current phase center as an MDirection.
virtual Subchunk getSubchunkId() const =0
virtual casacore::MDirection azel0(casacore::Double time) const =0
Return the antenna AZ/EL casacore::Vector (nant)
virtual const casacore::ROMSPolarizationColumns & polarizationSubtablecols() const =0
Access to polarization subtable.
Object to hold type of imaging weight scheme to be used on the fly and to provide facilities to do th...
virtual casacore::Bool more() const =0
VisibilityIterator2 iterates through one or more readonly MeasurementSets.
virtual casacore::IPosition visibilityShape() const =0
Return the visibility 4-vector of polarizations for each channel.
virtual void uvw(casacore::Matrix< casacore::Double > &uvwmat) const =0
Return u,v and w (in meters)
A class to provide easy access to MSField columns.
static void azelCalculate(casacore::Double time, casacore::MSDerivedValues &msd, casacore::Vector< casacore::MDirection > &azel, casacore::Int nAnt, const casacore::MEpoch &mEpoch0)
virtual const casacore::ROMSObservationColumns & observationSubtablecols() const =0
Access to observation subtable.
static casacore::Vector< casacore::Float > feed_paCalculate(casacore::Double time, casacore::MSDerivedValues &msd, casacore::Int nAntennas, const casacore::MEpoch &mEpoch0, const casacore::Vector< casacore::Float > &receptor0Angle)
virtual casacore::String msName() const =0
Name of current nominal MS.
virtual void nextChunk()=0
virtual casacore::Double hourang(casacore::Double time) const =0
Return the hour angle for the specified time.
A class to provide easy read-only access to MSSource columns.
virtual void flag(casacore::Cube< casacore::Bool > &flags) const =0
Return flag for each polarization, channel and row.
virtual const casacore::ROMSSourceColumns & sourceSubtablecols() const =0
Access to source subtable.
virtual casacore::Bool allBeamOffsetsZero() const =0
Return the number of sub-intervals in the current chunk.
virtual const VisImagingWeight & getImagingWeightGenerator() const =0
Return imaging weight (a weight for each channel) virtual casacore::Matrix&lt;casacore::Float&gt; &amp; imagin...
virtual void writeFlagCategory(const casacore::Array< casacore::Bool > &fc)=0
virtual const casacore::ROMSFeedColumns & feedSubtablecols() const =0
Access to feed subtable.
virtual ~ViImplementation2()
Destructor.
virtual const casacore::Vector< casacore::String > & antennaMounts() const =0
+=========================+ | | | Chunk and MS Level Data | | | +=========================+ ...
virtual casacore::Bool sigmaSpectrumExists() const =0
Determine whether SIGMA_SPECTRUM exists.
A 3-D Specialization of the Array class.
virtual void spectralWindows(casacore::Vector< casacore::Int > &spws) const =0
virtual const vi::SubtableColumns & subtableColumns() const =0
Access the current casacore::ROMSColumns object in MSIter.
VisBufferOptions
These are options to be applied to a VisBuffer, usually when it&#39;s created.
Definition: VisBuffer2.h:80
virtual casacore::Bool isNewMs() const =0
A 2-D Specialization of the Array class.
virtual casacore::Int nRowsInChunk() const =0
virtual void writeSigma(const casacore::Matrix< casacore::Float > &sig)=0
Write/modify the Sigma.
virtual casacore::Bool isNewFieldId() const =0
virtual casacore::Int polarizationId() const =0
Return current Polarization Id.
virtual void writeVisModel(const casacore::Cube< casacore::Complex > &vis)=0
virtual const casacore::ROMSSysCalColumns & sysCalSubtablecols() const =0
Access to sysCal subtable.
A class to provide easy read-only access to MSProcessor columns.
A class to provide easy read-only access to MSWeather columns.
virtual casacore::Bool isNewArrayId() const =0
virtual void stateId(casacore::Vector< casacore::Int > &stateids) const =0
Return the STATE_IDs.
A class to provide easy read-only access to MSASpectralWindow columns.
virtual void getRowIds(casacore::Vector< casacore::uInt > &rowids) const =0
Return the row ids as from the original root table.
A Measure: instant in time.
Definition: MEpoch.h:104
virtual casacore::Double getInterval() const =0
Return the time interval (in seconds) used for iteration.
virtual void sigmaSpectrum(casacore::Cube< casacore::Float > &wtsp) const =0
Return sgimaspectrum (a sigma for each channel)
A class to provide easy read-only access to MSFreqOffset columns.
A class to provide easy read-only access to MSState columns.
virtual const casacore::Vector< casacore::MDirection > & azel(casacore::Double time) const =0
virtual void antenna1(casacore::Vector< casacore::Int > &ant1) const =0
+=========================+ | | | Subchunk Data Accessors | | | +=========================+ ...
virtual const casacore::Cube< casacore::RigidVector< casacore::Double, 2 > > & getBeamOffsets() const =0
Return a cube containing pairs of coordinate offsets for each receptor of each feed (values are in ra...
virtual void writeWeightSpectrum(const casacore::Cube< casacore::Float > &wtsp)=0
Write/modify the weightMat virtual void writeWeightMat (const casacore::Matrix&lt;casacore::Float&gt; &amp; wt...
Options options
virtual const SortColumns & getSortColumns() const =0
virtual const casacore::ROMSAntennaColumns & antennaSubtablecols() const =0
virtual const casacore::Float & parang0(casacore::Double time) const =0
Return nominal parallactic angle at specified time (does not include feed position angle offset–see f...
virtual void visibilityCorrected(casacore::Cube< casacore::Complex > &vis) const =0
Return the visibilities as found in the casacore::MS, casacore::Cube (npol,nchan,nrow).
virtual void slurp() const =0
Call to use the slurp i/o method for all scalar columns.
Fast Vector classes with fixed (templated) length.
virtual const casacore::MeasurementSet & ms() const =0
virtual casacore::MFrequency::Types getObservatoryFrequencyType() const =0
virtual void setReportingFrameOfReference(casacore::Int frame)=0
virtual const casacore::ROMSStateColumns & stateSubtablecols() const =0
Access to state subtable.
virtual casacore::String sourceName() const =0
Return the current Source Name.
virtual void timeCentroid(casacore::Vector< casacore::Double > &t) const =0
Return MJD centroid of interval.
virtual const casacore::ROMSHistoryColumns & historySubtablecols() const =0
Access to history subtable.
Referenced counted pointer for constant data.
Definition: VisModelData.h:42
virtual void setWeightScaling(casacore::CountedPtr< WeightScaling > weightscaling)=0
virtual casacore::Bool flagCategoryExists() const =0
Determine whether FLAG_CATEGORY is valid.
virtual void weight(casacore::Matrix< casacore::Float > &wtmat) const =0
Return weight.
Fast Square Matrix class with fixed (templated) size.
virtual VisBuffer2 * createAttachedVisBuffer(VisBufferOptions options)
virtual casacore::CountedPtr< WeightScaling > getWeightScaling() const =0
A class to provide easy read-only access to MSPointing columns.
virtual void useImagingWeight(const VisImagingWeight &imWgt)=0
assign a VisImagingWeight object to this iterator
define a (start,length,increment) along an axis
Definition: Slice.h:93
A class to provide easy read-only access to MSDoppler columns.
virtual void feed2(casacore::Vector< casacore::Int > &fd2) const =0
Return feed2.
virtual void initWeightSpectrum(const casacore::Cube< casacore::Float > &)
Initialize the weightSpectrum.
virtual casacore::Int getNMs() const =0
double Double
Definition: aipstype.h:55
ViImplementation2 & operator=(const ViImplementation2 &)=delete
A class to provide easy read-only access to MSHistory columns.
virtual void floatData(casacore::Cube< casacore::Float > &fcube) const =0
Return FLOAT_DATA as a casacore::Cube (npol, nchan, nrow) if found in the MS.
virtual casacore::Vector< casacore::Stokes::StokesTypes > getCorrelationTypesDefined() const =0
virtual casacore::Bool weightSpectrumExists() const =0
Determine whether WEIGHT_SPECTRUM exists.
virtual void writeModel(const casacore::RecordInterface &rec, casacore::Bool iscomponentlist=true, casacore::Bool incremental=false)=0
Write/modify the ncorr x nrow SigmaMat.
virtual void initSigmaSpectrum(const casacore::Cube< casacore::Float > &)
Initialize the sigmaSpectrum.
virtual void writeBackChanges(VisBuffer2 *vb)=0
+----------------—+ | | | Writeback Methods | | | +----------------—+
virtual void scan(casacore::Vector< casacore::Int > &scans) const =0
Return scan number.
A class to provide easy read-only access to MSDataDesc columns.
virtual casacore::Bool isWritable() const =0
virtual std::pair< bool, casacore::MDirection > getPointingAngle(int antenna, double time) const =0
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
virtual VisBuffer2 * getVisBuffer() const =0
virtual void dataDescriptionIds(casacore::Vector< casacore::Int > &ddis) const =0
virtual void sigma(casacore::Matrix< casacore::Float > &sigmat) const =0
Return sigma.
virtual casacore::MEpoch getEpoch() const =0
virtual casacore::Vector&lt;casacore::MPosition&gt; antennaPositions () const; casacore::MSDerivedValues m...
virtual casacore::Vector< casacore::Double > getFrequencies(casacore::Double time, casacore::Int frameOfReference, casacore::Int spectralWndow=-1, casacore::Int msId=-1) const =0
float Float
Definition: aipstype.h:54
virtual void flagCategory(casacore::Array< casacore::Bool > &flagCategories) const =0
Return flags for each polarization, channel, category, and row.
virtual void flagRow(casacore::Vector< casacore::Bool > &rowflags) const =0
Return row flag.
virtual void antenna2(casacore::Vector< casacore::Int > &ant2) const =0
Return antenna2.
static casacore::Vector< casacore::Float > parangCalculate(casacore::Double time, casacore::MSDerivedValues &msd, int nAntennas, const casacore::MEpoch mEpoch0)
virtual casacore::Int dataDescriptionId() const =0
Return current DataDescription Id.
A Table intended to hold astronomical data (a set of Measurements).
virtual void setInterval(casacore::Double timeInterval)=0
virtual void writeVisCorrected(const casacore::Cube< casacore::Complex > &vis)=0
Write/modify the visibilities.
virtual casacore::Int msId() const =0
reference to actual ms in interator
virtual const casacore::ROMSWeatherColumns & weatherSubtablecols() const =0
Access to weather subtable.
virtual const casacore::ROMSPointingColumns & pointingSubtablecols() const =0
Access to pointing subtable.
virtual void feed1(casacore::Vector< casacore::Int > &fd1) const =0
Return feed1.
virtual casacore::Int nRowsViWillSweep() const =0
virtual void writeVisObserved(const casacore::Cube< casacore::Complex > &vis)=0
virtual void exposure(casacore::Vector< casacore::Double > &expo) const =0
Return actual time interval.
static casacore::Double hourangCalculate(casacore::Double time, casacore::MSDerivedValues &msd, const casacore::MEpoch &mEpoch0)
virtual casacore::Int nSpectralWindows() const =0
A class to provide easy read-only access to MSObservation columns.
Definition: MSObsColumns.h:80
virtual casacore::String fieldName() const =0
Return the current Field Name.
VisBuffer2s encapsulate one chunk of visibility data for processing.
Definition: VisBuffer2.h:141
virtual void weightSpectrum(casacore::Cube< casacore::Float > &wtsp) const =0
Return weightspectrum (a weight for each channel)
virtual const casacore::ROMSDopplerColumns & dopplerSubtablecols() const =0
Access to doppler subtable.
virtual const casacore::ROMSFieldColumns & fieldSubtablecols() const =0
Access to field subtable.
A class to provide easy read-only access to MSPolarization columns.
Definition: MSPolColumns.h:75
virtual void arrayIds(casacore::Vector< casacore::Int > &) const =0
Return the current ArrayId.
virtual casacore::Vector< casacore::Stokes::StokesTypes > getCorrelationTypesSelected() const =0
virtual const casacore::ROMSProcessorColumns & processorSubtablecols() const =0
Access to processor subtable.
A class to provide easy read-only access to MSFeed columns.
Definition: MSFeedColumns.h:84
virtual casacore::Bool existsColumn(VisBufferComponent2 id) const =0
VisibilityIterator2 iterates through one or more readonly MeasurementSets.
virtual const casacore::Vector< casacore::Float > & parang(casacore::Double time) const =0
Per antenna:
virtual casacore::String keyChange() const =0
Report Name of slowest column that changes at end of current iteration.
virtual void processorId(casacore::Vector< casacore::Int > &procids) const =0
Return the PROCESSOR_IDs.
virtual casacore::Int nRows() const =0
Return the number of rows in the current iteration.
virtual casacore::String ViiType() const =0
Report the the ViImplementation type.
A class to provide easy read-only access to MSAntenna columns.
static void doWeightScaling(casacore::Bool hasWeightScaling, WeightScaling *scaling, const casacore::Array< casacore::Float > &unscaled, casacore::Array< casacore::Float > &scaled)
String: the storage and methods of handling collections of characters.
Definition: String.h:223
static void azel0Calculate(casacore::Double time, casacore::MSDerivedValues &msd, casacore::MDirection &azel0, const casacore::MEpoch &mEpoch0)
virtual casacore::Int getReportingFrameOfReference() const =0
virtual casacore::Vector< casacore::Float > getReceptor0Angle()=0
virtual casacore::Int nDataDescriptionIds() const =0
virtual void corrType(casacore::Vector< casacore::Int > &corrTypes) const =0
Return the correlation type (returns casacore::Stokes enums)
virtual void visibilityModel(casacore::Cube< casacore::Complex > &vis) const =0
virtual void setRowBlocking(casacore::Int nRows=0)=0
Set the &#39;blocking&#39; size for returning data.
virtual void jonesC(casacore::Vector< casacore::SquareMatrix< casacore::Complex, 2 > > &cjones) const =0
Return feed configuration matrix for specified antenna.
virtual void writeWeight(const casacore::Matrix< casacore::Float > &wt)=0
Write/modify the weights.
virtual void time(casacore::Vector< casacore::Double > &t) const =0
Return MJD midpoint of interval.
virtual casacore::Bool hasWeightScaling() const =0
virtual void visibilityObserved(casacore::Cube< casacore::Complex > &vis) const =0
Abstract base class for Record classes.
Types
Types of known MFrequencies Warning: The order defines the order in the translation matrix FromTo in...
Definition: MFrequency.h:176
virtual casacore::Vector< casacore::Int > getChannels(casacore::Double time, casacore::Int frameOfReference, casacore::Int spectralWndow=-1, casacore::Int msId=-1) const =0
virtual const SpectralWindowChannels & getSpectralWindowChannels(casacore::Int msId, casacore::Int spectralWindowId) const =0
get back the selected spectral windows and spectral channels for current ms
virtual casacore::Int polFrame() const =0
Return frame for polarization (returns PolFrame enum)
virtual casacore::Int nPolarizationIds() const =0
virtual casacore::Int nAntennas() const =0
Return number of antennasm spws, polids, ddids.
virtual void observationId(casacore::Vector< casacore::Int > &obsids) const =0
Return the OBSERVATION_IDs.
virtual const casacore::Cube< casacore::Double > & receptorAngles() const =0
Return receptor angles for all antennae and feeds First axis of the cube is a receptor number...
virtual casacore::MPosition getObservatoryPosition() const =0
A class to provide easy read-only access to MSFlagCmd columns.
virtual void origin()=0
+==================================+ | | | Iteration Control and Monitoring | | | +==================...
virtual void fieldIds(casacore::Vector< casacore::Int > &) const =0
Return the current FieldId.
A class to provide easy read-only access to MSSysCal columns.
virtual casacore::Bool moreChunks() const =0
virtual void writeSigmaSpectrum(const casacore::Cube< casacore::Float > &sigsp)=0
Write/modify the sigmaSpectrum.
virtual casacore::Int spectralWindow() const =0
Return current SpectralWindow.
virtual void originChunks(casacore::Bool forceRewind=false)=0
Methods to control chunk iterator.
virtual const casacore::ROMSDataDescColumns & dataDescriptionSubtablecols() const =0
Access to dataDescription subtable.
virtual void writeFlag(const casacore::Cube< casacore::Bool > &flag)=0
Write/modify the flags in the data.
static casacore::Float parang0Calculate(casacore::Double time, casacore::MSDerivedValues &msd, const casacore::MEpoch &epoch0)
virtual casacore::Bool isNewSpectralWindow() const =0
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42