casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
VisibilityIteratorImpl2.h
Go to the documentation of this file.
1 // -*- mode: c++ -*-
2 //# VisibilityIterator.h: Step through the MeasurementEquation by visibility
3 //# Copyright (C) 1996,1997,1998,1999,2000,2001,2002,2003
4 //# Associated Universities, Inc. Washington DC, USA.
5 //#
6 //# This library is free software; you can redistribute it and/or modify it
7 //# under the terms of the GNU Library General Public License as published by
8 //# the Free Software Foundation; either version 2 of the License, or (at your
9 //# option) any later version.
10 //#
11 //# This library is distributed in the hope that it will be useful, but WITHOUT
12 //# ANY WARRANTY; without even the Implied warranty of MERCHANTABILITY or
13 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
14 //# License for more details.
15 //#
16 //# You should have received a copy of the GNU Library General Public License
17 //# along with this library; if not, write to the Free Software Foundation,
18 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
19 //#
20 //# Correspondence concerning AIPS++ should be addressed as follows:
21 //# Internet email: aips2-request@nrao.edu.
22 //# Postal address: AIPS++ Project Office
23 //# National Radio Astronomy Observatory
24 //# 520 Edgemont Road
25 //# Charlottesville, VA 22903-2475 USA
26 //#
27 //# $Id: VisibilityIterator2.h,v 19.14 2006/02/28 04:48:58 mvoronko Exp $
28 
29 #ifndef MSVIS_VISIBILITYITERATORIMPL2_H
30 #define MSVIS_VISIBILITYITERATORIMPL2_H
31 
32 #include <casa/aips.h>
35 #include <msvis/MSVis/ViColumns2.h>
39 #include <msvis/MSVis/VisBuffer2.h>
40 
41 #include <tuple>
42 #include <map>
43 #include <vector>
44 #include <mutex>
45 #include <memory>
46 
47 namespace casacore{
48 
49 template <typename T> class ArrayColumn;
50 template <typename T> class CountedPtr;
51 class VisModelDataI;
52 template <typename T> class ArrayColumn;
53 template <typename T, Int N> class RigidVector;
54 template <typename T, Int N> class SquareMatrix;
55 }
56 
57 namespace casa { //# NAMESPACE CASA - BEGIN
58 
59 class MsIter;
60 class VisModelDataI;
61 
62 namespace vi {
63 
64 //# forward decl
65 
66 class VisBuffer2;
67 
68 class ChannelSelector;
69 class ChannelSelectorCache;
70 class PointingDirectionCache;
71 class PointingSource;
72 class SpectralWindowChannelsCache;
73 class SpectralWindowChannels;
74 class SubtableColumns;
75 
77 
78  friend class AsyncEnabler;
79  friend class ViImplAsync2;
80  friend class VisibilityIterator2;
81  friend class VLAT; // allow VI lookahead thread class to access protected functions
82  friend class VisBuffer2Adapter;
83  // VLAT should not access private parts, especially variables
84 
85 public:
86 
89 
90  // Default constructor - useful only to assign another iterator later
92 
93  // Construct from an casacore::MS and a casacore::Block of casacore::MS
94  // column enums specifying the iteration order. If no order is specified,
95  // it uses the default sort order of MSIter, which is not necessarily the
96  // raw order of ms! The default ordering is ARRAY_ID, FIELD_ID,
97  // DATA_DESC_ID, and TIME, but check MSIter.h to be sure. These columns
98  // will be added first if they are not specified.
99  //
100  // An optional timeInterval (in seconds) can be given to iterate through
101  // chunks of time. The default interval of 0 groups all times together.
102  // Every 'chunk' of data contains all data within a certain time interval
103  // and with identical values of the other iteration columns (e.g.
104  // DATA_DESC_ID and FIELD_ID). Using selectChannel (), a number of groups
105  // of channels can be requested. At present the channel group iteration
106  // will always occur before the interval iteration.
107 // VisibilityIteratorImpl (const casacore::MeasurementSet & ms,
108 // const casacore::Block<casacore::Int> & sortColumns,
109 // casacore::Double timeInterval = 0);
110 
111  // Same as above, but with the option of using the raw order of ms
112  // (addDefaultSortCols=false).
113 // VisibilityIteratorImpl (const casacore::MeasurementSet & ms,
114 // const casacore::Block<casacore::Int> & sortColumns, const casacore::Bool addDefaultSortCols,
115 // casacore::Double timeInterval = 0);
116 
117  // Same as previous constructors, but with multiple MSs to iterate over.
118 // VisibilityIteratorImpl (const casacore::Block<casacore::MeasurementSet> & mss,
119 // const casacore::Block<casacore::Int> & sortColumns,
120 // casacore::Double timeInterval = 0);
121 
124  const SortColumns & sortColumns,
127  casacore::Bool useMSIter2=false);
128 
130 
132 
134 
136 
137  // Destructor
138 
139  virtual ~VisibilityIteratorImpl2();
140 
141  // Members
142 
143  std::unique_ptr<VisibilityIteratorImpl2> clone() const;
144 
145  // Report the the ViImplementation type
146  // TBD: indicate writable?
147  virtual casacore::String
148  ViiType() const override {
149  return casacore::String("DiskIO()");
150  };
151 
152  virtual casacore::Bool
153  isWritable() const override;
154 
155  // Reset iterator to origin/start of data (of current chunk)
156  virtual void
157  origin() override;
158 
159  // Reset iterator to true start of data (first chunk)
160  virtual void
161  originChunks();
162 
163  // Return the time interval (in seconds) used for iteration. This is not
164  // the same as the INTERVAL column.
165 
166  virtual casacore::Double
167  getInterval() const override;
168 
169  // Set or reset the time interval (in seconds) to use for iteration. You
170  // should call originChunks() to reset the iteration after calling this.
171  virtual void
173 
174  // Set the 'blocking' size for returning data. With the default (0) only a
175  // single integration is returned at a time, this is what is currently
176  // required for the calibration software. With blocking set, up to nRows can
177  // be returned in one go. The chunk size determines the actual maximum.
178  virtual void
179  setRowBlocking(casacore::Int nRows = 0) override;
180 
181  virtual casacore::Bool
182  existsColumn(VisBufferComponent2 id) const override;
183 
184  // Return false if no more data (in current chunk)
185  virtual casacore::Bool
186  more() const override;
187 
188  virtual Subchunk
189  getSubchunkId() const override;
190 
191  virtual const SortColumns &
192  getSortColumns() const override;
193 
194  virtual void
195  setFrequencySelections(const FrequencySelections & selection) override;
196 
197  // Return false if no more 'Chunks' of data left
198  virtual casacore::Bool
199  moreChunks() const override;
200 
201  // Check if ms has change since last iteration
202 
203  virtual casacore::Bool
204  isNewArrayId() const override;
205 
206  virtual casacore::Bool
207  isNewFieldId() const override;
208 
209  virtual casacore::Bool
210  isNewMs() const override;
211 
212  virtual casacore::Bool
213  isNewSpectralWindow() const override;
214 
215  virtual casacore::Int
216  msId() const override;
217 
218  virtual casacore::Int
219  getNMs() const override;
220 
221  virtual VisBuffer2 *
222  getVisBuffer() const override;
223 
224  //reference to actual ms in interator
225  virtual const casacore::MeasurementSet &
226  ms() const override;
227 
228  // Name of the MS in the interator
229  virtual casacore::String
230  msName() const override;
231 
232  // advance the iteration
233  virtual void
234  next() override;
235 
236  // Advance to the next Chunk of data
237  virtual void
238  nextChunk() override;
239 
240  // Report Name of slowest column that changes at end of current iteration
241  virtual casacore::String
242  keyChange() const override {
243  return msIter_p->keyChange();
244  };
245 
246  // Return antenna1
247  virtual void
248  antenna1(casacore::Vector<casacore::Int> & ant1) const override;
249 
250  // Return antenna2
251  virtual void
252  antenna2(casacore::Vector<casacore::Int> & ant2) const override;
253 
254  // Return feed1
255  virtual void
256  feed1(casacore::Vector<casacore::Int> & fd1) const override;
257 
258  // Return feed2
259  virtual void
260  feed2(casacore::Vector<casacore::Int> & fd2) const override;
261 
262  // Return feed configuration matrix for specified antenna
263  void
264  jonesC(
266 
267  // Return receptor angles for all antennae and feeds First axis of the cube
268  // is a receptor number, 2nd is antennaId, 3rd is feedId Note: the method is
269  // intended to provide an access to MSIter::receptorAngles for VisBuffer in
270  // the multi-feed case. It may be worth to change the interface of feed_pa
271  // to return the information for all feeds.
272  virtual const casacore::Cube<casacore::Double> &
273  receptorAngles() const override;
274 
275  // return a string mount identifier for each antenna
276  virtual const casacore::Vector<casacore::String> &
277  antennaMounts() const override;
278 
279  // Return a cube containing pairs of coordinate offsets for each
280  // receptor of each feed (values are in radians, coordinate system is fixed
281  // with antenna and is the same one as used to define the BEAM_OFFSET
282  // parameter in the feed table). The cube axes are receptor, antenna, feed.
284  getBeamOffsets() const override;
285 
286  virtual std::pair<bool, casacore::MDirection>
287  getPointingAngle(int antenna, double time) const override;
288 
289  // true if all elements of the cube returned by getBeamOffsets are zero
290  virtual casacore::Bool
291  allBeamOffsetsZero() const override;
292 
293  // Return feed parallactic angles casacore::Vector (nant) (1 feed/ant)
294  virtual const casacore::Vector<casacore::Float> &
295  feed_pa(casacore::Double time) const override;
296 
297  // Return nominal parallactic angle at specified time
298  // (does not include feed position angle offset--see feed_pa)
299  // A global value for all antennas (e.g., small array)
300  virtual const casacore::Float &
301  parang0(casacore::Double time) const override;
302 
303  // Per antenna:
304  virtual const casacore::Vector<casacore::Float> &
305  parang(casacore::Double time) const override;
306 
307  // Return the antenna AZ/EL casacore::Vector(nant)
308  virtual casacore::MDirection
309  azel0(casacore::Double time) const override;
310 
312  azel(casacore::Double time) const override;
313 
314  // Return the hour angle for the specified time
315  virtual casacore::Double
316  hourang(casacore::Double time) const override;
317 
318  // Return the current FieldId
319  virtual void
320  fieldIds(casacore::Vector<casacore::Int>&) const override;
321 
322  // Return the current ArrayId
323  virtual void
324  arrayIds(casacore::Vector<casacore::Int>&) const override;
325 
326  // Return the current Field Name
327  virtual casacore::String
328  fieldName() const override;
329 
330  // Return the current Source Name
331  virtual casacore::String
332  sourceName() const override;
333 
334  // Return flag for each polarization, channel and row
335  virtual void
336  flag(casacore::Cube<casacore::Bool> & flags) const override;
337 
338  // Return flag for each channel & row
339  virtual void
340  flag(casacore::Matrix<casacore::Bool> & flags) const override;
341 
342  // Determine whether FLAG_CATEGORY is valid.
344  flagCategoryExists() const override;
345 
346  // Return flags for each polarization, channel, category, and row.
347  virtual void
348  flagCategory(casacore::Array<casacore::Bool> & flagCategories) const override;
349 
350  // Return row flag
351  virtual void
352  flagRow(casacore::Vector<casacore::Bool> & rowflags) const override;
353 
354  // Return scan number
355  virtual void
356  scan(casacore::Vector<casacore::Int> & scans) const override;
357 
358  // Return the OBSERVATION_IDs
359  virtual void
360  observationId(casacore::Vector<casacore::Int> & obsids) const override;
361 
362  // Return the PROCESSOR_IDs
363  virtual void
364  processorId(casacore::Vector<casacore::Int> & procids) const override;
365 
366  // Return the STATE_IDs
367  virtual void
368  stateId(casacore::Vector<casacore::Int> & stateids) const override;
369 
370  // Return the current phase center as an MDirection
371  virtual const casacore::MDirection &
372  phaseCenter() const override;
373 
374  // Return frame for polarization(returns PolFrame enum)
375  virtual casacore::Int
376  polFrame() const override;
377 
378  // Return the correlation type (returns casacore::Stokes enums)
379  virtual void
380  corrType(casacore::Vector<casacore::Int> & corrTypes) const override;
381 
382  // Return sigma
383  virtual void
384  sigma(casacore::Matrix<casacore::Float> & sig) const override;
385 
386  // Return current SpectralWindow
387  virtual casacore::Int
388  spectralWindow() const override;
389 
390  virtual void
391  spectralWindows(casacore::Vector<casacore::Int> & spws) const override;
392 
393  // Return current Polarization Id
394  virtual casacore::Int
395  polarizationId() const override;
396 
397  // Return current DataDescription Id
398  virtual casacore::Int
399  dataDescriptionId() const override;
400 
401  virtual void
403 
404  // Return MJD midpoint of interval.
405  virtual void
406  time(casacore::Vector<casacore::Double> & t) const override;
407 
408  // Return MJD centroid of interval.
409  virtual void
411 
412  // Return nominal time interval
413  virtual void
415 
416  // Return actual time interval
417  virtual void
418  exposure(casacore::Vector<casacore::Double> & expo) const override;
419 
420  // Return the visibilities as found in the casacore::MS,
421  // casacore::Cube(npol,nchan,nrow).
422  virtual void
424 
425  virtual void
427 
428  virtual void
430 
431  // This will return all selected spwids for each ms attached with this iterator
433 
434  // Return FLOAT_DATA as a casacore::Cube(npol, nchan, nrow) if found in the
435  // MS.
436  virtual void
437  floatData(casacore::Cube<casacore::Float> & fcube) const override;
438 
439  // Return the visibility 4-vector of polarizations for each channel. If the
440  // casacore::MS doesn't contain all polarizations, it is assumed it contains
441  // one or two parallel hand polarizations.
442 
443 // virtual void visibilityCorrected(casacore::Matrix<CStokesVector> & vis) const;
444 // virtual void visibilityModel(casacore::Matrix<CStokesVector> & vis) const;
445 // virtual void visibilityObserved(casacore::Matrix<CStokesVector> & vis) const;
446 
447  // Return the shape of the visibility Cube
448  virtual casacore::IPosition
449  visibilityShape() const override;
450 
451  // Return u,v and w (in meters)
452  virtual void
453  uvw(casacore::Matrix<casacore::Double> & uvwmat) const override;
454 
455  // Return weight
456  virtual void
457  weight(casacore::Matrix<casacore::Float> & wt) const override;
458 
459  // Determine whether WEIGHT_SPECTRUM exists.
461  weightSpectrumExists() const override;
462 
463  // Determine whether SIGMA_SPECTRUM exists.
465  sigmaSpectrumExists() const override;
466 
467  // Return weightspectrum(a weight for each channel)
468  virtual void
469  weightSpectrum(casacore::Cube<casacore::Float> & wtsp) const override;
470 
471  // Return sigmaspectrum(a sigma for each channel)
472  virtual void
473  sigmaSpectrum(casacore::Cube<casacore::Float> & sigsp) const override;
474 
475 
476  virtual void
478 
480  getWeightScaling() const override;
481 
482  virtual casacore::Bool
483  hasWeightScaling() const override;
484 
485  // Return imaging weight (a weight for each channel)
486  //virtual casacore::Matrix<casacore::Float> & imagingWeight(casacore::Matrix<casacore::Float> & wt) const;
487  const VisImagingWeight &
488  getImagingWeightGenerator() const override;
489 
490  // Return true if FieldId/Source has changed since last iteration
491  virtual casacore::Bool
492  newFieldId() const;
493 
494  // Return true if arrayID has changed since last iteration
495  virtual casacore::Bool
496  newArrayId() const;
497 
498  // Return true if SpectralWindow has changed since last iteration
499  virtual casacore::Bool
500  newSpectralWindow() const;
501 
502  // Return the number of rows in the current iteration
503  virtual casacore::Int
504  nRows() const override;
505 
506  // Return the row ids as from the original root table. This is useful
507  // to find correspondance between a given row in this iteration to the
508  // original ms row
509  virtual void
510  getRowIds(casacore::Vector<casacore::uInt> & rowids) const override;
511 
512  // Return the numbers of rows in the current chunk
513  virtual casacore::Int
514  nRowsInChunk() const override;
515 
516  // Return the number of sub-intervals in the current chunk
517 
518  //virtual casacore::Int nSubInterval() const;
519 
520  // Call to use the slurp i/o method for all scalar columns. This will set
521  // the casacore::BucketCache cache size to the full column length and cause
522  // the full column to be cached in memory, if any value of the column is
523  // used. In case of out-of-memory, it will automatically fall-back on the
524  // smaller cache size. Slurping the column is to be considered as a
525  // work-around for the casacore::Table i/o code, which uses
526  // casacore::BucketCache and performs extremely bad for random
527  // access. Slurping is useful when iterating non-sequentially an
528  // casacore::MS or parts of an casacore::MS, it is not tested with multiple
529  // MSs.
530  virtual void
531  slurp() const override;
532 
533  // Get the spw, start and nchan for all the ms's is this Visiter that match
534  // the frequecy "freqstart-freqStep" and "freqEnd+freqStep" range Can help
535  // in doing channel selection above.. freqFrame is the frame the caller
536  // frequency values are in(freqStart and freqEnd) These will be converted to
537  // the frame of the selected spw to match
538 
539 // virtual void getSpwInFreqRange(casacore::Block<casacore::Vector<casacore::Int> > & spw,
540 // casacore::Block<casacore::Vector<casacore::Int> > & start,
541 // casacore::Block<casacore::Vector<casacore::Int> > & nchan,
542 // casacore::Double freqStart, casacore::Double freqEnd,
543 // casacore::Double freqStep, casacore::MFrequency::Types freqFrame = casacore::MFrequency::LSRK) const;
544 
545  // Get the range of frequency convered by the selected data in the frame
546  // requested
547 
548 // virtual void getFreqInSpwRange(casacore::Double& freqStart, casacore::Double& freqEnd, casacore::MFrequency::Types freqframe = casacore::MFrequency::LSRK) const;
549 
550  // Access the current casacore::ROMSColumns object in MSIter
551  virtual const vi::SubtableColumns &
552  subtableColumns() const override;
553 
554  // get back the selected spectral windows and spectral channels for
555  // current ms
556 
557  virtual const SpectralWindowChannels &
560  casacore::Int spectralWindowId) const override;
561 
562  //assign a VisImagingWeight object to this iterator
563  virtual void
564  useImagingWeight(const VisImagingWeight & imWgt) override;
565 
566  //return number of Ant
567  virtual casacore::Int
568  nAntennas() const override;
569 
570  //Return number of rows in all selected ms's
571  virtual casacore::Int
572  nRowsViWillSweep() const override;
573 
574  // Return number of spws, polids, ddids
575  virtual casacore::Int
576  nSpectralWindows() const override;
577 
578  virtual casacore::Int
579  nPolarizationIds() const override;
580 
581  virtual casacore::Int
582  nDataDescriptionIds() const override;
583 
584  virtual casacore::MEpoch
585  getEpoch() const override;
586 
588  getObservatoryFrequencyType() const override; //???
589 
591  getObservatoryPosition() const override;
592 
594  getReceptor0Angle() override;
595 
596  // Write/modify the flags in the data. This will flag all channels in the
597  // original data that contributed to the output channel in the case of
598  // channel averaging. All polarizations have the same flag value.
599 
600 // virtual void writeFlag(const casacore::Matrix<casacore::Bool> & flag);
601 
602  // Write/modify the flags in the data.
603 
604  // This writes the flags as found in the casacore::MS,
605  // casacore::Cube(npol,nchan,nrow), where nrow is the number of rows in the
606  // current iteration(given by nRow()).
607 
608  virtual void
610 
611  // Write/modify the flag row column; dimension casacore::Vector(nrow)
612  virtual void
613  writeFlagRow(const casacore::Vector<casacore::Bool> & rowflags) override;
614 
615  void
617 
618  // Write/modify the visibilities. This is possibly only for a 'reference'
619  // casacore::MS which has a new DATA column. The first axis of the matrix
620  // should equal the selected number of channels in the original MS. If the
621  // casacore::MS does not contain all polarizations, only the parallel hand
622  // polarizations are used.
623 
624 // void writeVisCorrected(const casacore::Matrix<CStokesVector> & visibilityStokes);
625 // void writeVisModel(const casacore::Matrix<CStokesVector> & visibilityStokes);
626 // void writeVisObserved(const casacore::Matrix<CStokesVector> & visibilityStokes);
627 
628  // Write/modify the visibilities
629 
630  // This writes the data as found in the casacore::MS,
631  // casacore::Cube(npol,nchan,nrow).
632  virtual void
634 
635  virtual void
636  writeVisModel(const casacore::Cube<casacore::Complex> & vis) override;
637 
638  virtual void
640 
641  // Write/modify the weights
642  virtual void
643  writeWeight(const casacore::Matrix<casacore::Float> & wt) override;
644 
645  // Write/modify the weightMat
646  //virtual void writeWeightMat(const casacore::Matrix<casacore::Float> & wtmat);
647 
648  // Write/modify the weightSpectrum
649  virtual void
651 
652  // Initialize the weightSpectrum column
653  virtual void
655 
656  // Write/modify the sigmaSpectrum
657  virtual void
658  writeSigmaSpectrum(const casacore::Cube<casacore::Float> & sigsp) override;
659 
660  // Initialize the sigmaSpectrum column
661  virtual void
663 
664  // Write/modify the Sigma
665  virtual void
666  writeSigma(const casacore::Matrix<casacore::Float> & sig) override;
667 
668  // Write/modify the ncorr x nrow SigmaMat.
669  //virtual void writeSigmaMat(const casacore::Matrix<casacore::Float> & sigmat);
670 
671  virtual void
672  writeModel(
673  const casacore::RecordInterface& rec,
674  casacore::Bool iscomponentlist=true,
675  casacore::Bool incremental=false) override;
676 
677  virtual void
678  writeBackChanges(VisBuffer2 *) override;
679 
680  //**********************************************************************
681  // Methods to access the subtables.
682  //**********************************************************************
683 
684  // Access to antenna subtable
685  const casacore::ROMSAntennaColumns& antennaSubtablecols() const override;
686 
687  // Access to dataDescription subtable
689 
690  // Access to feed subtable
691  const casacore::ROMSFeedColumns& feedSubtablecols() const override;
692 
693  // Access to field subtable
694  const casacore::ROMSFieldColumns& fieldSubtablecols() const override;
695 
696  // Access to flagCmd subtable
697  const casacore::ROMSFlagCmdColumns& flagCmdSubtablecols() const override;
698 
699  // Access to history subtable
700  const casacore::ROMSHistoryColumns& historySubtablecols() const override;
701 
702  // Access to observation subtable
704 
705  // Access to pointing subtable
706  const casacore::ROMSPointingColumns& pointingSubtablecols() const override;
707 
708  // Access to polarization subtable
710 
711  // Access to processor subtable
713 
714  // Access to spectralWindow subtable
716 
717  // Access to state subtable
718  const casacore::ROMSStateColumns& stateSubtablecols() const override;
719 
720  // Access to doppler subtable
721  const casacore::ROMSDopplerColumns& dopplerSubtablecols() const override;
722 
723  // Access to freqOffset subtable
725 
726  // Access to source subtable
727  const casacore::ROMSSourceColumns& sourceSubtablecols() const override;
728 
729  // Access to sysCal subtable
730  const casacore::ROMSSysCalColumns& sysCalSubtablecols() const override;
731 
732  // Access to weather subtable
733  const casacore::ROMSWeatherColumns& weatherSubtablecols() const override;
734 
735 protected:
736 
737 
738  virtual void
739  attachColumns(const casacore::Table & t);
740 
741  // returns the table, to which columns are attached,
742  // can be overridden in derived classes
743 
744  virtual const casacore::Table
745  attachTable() const;
746 
747  virtual void
749 
750  virtual void
752  casacore::Vector<casacore::Int> & selectedWindows,
753  casacore::Vector<casacore::Int> & nChannels) const;
754 
755  // set the iteration state
756 
757  virtual void
759 
760  // set the currently selected table
761 
762  virtual void
764 
765  const ChannelSelector *
769  casacore::Int spectralWindowId);
770 
771  virtual const vi::ChannelSelector *
774  casacore::Int spectralWindowId = -1,
776  casacore::Int msId = -1) const;
777 
778  bool
780 
783  casacore::Double lowerFrequency,
784  casacore::Double upperFrequency,
785  const vi::SpectralWindowChannels & spectralWindowChannels) const;
786 
789 
792 
793  // Methods to get the data out of a table column according to whatever
794  // selection criteria (e.g., slicing) is in effect.
795 
796  template <typename T>
797  void
799  const casacore::ScalarColumn<T> & column,
800  casacore::Vector<T> & array) const;
801 
802  template <typename T>
803  void
806  casacore::Bool correlationSlicing) const;
807 
808  template <typename T>
809  void
811  casacore::Array<T> & array) const;
812 
816  casacore::Int frameOfReference,
817  casacore::Int spectralWindowId,
818  casacore::Int msId) const override; // helper method
819 
821  getChannels(
823  casacore::Int frameOfReference,
824  casacore::Int spectralWindowId,
825  casacore::Int msId) const override;
826 
828  getCorrelations() const override;
829 
831  getCorrelationTypesDefined() const override;
832 
834  getCorrelationTypesSelected() const override;
835 
836  int getMeasurementFrame(int spectralWindowId) const;
837 
840  casacore::Int spectralWindowId,
841  casacore::Int msId) const;
842 
844  getReportingFrameOfReference() const override;
845 
846  // Returns the casacore::MS objects that this VI is iterating over.
847 
850 
851  // Provides access to the casacore::MS-derived values object
852 
854  getMsd() const; // for use by Async I/O *ONLY*
855 
856  // Get privileged (non-const) access to the containing ROVI
857 
859  getViP() const;
860 
861 // void getVisibilityAsStokes(casacore::Matrix<CStokesVector> & visibilityStokes,
862 // const casacore::ArrayColumn<casacore::Complex> & column) const;
863 
864  VisBuffer2 *
865  getVisBuffer(const VisibilityIterator2 *) const;
866 
867  // Ctor auxiliary method
868 
869  virtual void
871 
872  virtual void
873  initialize(
875  casacore::Bool useMSIter2=false);
876 
877  // Returns true if casacore::MS Iterator is currently pointing to a selected
878  // spectral window
879 
882 
883  // Creates a channel selection for the current subchunk based on the channel
884  // or frequency selection made by the user.
885 
886  vi::ChannelSelector *
888  const FrequencySelection & selection,
891  casacore::Int spectralWindowId,
893 
894  vi::ChannelSelector *
896  const FrequencySelection & selection,
899  casacore::Int spectralWindowId,
901 
905  int spectralWindowId,
906  casacore::Int otherFrameOfReference,
907  casacore::Bool toObservedFrame,
908  casacore::Unit) const;
909 
910  // Allow access to the casacore::MSColumns object; for use by
911  // VisBuffer2Adapter *KLUGE*
912 
913  const casacore::ROMSColumns *
914  msColumnsKluge() const;
915 
916  // Method to reset the VI back to the start. Unlike the public version
917  // there is a parameter to allow forcing the rewind even if the
918  // casacore::MS Iter is already at the origin.
919 
920  virtual void
921  originChunks(casacore::Bool forceRewind) override;
922 
923  // Advances the casacore::MS Iterator until it points at a spectral window
924  // that is part of the frequency selection.
925 
926  void
928 
929  // Sets the default frequency reporting frame of reference. This
930  // affects the default frame for obtaining the frequencies in a
931  // VisBuffer.
932 
933  void
935 
936  // Adjusts the tile cache for some columns so that the cache size is
937  // optimized for the current input state (e.g., a new data description).
938 
939  virtual void
940  setTileCache();
941 
942  void
945  std::vector<casacore::MSMainEnums::PredefinedColumns> columnIds);
946 
947  void
948  setMsColumnCacheSizes(const casacore::MeasurementSet&, const string &);
949 
950  // Throws exception if there is a pending (i.e., unapplied) change to
951  // the VI's properties. Called when the VI is advanced since the user
952  // probably forgot to apply the changes.
953 
954  virtual void
956 
957  // Returns true if the named column uses a tiled data manager in the
958  // specified MS
959 
962  const casacore::String & columnName,
963  const casacore::MeasurementSet & ms) const;
964 
965 
966 // +========================|
967 // | |
968 // | Output Related Methods |
969 // | |
970 // +========================|
971 
972  // A BackWriter is a functor that will extract a piece of information out of
973  // its VisBuffer argument and write it out using a "set" method on the
974  // supplied VisibilityIterator2.
975  class BackWriter {
976 
977  public:
978 
979  virtual ~BackWriter() {}
980 
981  virtual void operator()(VisibilityIteratorImpl2 * vi, VisBuffer2 * vb) = 0;
982 
983  };
984 
985  // A simple BackWriterImpl2 uses a nullary accessor on a VisBuffer.
986  template <typename Setter, typename Getter>
987  class BackWriterImpl : public BackWriter {
988  public:
989 
990  BackWriterImpl(Setter setter, Getter getter)
991  : getter_p(getter), setter_p(setter) {}
992 
993  void
995  (vi ->* setter_p)((vb ->* getter_p)());
996  }
997 
998  private:
999 
1000  Getter getter_p;
1001  Setter setter_p;
1002  };
1003 
1004  // BackWriterImpl2 is slightly more complicated in that it uses a unary
1005  // accessor. The argument to the unary accessor is a member of the
1006  // VisibilityIterator2 DataColumn enumeration which specifies which
1007  // visibilty or visCube type is wanted (e.g., observed, model or corrected).
1008  template <typename Setter, typename Getter>
1009  class BackWriterImpl2 : public BackWriter {
1010  public:
1011 
1013 
1014  BackWriterImpl2(Setter setter, Getter getter, DataColumn dc)
1015  : dataColumn_p(dc), getter_p(getter), setter_p(setter)
1016  {}
1017 
1018  void
1020  (vi ->* setter_p)((vb ->* getter_p)(), dataColumn_p);
1021  }
1022 
1023  private:
1024 
1026  Getter getter_p;
1027  Setter setter_p;
1028  };
1029 
1030  // Backwriter(2) creation methods. These methods make it fairly
1031  // straightforward to create a BackWriter object.
1032 
1033  template <typename Ret>
1034  static
1035  BackWriter *
1037  void (VisibilityIteratorImpl2::* setter)(Ret),
1038  Ret (VisBuffer2::* getter)() const) {
1039  return new BackWriterImpl<void(VisibilityIteratorImpl2:: *)(Ret),
1040  Ret(VisBuffer2:: *)() const >(
1041  setter, getter);
1042  }
1043 
1044  template <typename Ret>
1045  static
1046  BackWriter *
1049  Ret (VisBuffer2::* getter)() const,
1051 
1052  // Define the Getter and Setter types
1053 
1054  typedef void (VisibilityIteratorImpl2::* Setter)(Ret, VisibilityIteratorImpl2::DataColumn);
1055  typedef Ret (VisBuffer2::* Getter)() const;
1056 
1057  return new BackWriterImpl2 < Setter, Getter>(setter, getter, dc);
1058  }
1059 
1060  void
1062 
1063  template <typename T>
1064  void
1065  putColumnRows(
1066  casacore::ArrayColumn<T> & column,
1067  const casacore::Array<T> & array);
1068 
1069  template <typename T>
1070  void
1071  putColumnRows(
1072  casacore::ArrayColumn<T> & column,
1073  const casacore::Matrix<T> & array);
1074 
1075  template <typename T>
1076  void
1077  putColumnRows(
1078  casacore::ScalarColumn<T> & column,
1079  const casacore::Vector <T> & array);
1080 
1081 // void convertVisFromStokes(const casacore::Matrix<CStokesVector> & visibilityStokes,
1082 // casacore::Cube<casacore::Complex> & visCube);
1083 
1084  class Cache {
1085 
1086  public:
1087 
1088  Cache();
1089 
1090  void flush();
1091 
1096  // Row numbers of underlying casacore::MS; used to map form chunk rows
1097  // to casacore::MS rows. See rowIds method.
1104  // Does the current casacore::MS have a valid FLAG_CATEGORY?
1106  // Does the current casacore::MS have a valid WEIGHT_SPECTRUM?
1108  // Does the current casacore::MS have a valid SIGMA_SPECTRUM?
1114  };
1115 
1117 
1118  public:
1119 
1120  PendingChanges();
1121  ~PendingChanges();
1122 
1123  PendingChanges *
1124  clone() const;
1125 
1127  empty() const;
1128 
1129  // yields ownership
1130  std::pair<casacore::Bool, FrequencySelections *>
1132 
1133  std::pair<casacore::Bool, casacore::Double>
1134  popInterval();
1135 
1136  std::pair<casacore::Bool, casacore::Int>
1137  popNRowBlocking();
1138 
1139  // takes ownership
1140  void
1142 
1143  void
1145 
1146  void
1148 
1149  private:
1150 
1151  enum {Empty = -1};
1152 
1157  };
1158 
1160 
1161  class RowBounds {
1162  public:
1163 
1165  : chunkNRows_p(-1), subchunkBegin_p(-1), subchunkEnd_p(-1),
1166  subchunkNRows_p(-1), subchunkRows_p(0, 0), timeMax_p(-1),
1167  timeMin_p(-1)
1168  {}
1169 
1170  // last row in current chunk
1172  // first row in current subchunk
1174  // last row in current subchunk
1176  // # rows in subchunk
1178  // subchunk's table row numbers
1180  // times for each row in the chunk
1182  // max timestamp in the chunk
1184  // min timechunk in the chunk
1186 
1187  };
1188 
1190  std::map <VisBufferComponent2, BackWriter *> backWriters_p;
1191  // general collection of cached values
1192  mutable Cache cache_p;
1193  // [use] current channel selector for this casacore::MS & Spw
1194  const ChannelSelector * channelSelector_p;
1195  // [own] cache of recently used channel selectors
1196  ChannelSelectorCache * channelSelectorCache_p;
1197  // The main columns for the current MS
1199  // true if a float data column was found
1201  // [own] Current frequency selection
1203  // object to calculate imaging weight
1205  // cached value of observatory type
1209  // true if more data in this chunk
1211  // array index of current MS
1213  // true if casacore::MS Iter is a start of first MS
1215  // casacore::MS Iter that underlies the VI (sweeps in chunks)
1217  // Helper class holding casacore::MS derived values.
1220  // suggested # of rows in a subchunk
1222  // holds pending changes to VI properties
1223  std::unique_ptr<PendingChanges> pendingChanges_p;
1224  mutable std::unique_ptr<PointingDirectionCache> pointingDirectionCache_p;
1225  mutable std::unique_ptr<PointingSource> pointingSource_p;
1226  // default frequency reporting (not selecting) frame of reference
1228  // Subchunk row management object (see above)
1230  // sort columns specified when creating VI
1232  // [own] Info about spectral windows
1233  mutable SpectralWindowChannelsCache * spectralWindowChannelsCache_p;
1234  // (chunkN #, subchunk #) pair
1235  Subchunk subchunk_p;
1236  // [own] Allows const access to casacore::MS's subtable columns
1239  std::shared_ptr<std::mutex> tileCacheModMtx_p;
1240  std::shared_ptr<std::vector<bool> > tileCacheIsSet_p;
1242  VisBufferType vbType;
1243  // [own] VisBuffer attached to this VI
1247 };
1248 
1249 } // end namespace vi
1250 
1251 } //# NAMESPACE CASA - END
1252 
1253 #endif
std::pair< casacore::Bool, FrequencySelections * > popFrequencySelections()
yields ownership
virtual void antenna1(casacore::Vector< casacore::Int > &ant1) const override
Return antenna1.
virtual void processorId(casacore::Vector< casacore::Int > &procids) const override
Return the PROCESSOR_IDs.
virtual const casacore::Vector< casacore::MDirection > & azel(casacore::Double time) const override
virtual void exposure(casacore::Vector< casacore::Double > &expo) const override
Return actual time interval.
A Vector of integers, for indexing into Array&lt;T&gt; objects.
Definition: IPosition.h:119
A Measure: astronomical direction.
Definition: MDirection.h:174
virtual void writeVisCorrected(const casacore::Cube< casacore::Complex > &vis) override
Write/modify the visibilities.
std::unique_ptr< VisibilityIteratorImpl2 > clone() const
Members.
A Measure: position on Earth.
Definition: MPosition.h:79
void getColumnRowsMatrix(const casacore::ArrayColumn< T > &column, casacore::Matrix< T > &array, casacore::Bool correlationSlicing) const
casacore::Double timeMin_p
min timechunk in the chunk
int Int
Definition: aipstype.h:50
SubtableColumns * subtableColumns_p
[own] Allows const access to casacore::MS&#39;s subtable columns
virtual void writeVisObserved(const casacore::Cube< casacore::Complex > &vis) override
MSDerivedValues calculates values derived from a MS.
virtual void visibilityObserved(casacore::Cube< casacore::Complex > &vis) const override
casacore::Bool msHasFlagCategory_p
Does the current casacore::MS have a valid FLAG_CATEGORY?
virtual void writeModel(const casacore::RecordInterface &rec, casacore::Bool iscomponentlist=true, casacore::Bool incremental=false) override
Write/modify the ncorr x nrow SigmaMat.
casacore::MFrequency::Types getObservatoryFrequencyType() const override
void writeFlagCategory(const casacore::Array< casacore::Bool > &fc) override
virtual void timeInterval(casacore::Vector< casacore::Double > &ti) const override
Return nominal time interval.
virtual casacore::Int nAntennas() const override
return number of Ant
static BackWriter * makeBackWriter2(void(VisibilityIteratorImpl2::*setter)(Ret, VisibilityIteratorImpl2::DataColumn), Ret(VisBuffer2::*getter)() const, VisibilityIterator2::DataColumn dc)
const casacore::ROMSAntennaColumns & antennaSubtablecols() const override
virtual void configureNewSubchunk()
set the currently selected table
virtual void scan(casacore::Vector< casacore::Int > &scans) const override
Return scan number.
virtual const vi::ChannelSelector * determineChannelSelection(casacore::Double time, casacore::Int spectralWindowId=-1, casacore::Int polarizationId=-1, casacore::Int msId=-1) const
RowBounds rowBounds_p
Subchunk row management object (see above)
Object to hold type of imaging weight scheme to be used on the fly and to provide facilities to do th...
BackWriterImpl2 is slightly more complicated in that it uses a unary accessor.
casacore::Bool weightSpectrumExists() const override
Determine whether WEIGHT_SPECTRUM exists.
virtual const casacore::Table attachTable() const
returns the table, to which columns are attached, can be overridden in derived classes ...
Main interface class to a read/write table.
Definition: Table.h:153
casacore::Int subchunkBegin_p
first row in current subchunk
virtual casacore::Int msId() const override
reference to actual ms in interator
std::pair< casacore::Bool, casacore::Int > popNRowBlocking()
VisibilityIterator2 iterates through one or more readonly MeasurementSets.
virtual void throwIfPendingChanges()
Throws exception if there is a pending (i.e., unapplied) change to the VI&#39;s properties.
virtual casacore::IPosition visibilityShape() const override
Return the visibility 4-vector of polarizations for each channel.
A class to provide easy access to MSField columns.
virtual void originChunks()
Reset iterator to true start of data (first chunk)
casacore::Bool msHasWeightSpectrum_p
Does the current casacore::MS have a valid WEIGHT_SPECTRUM?
virtual void writeBackChanges(VisBuffer2 *) override
+----------------—+ | | | Writeback Methods | | | +----------------—+
virtual casacore::Bool newFieldId() const
Return true if FieldId/Source has changed since last iteration.
virtual casacore::CountedPtr< WeightScaling > getWeightScaling() const override
virtual const casacore::Vector< casacore::Float > & feed_pa(casacore::Double time) const override
Return feed parallactic angles casacore::Vector (nant) (1 feed/ant)
const casacore::ROMSProcessorColumns & processorSubtablecols() const override
Access to processor subtable.
casacore::Int getReportingFrameOfReference() const override
casacore::MFrequency::Convert makeFrequencyConverter(casacore::Double time, int spectralWindowId, casacore::Int otherFrameOfReference, casacore::Bool toObservedFrame, casacore::Unit) const
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
const casacore::ROMSSourceColumns & sourceSubtablecols() const override
Access to source subtable.
int getMeasurementFrame(int spectralWindowId) const
A class to provide easy read-only access to MSSource columns.
VisibilityIterator2 * getViP() const
Get privileged (non-const) access to the containing ROVI.
const casacore::ROMSSysCalColumns & sysCalSubtablecols() const override
Access to sysCal subtable.
virtual void initialize(const casacore::Block< const casacore::MeasurementSet * > &mss, casacore::Bool useMSIter2=false)
virtual Subchunk getSubchunkId() const override
casacore::Vector< casacore::Int > getChannels(casacore::Double time, casacore::Int frameOfReference, casacore::Int spectralWindowId, casacore::Int msId) const override
casacore::Int nRowBlocking_p
suggested # of rows in a subchunk
VisibilityIteratorImpl2(const casacore::Block< const casacore::MeasurementSet * > &mss, const SortColumns &sortColumns, casacore::Double timeInterval, casacore::Bool isWritable, casacore::Bool useMSIter2=false)
Default constructor - useful only to assign another iterator later VisibilityIteratorImpl2 (); ...
virtual void initWeightSpectrum(const casacore::Cube< casacore::Float > &weightSpectrum) override
Initialize the weightSpectrum column.
casacore::Int getPolarizationId(casacore::Int spectralWindowId, casacore::Int msId) const
void setReportingFrameOfReference(casacore::Int) override
Sets the default frequency reporting frame of reference.
void operator()(VisibilityIteratorImpl2 *vi, VisBuffer2 *vb)
virtual casacore::Bool hasWeightScaling() const override
casacore::Vector< casacore::Stokes::StokesTypes > getCorrelationTypesDefined() const override
virtual void operator()(VisibilityIteratorImpl2 *vi, VisBuffer2 *vb)=0
casacore::Vector< casacore::uInt > chunkRowIds_p
Row numbers of underlying casacore::MS; used to map form chunk rows to casacore::MS rows...
void positionMsIterToASelectedSpectralWindow()
Advances the casacore::MS Iterator until it points at a spectral window that is part of the frequency...
casacore::Bool isInASelectedSpectralWindow() const
Returns true if casacore::MS Iterator is currently pointing to a selected spectral window...
casacore::Int msIndex_p
array index of current MS
virtual void useImagingWeight(const VisImagingWeight &imWgt) override
assign a VisImagingWeight object to this iterator
const casacore::ROMSObservationColumns & observationSubtablecols() const override
Access to observation subtable.
casacore::Double timeMax_p
max timestamp in the chunk
std::shared_ptr< std::vector< bool > > tileCacheIsSet_p
casacore::MeasRef< casacore::MEpoch > timeFrameOfReference_p
virtual void writeFlag(const casacore::Cube< casacore::Bool > &flag) override
Write/modify the flags in the data.
virtual VisBuffer2 * getVisBuffer() const override
virtual casacore::Int nRows() const override
Return the number of rows in the current iteration.
std::unique_ptr< PendingChanges > pendingChanges_p
holds pending changes to VI properties
virtual casacore::Double hourang(casacore::Double time) const override
Return the hour angle for the specified time.
casacore::Vector< casacore::MDirection > azel_p
virtual void dataDescriptionIds(casacore::Vector< casacore::Int > &ddis) const override
virtual void stateId(casacore::Vector< casacore::Int > &stateids) const override
Return the STATE_IDs.
virtual casacore::Bool allBeamOffsetsZero() const override
true if all elements of the cube returned by getBeamOffsets are zero
+========================| | | | Output Related Methods | | | +========================| ...
virtual void allSpectralWindowsSelected(casacore::Vector< casacore::Int > &selectedWindows, casacore::Vector< casacore::Int > &nChannels) const
vi::ChannelSelector * makeChannelSelectorC(const FrequencySelection &selection, casacore::Double time, casacore::Int msId, casacore::Int spectralWindowId, casacore::Int polarizationId) const
Creates a channel selection for the current subchunk based on the channel or frequency selection made...
A class to provide easy read-only access to MSProcessor columns.
VisBuffer2 * vb_p
[own] VisBuffer attached to this VI
const casacore::ROMSPolarizationColumns & polarizationSubtablecols() const override
Access to polarization subtable.
const VisImagingWeight & getImagingWeightGenerator() const override
Return imaging weight (a weight for each channel) virtual casacore::Matrix&lt;casacore::Float&gt; &amp; imagin...
casacore::Vector< casacore::Stokes::StokesTypes > getCorrelationTypesSelected() const override
virtual casacore::Int nRowsInChunk() const override
Return the numbers of rows in the current chunk.
A class to provide easy read-only access to MSWeather columns.
casacore::CountedPtr< WeightScaling > weightScaling_p
static BackWriter * makeBackWriter(void(VisibilityIteratorImpl2::*setter)(Ret), Ret(VisBuffer2::*getter)() const)
Backwriter(2) creation methods.
A class to provide easy read-only access to MSASpectralWindow columns.
void getColumnRows(const casacore::ScalarColumn< T > &column, casacore::Vector< T > &array) const
Methods to get the data out of a table column according to whatever selection criteria (e...
A Measure: instant in time.
Definition: MEpoch.h:104
virtual casacore::Bool isNewSpectralWindow() const override
void convertVisFromStokes(const casacore::Matrix&lt;CStokesVector&gt; &amp; visibilityStokes, casacore::Cube&lt;casacore::Complex&gt; &amp; visCube);
virtual casacore::Int polarizationId() const override
Return current Polarization Id.
A class to provide easy read-only access to MSFreqOffset columns.
virtual void slurp() const override
Return the number of sub-intervals in the current chunk.
std::pair< casacore::Bool, casacore::Double > popInterval()
virtual void feed1(casacore::Vector< casacore::Int > &fd1) const override
Return feed1.
A class to provide easy read-only access to MSState columns.
virtual void flagRow(casacore::Vector< casacore::Bool > &rowflags) const override
Return row flag.
casacore::MSDerivedValues msd_p
Helper class holding casacore::MS derived values.
virtual casacore::Int dataDescriptionId() const override
Return current DataDescription Id.
void jonesC(casacore::Vector< casacore::SquareMatrix< casacore::Complex, 2 > > &cjones) const override
Return feed configuration matrix for specified antenna.
void putColumnRows(casacore::ArrayColumn< T > &column, const casacore::Array< T > &array)
Subchunk subchunk_p
(chunkN #, subchunk #) pair
virtual void visibilityModel(casacore::Cube< casacore::Complex > &vis) const override
defines physical units
Definition: Unit.h:189
virtual casacore::String fieldName() const override
Return the current Field Name.
virtual void weight(casacore::Matrix< casacore::Float > &wt) const override
Return weight.
virtual const casacore::Cube< casacore::Double > & receptorAngles() const override
Return receptor angles for all antennae and feeds First axis of the cube is a receptor number...
const casacore::ROMSStateColumns & stateSubtablecols() const override
Access to state subtable.
const casacore::ROMSFreqOffsetColumns & freqOffsetSubtablecols() const override
Access to freqOffset subtable.
const casacore::ROMSPointingColumns & pointingSubtablecols() const override
Access to pointing subtable.
Cache cache_p
general collection of cached values
std::unique_ptr< PointingDirectionCache > pointingDirectionCache_p
virtual casacore::Int nDataDescriptionIds() const override
virtual void sigmaSpectrum(casacore::Cube< casacore::Float > &sigsp) const override
Return sigmaspectrum(a sigma for each channel)
virtual std::pair< bool, casacore::MDirection > getPointingAngle(int antenna, double time) const override
virtual casacore::Bool newArrayId() const
Return true if arrayID has changed since last iteration.
void setMsColumnCacheSizes(const casacore::MeasurementSet &, const string &)
casacore::Vector< casacore::Int > getCorrelations() const override
const ChannelSelector * createDefaultChannelSelector(casacore::Double time, casacore::Int msId, casacore::Int spectralWindowId)
Referenced counted pointer for constant data.
Definition: VisModelData.h:42
casacore::Bool msIterAtOrigin_p
true if casacore::MS Iter is a start of first MS
virtual void spectralWindows(casacore::Vector< casacore::Int > &spws) const override
virtual void initSigmaSpectrum(const casacore::Cube< casacore::Float > &sigmaSpectrum) override
Initialize the sigmaSpectrum column.
virtual const casacore::Vector< casacore::String > & antennaMounts() const override
return a string mount identifier for each antenna
Fast Square Matrix class with fixed (templated) size.
A class to provide easy read-only access to MSPointing columns.
define a (start,length,increment) along an axis
Definition: Slice.h:93
A class to provide easy read-only access to MSDoppler columns.
const casacore::ROMSDopplerColumns & dopplerSubtablecols() const override
Access to doppler subtable.
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 casacore::Bool isWritable() const override
double Double
Definition: aipstype.h:55
virtual void writeWeight(const casacore::Matrix< casacore::Float > &wt) override
Write/modify the weights.
const ChannelSelector * channelSelector_p
[use] current channel selector for this casacore::MS &amp; Spw
A class to provide easy read-only access to MeasurementSet columns.
Definition: MSColumns.h:111
Class holding the row numbers in a RefTable.
Definition: RefRows.h:85
A class to provide easy read-only access to MSHistory columns.
casacore::Bool sigmaSpectrumExists() const override
Determine whether SIGMA_SPECTRUM exists.
std::map< VisBufferComponent2, BackWriter * > backWriters_p
virtual void time(casacore::Vector< casacore::Double > &t) const override
Return MJD midpoint of interval.
const casacore::ROMSColumns * msColumnsKluge() const
Allow access to the casacore::MSColumns object; for use by VisBuffer2Adapter KLUGE ...
casacore::Block< casacore::MeasurementSet > MeasurementSets
virtual casacore::Vector< casacore::Vector< casacore::Int > > getAllSelectedSpws() const
This will return all selected spwids for each ms attached with this iterator.
std::tuple< casacore::Vector< casacore::Int >, casacore::Vector< casacore::Int >, casacore::Vector< casacore::Int >, casacore::Vector< casacore::Int > > ChannelInfo
virtual void flag(casacore::Cube< casacore::Bool > &flags) const override
Return flag for each polarization, channel and row.
VisImagingWeight imwgt_p
object to calculate imaging weight
virtual void flagCategory(casacore::Array< casacore::Bool > &flagCategories) const override
Return flags for each polarization, channel, category, and row.
virtual void setWeightScaling(casacore::CountedPtr< WeightScaling > weightscaling) override
A class to provide easy read-only access to MSDataDesc columns.
std::shared_ptr< std::mutex > tileCacheModMtx_p
casacore::Vector< casacore::Float > parang_p
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
virtual casacore::Double getInterval() const override
Return the time interval (in seconds) used for iteration.
virtual casacore::String keyChange() const override
Report Name of slowest column that changes at end of current iteration.
Read and write access to an array table column with arbitrary data type.
Definition: Reweighter.h:48
virtual void writeSigma(const casacore::Matrix< casacore::Float > &sig) override
Write/modify the Sigma.
virtual casacore::Int getNMs() const override
casacore::CountedPtr< casacore::MSIter > msIter_p
casacore::MS Iter that underlies the VI (sweeps in chunks)
virtual void setRowBlocking(casacore::Int nRows=0) override
Set the &#39;blocking&#39; size for returning data.
ChannelSelectorCache * channelSelectorCache_p
[own] cache of recently used channel selectors
virtual casacore::Bool existsColumn(VisBufferComponent2 id) const override
virtual const casacore::Float & parang0(casacore::Double time) const override
Return nominal parallactic angle at specified time (does not include feed position angle offset–see f...
virtual const casacore::Vector< casacore::Float > & parang(casacore::Double time) const override
Per antenna:
casacore::Vector< casacore::Float > getReceptor0Angle() override
float Float
Definition: aipstype.h:54
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; wtm...
virtual void arrayIds(casacore::Vector< casacore::Int > &) const override
Return the current ArrayId.
casacore::Bool floatDataFound_p
true if a float data column was found
const casacore::ROMSHistoryColumns & historySubtablecols() const override
Access to history subtable.
virtual casacore::Int polFrame() const override
Return frame for polarization(returns PolFrame enum)
BackWriterImpl2(Setter setter, Getter getter, DataColumn dc)
virtual casacore::String sourceName() const override
Return the current Source Name.
casacore::RefRows subchunkRows_p
subchunk&#39;s table row numbers
virtual casacore::Int nSpectralWindows() const override
Return number of spws, polids, ddids.
virtual casacore::Int nRowsViWillSweep() const override
Return number of rows in all selected ms&#39;s.
virtual void nextChunk() override
Advance to the next Chunk of data.
virtual void setTileCache()
Adjusts the tile cache for some columns so that the cache size is optimized for the current input sta...
virtual casacore::Int spectralWindow() const override
Return current SpectralWindow.
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.
casacore::Vector< casacore::Double > times_p
times for each row in the chunk
virtual void weightSpectrum(casacore::Cube< casacore::Float > &wtsp) const override
Return weightspectrum(a weight for each channel)
virtual void configureNewChunk()
set the iteration state
virtual void timeCentroid(casacore::Vector< casacore::Double > &t) const override
Return MJD centroid of interval.
VisibilityIterator2::DataColumn DataColumn
VLAT should not access private parts, especially variables.
virtual void observationId(casacore::Vector< casacore::Int > &obsids) const override
Return the OBSERVATION_IDs.
ChannelInfo getChannelInformationUsingFrequency(casacore::Bool now) const
A Table intended to hold astronomical data (a set of Measurements).
casacore::Int chunkNRows_p
last row in current chunk
casacore::Matrix< casacore::Float > imagingWeight_p
simple 1-D array
const casacore::ROMSFieldColumns & fieldSubtablecols() const override
Access to field subtable.
const casacore::ROMSSpWindowColumns & spectralWindowSubtablecols() const override
Access to spectralWindow subtable.
const casacore::ROMSFeedColumns & feedSubtablecols() const override
Access to feed subtable.
virtual casacore::MEpoch getEpoch() const override
virtual casacore::Vector&lt;casacore::MPosition&gt; antennaPositions () const; casacore::MSDerivedValues m...
virtual void writeVisModel(const casacore::Cube< casacore::Complex > &vis) override
virtual casacore::Int nPolarizationIds() const override
std::unique_ptr< PointingSource > pointingSource_p
virtual casacore::String ViiType() const override
Report the the ViImplementation type TBD: indicate writable?
virtual void feed2(casacore::Vector< casacore::Int > &fd2) const override
Return feed2.
virtual void origin() override
Reset iterator to origin/start of data (of current chunk)
virtual casacore::MDirection azel0(casacore::Double time) const override
Return the antenna AZ/EL casacore::Vector(nant)
A class to provide easy read-only access to MSObservation columns.
Definition: MSObsColumns.h:80
SpectralWindowChannelsCache * spectralWindowChannelsCache_p
[own] Info about spectral windows
VisBuffer2s encapsulate one chunk of visibility data for processing.
Definition: VisBuffer2.h:141
virtual void uvw(casacore::Matrix< casacore::Double > &uvwmat) const override
Return u,v and w (in meters)
vi::ChannelSelector * makeChannelSelectorF(const FrequencySelection &selection, casacore::Double time, casacore::Int msId, casacore::Int spectralWindowId, casacore::Int polarizationId) const
casacore::MPosition getObservatoryPosition() const override
A class to provide easy read-only access to MSPolarization columns.
Definition: MSPolColumns.h:75
virtual const casacore::Cube< casacore::RigidVector< casacore::Double, 2 > > & getBeamOffsets() const override
Return a cube containing pairs of coordinate offsets for each receptor of each feed (values are in ra...
virtual void visibilityCorrected(casacore::Cube< casacore::Complex > &vis) const override
Return the visibilities as found in the casacore::MS, casacore::Cube(npol,nchan,nrow).
A class to provide easy read-only access to MSFeed columns.
Definition: MSFeedColumns.h:84
VisibilityIterator2 iterates through one or more readonly MeasurementSets.
casacore::Vector< casacore::Double > getFrequencies(casacore::Double time, casacore::Int frameOfReference, casacore::Int spectralWindowId, casacore::Int msId) const override
virtual void corrType(casacore::Vector< casacore::Int > &corrTypes) const override
Return the correlation type (returns casacore::Stokes enums)
A class to provide easy read-only access to MSAntenna columns.
FrequencySelections * frequencySelections_p
[own] Current frequency selection
const casacore::MSDerivedValues & getMsd() const
Provides access to the casacore::MS-derived values object.
String: the storage and methods of handling collections of characters.
Definition: String.h:223
casacore::Bool msHasSigmaSpectrum_p
Does the current casacore::MS have a valid SIGMA_SPECTRUM?
virtual const casacore::MDirection & phaseCenter() const override
Return the current phase center as an MDirection.
void setFrequencySelections(FrequencySelections *)
takes ownership
const casacore::ROMSWeatherColumns & weatherSubtablecols() const override
Access to weather subtable.
virtual ~VisibilityIteratorImpl2()
Destructor.
virtual casacore::Bool more() const override
Return false if no more data (in current chunk)
casacore::Int subchunkEnd_p
last row in current subchunk
virtual casacore::Bool isNewMs() const override
virtual casacore::Bool newSpectralWindow() const
Return true if SpectralWindow has changed since last iteration.
const casacore::ROMSDataDescColumns & dataDescriptionSubtablecols() const override
Access to dataDescription subtable.
A simple BackWriterImpl2 uses a nullary accessor on a VisBuffer.
virtual void sigma(casacore::Matrix< casacore::Float > &sig) const override
Return sigma.
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.
Access to a scalar table column with arbitrary data type.
Definition: MSFitsOutput.h:41
virtual void setInterval(casacore::Double timeInterval) override
Set or reset the time interval (in seconds) to use for iteration.
casacore::Block< casacore::MeasurementSet > getMeasurementSets() const
Returns the casacore::MS objects that this VI is iterating over.
virtual void next() override
advance the iteration
virtual void setFrequencySelections(const FrequencySelections &selection) override
Select the channels to be returned.
void operator()(VisibilityIteratorImpl2 *vi, VisBuffer2 *vb)
SortColumns sortColumns_p
sort columns specified when creating VI
Abstract base class for Record classes.
virtual const SortColumns & getSortColumns() const override
Types
Types of known MFrequencies Warning: The order defines the order in the translation matrix FromTo in...
Definition: MFrequency.h:176
virtual void attachColumns(const casacore::Table &t)
ViColumns2 columns_p
The main columns for the current MS.
casacore::Int reportingFrame_p
default frequency reporting (not selecting) frame of reference
virtual void antenna2(casacore::Vector< casacore::Int > &ant2) const override
Return antenna2.
virtual void fieldIds(casacore::Vector< casacore::Int > &) const override
Return the current FieldId.
casacore::Bool more_p
true if more data in this chunk
void setMsCacheSizes(const casacore::MeasurementSet &ms, std::vector< casacore::MSMainEnums::PredefinedColumns > columnIds)
const casacore::ROMSFlagCmdColumns & flagCmdSubtablecols() const override
Access to flagCmd subtable.
virtual casacore::Bool isNewFieldId() const override
virtual void writeSigmaSpectrum(const casacore::Cube< casacore::Float > &sigsp) override
Write/modify the sigmaSpectrum.
virtual void addDataSelection(const casacore::MeasurementSet &ms)
Ctor auxiliary method.
virtual const casacore::MeasurementSet & ms() const override
reference to actual ms in interator
A class to provide easy read-only access to MSFlagCmd columns.
bool fillFromVirtualModel(casacore::Cube< casacore::Complex > &value) const
A class to provide easy read-only access to MSSysCal columns.
casacore::Bool flagCategoryExists() const override
Determine whether FLAG_CATEGORY is valid.
casacore::Vector< casacore::Float > feedpa_p
virtual casacore::Bool moreChunks() const override
Return false if no more &#39;Chunks&#39; of data left.
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
ChannelInfo getChannelInformation(casacore::Bool now) const
virtual void getRowIds(casacore::Vector< casacore::uInt > &rowids) const override
Return the row ids as from the original root table.
virtual void writeFlagRow(const casacore::Vector< casacore::Bool > &rowflags) override
Write/modify the flag row column; dimension casacore::Vector(nrow)
casacore::Slice findChannelsInRange(casacore::Double lowerFrequency, casacore::Double upperFrequency, const vi::SpectralWindowChannels &spectralWindowChannels) const
casacore::Int measurementFrame_p
cached value of observatory type
VisibilityIteratorImpl2 & operator=(const VisibilityIteratorImpl2 &vii)
virtual casacore::String msName() const override
Name of the MS in the interator.
virtual casacore::Bool isNewArrayId() const override
Check if ms has change since last iteration.
virtual const vi::SubtableColumns & subtableColumns() const override
Get the spw, start and nchan for all the ms&#39;s is this Visiter that match the frequecy &quot;freqstart-freq...
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42