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