casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
VisBufferImpl2.h
Go to the documentation of this file.
1 //# VisBuffer.h: buffer for iterating through casacore::MS in large blocks
2 //# Copyright (C) 1996,1997,1998,1999,2000,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 
27 #ifndef MSVIS_VISBUFFERIMPL2_H
28 #define MSVIS_VISBUFFERIMPL2_H
29 
30 #include <casa/aips.h>
31 
32 //#warning "Remove next line later"
33 //# include <msvis/MSVis/VisBuffer.h>
34 
35 #include <casa/Arrays/Cube.h>
36 #include <casa/Arrays/Vector.h>
37 #include <casa/Arrays/Matrix.h>
38 #include <casa/BasicSL/Complex.h>
40 #include <msvis/MSVis/VisBuffer2.h>
41 
44 
45 namespace casa { //# NAMESPACE CASA - BEGIN
46 
47 class VisModelDataI;
48 
49 namespace asyncio {
50  class VLAT;
51 } // end namespace asyncio
52 
53 namespace ms {
54  class Vbi2MsRow;
55 }
56 
57 namespace vi {
58 
59 //#forward
60 
61 class VbCacheItemBase;
62 class VisBufferCache;
63 class VisBufferState;
64 class VisBufferImpl2;
65 class ViImplementation2;
66 
67 namespace avg {
68 
69  class VbAvg;
70 }
71 
72 namespace tavg {
73 
74  class VbAvg;
75 }
76 
77 
78 
79 //<summary>VisBufferImpls encapsulate one chunk of visibility data for processing.</summary>
80 //
81 // <use visibility=export>
82 //
83 // <reviewed reviewer="" date="" tests="" demos="">
84 
85 // <prerequisite>
86 // <li> <linkto class="VisSet">VisSet</linkto>
87 // <li> <linkto class="ViImplementation2">ViImplementation2</linkto>
88 // <li> <linkto class="VisBufferImplAutoPtr">VisBufferImplAutoPtr</linkto>
89 // <li> <linkto class="VbDirtyComponents">VbDirtyComponents</linkto>
90 // </prerequisite>
91 //
92 // <etymology>
93 // VisBufferImpl is a buffer for visibility data
94 // </etymology>
95 //
96 //<synopsis>
97 // This class contains 'one iteration' of the
98 // <linkto class="ViImplementation2">ViImplementation2</linkto>
99 // It is a modifiable
100 // buffer of values to which calibration and averaging can be applied.
101 // This allows processing of the data in larger blocks, avoiding some
102 // overheads for processing per visibility point or spectrum.
103 //
104 // See <linkto module="MeasurementEquations">MeasurementEquations</linkto>
105 // for more details on how the VisBufferImpl is to be used.
106 //
107 // When the user intends to allow asynchronous I/O they will need to use
108 // the VisBufferImplAsync and VisBufferImplAsyncWrapper classes; these are
109 // publicly derived from VisBufferImpl. Normally, the user should not
110 // explicitly use these classes but should use the helper class
111 // VisBufferImplAutoPtr which will ensure that the appropriate class is
112 // used.
113 //
114 //</synopsis>
115 
116 //<todo>
117 //</todo>
118 
119 class VisBufferImpl2 : public VisBuffer2 {
120 
121  friend class VLAT; // for async i/o
122  friend class casa::vi::avg::VbAvg;
123  friend class casa::vi::tavg::VbAvg;
124  friend class AveragingTvi2;
125  friend class VbCacheItemBase;
126  friend class VisBufferCache;
127  friend class VisBufferState;
128  friend class casa::vi::VisBuffer2;
129  friend class VisBuffer2Adapter;
130  friend class VisBufferImpl2Async; // for async i/o
131  friend class VisBufferImpl2AsyncWrapper; // for async i/o
132  friend class ViReadImpl;
133  friend class ViReadImplAsync; // for async I/O
134  friend class casa::ms::Vbi2MsRow;
135 
136 public:
137 
138  // Create empty VisBufferImpl2 you can assign to or attach.
140  // Construct VisBufferImpl2 for a particular ViImplementation2
141  // The buffer will remain synchronized with the iterator.
142 
144 
145  // Destructor (detaches from VisIter)
146 
147  virtual ~VisBufferImpl2();
148 
149  void appendRow (ms::Vbi2MsRow * rowSrc, casacore::Int initialCapacity,
150  const VisBufferComponents2 & optionalComponentsToCopy,
151  bool doCopy = true);
152  void appendRowsComplete ();
153  casacore::Int appendSize () const;
154 
155  // Copies all of the components (or just the one in the cache) from
156  // the specified VisBuffer into this one.
157 
158  virtual void copy (const VisBuffer2 & other, casacore::Bool fetchIfNeeded = true);
159 
160  // Copies the specified components (or just the one in the cache) from
161  // the specified VisBuffer into this one.
162 
163  virtual void copyComponents (const VisBuffer2 & other,
164  const VisBufferComponents2 & components,
165  casacore::Bool allowShapeChange = false,
166  casacore::Bool fetchIfNeeded = true);
167 
168  virtual void copyCoordinateInfo (const VisBuffer2 * vb, casacore::Bool dirDependent,
169  casacore::Bool allowShapeChange = false, casacore::Bool fetchIfNeeded = true);
170 
173 
175  virtual casacore::String getFillErrorMessage () const;
176  virtual casacore::Double getFrequency (casacore::Int rowInBuffer, casacore::Int frequencyIndex, casacore::Int frame = FrameNotSpecified) const;
178  casacore::Int frame = FrameNotSpecified) const;
179  virtual casacore::Int getChannelNumber (casacore::Int rowInBuffer, casacore::Int frequencyIndex) const;
180  virtual const casacore::Vector<casacore::Int> & getChannelNumbers (casacore::Int rowInBuffer) const;
182 
183  ms::MsRow * getRow (casacore::Int row) const;
185 
186  virtual void invalidate();
187 
188  virtual casacore::Bool isAttached () const;
189  virtual casacore::Bool isFillable () const;
191  virtual void validateShapes () const;
192 
193  virtual void writeChangesBack ();
194  virtual void initWeightSpectrum (const casacore::Cube<casacore::Float>& wtspec);
195  virtual void initSigmaSpectrum (const casacore::Cube<casacore::Float>& sigspec);
196 
197  // Reference to underlying MS, via the Vii
198  virtual const casacore::MeasurementSet& ms() const;
199  virtual const vi::SubtableColumns & subtableColumns () const;
201 
202  //--> This needs to be removed: virtual casacore::Bool fetch(const asyncio::PrefetchColumns *pfc);
203 
204  // feed1_pa() and feed2_pa() return an array of parallactic angles
205  // (each corresponds to the first receptor of the feed) one for each
206  // row in the current buffer. In contrast, feed_pa() calculates
207  // the angles for each antenna. These methods are implemented for
208  // VisBufferImpl2 only to benefit from caching of the feed and antenna IDs.
209 
210  // Note that feed_pa is a function instead of a cached value
212 
213  // NOMINAL parallactic angle (feed p.a. offset NOT included)
216 
217  virtual casacore::MDirection azel0(casacore::Double time) const; // function rather than cached value
219 
220  // Hour angle for specified time
222 
223  // casacore::Sort/unsort the correlations, if necessary
224  // (Rudimentary handling of non-canonically sorted correlations--use with care!)
225  virtual void sortCorr ();
226  virtual void unSortCorr();
227 
228  // Normalize the visCube by the modelVisCube
229  // (and optionally also divide visCube_p by its normalized amp)
230 
231  virtual void normalize ();
232 
233  // Rotate visibility phase for given vector (dim = nrow of vb) of phases (metres)
235  // Rotate visibility phase for phase center offsets (arcsecs)
237 
238  // Fill weightMat according to sigma column
239  virtual void resetWeightsUsingSigma ();//virtual void resetWeightMat();
240 
241  // Rotate visibility phase for given vector (dim = nrow of vb) of phases (metres)
242 
243  // Update coordinate info - useful for copied VisBufferImpl2s that need
244  // to retain some state for later reference.
245  // Presently this fills antenna, array, field and spectralWindow ids, time,
246  // frequency and number of rows.
247  // if dirDependent is set to false the expensive direction dependent calculation of parallactic or direction of
248  // antenna from pointing table is avoided
249  //Add more as needed.
250 
251  virtual casacore::Bool isNewArrayId () const;
252  virtual casacore::Bool isNewFieldId () const;
253  virtual casacore::Bool isNewMs() const;
254  virtual casacore::Bool isNewSpectralWindow () const;
255  virtual casacore::Bool isRekeyable () const;
256  virtual casacore::Bool isWritable () const;
257  virtual casacore::IPosition getShape () const;
258  virtual casacore::Int msId() const;
259  virtual casacore::String msName (casacore::Bool stripPath = false) const;
260  virtual Subchunk getSubchunk () const;
261 
262  virtual casacore::Bool areCorrelationsSorted() const;
264  virtual VisModelDataI * getVisModelData() const;
265 
266 
268  //
269  // casacore::Data accessors and setters (where appropriate)
270  //
271  // There are the methods that allows access to the items cached in the
272  // VisBuffer. The straight accessors provide read-only access to the
273  // item. Where the item is allowed to be modified, one or more set
274  // methods are provided. N.B.: the VB usually caches the information
275  // in the representation requested so that using a setter to modify
276  // a value (e.g., weight vs. weightMat) will not modify the cached value
277  // in a different representation.
278 
279  virtual const casacore::Vector<casacore::Int> & antenna1 () const;
280  virtual void setAntenna1 (const casacore::Vector<casacore::Int> & value);
281  virtual const casacore::Vector<casacore::Int> & antenna2 () const;
282  virtual void setAntenna2 (const casacore::Vector<casacore::Int> & value);
283  virtual const casacore::Vector<casacore::Int> & arrayId () const;
284  virtual void setArrayId (const casacore::Vector<casacore::Int> &);
286  virtual const casacore::Vector<casacore::Int> & correlationTypes () const;
287 // virtual casacore::Int dataDescriptionId () const;
288 // virtual void setDataDescriptionId (casacore::Int value);
289  virtual const casacore::Vector<casacore::Int> & dataDescriptionIds () const;
290  virtual void setDataDescriptionIds (const casacore::Vector<casacore::Int> & ); // [nR]
291  virtual const casacore::Vector<casacore::MDirection> & direction1 () const;
292  virtual const casacore::Vector<casacore::MDirection> & direction2 () const;
293  virtual const casacore::Vector<casacore::Double> & exposure () const;
295  virtual const casacore::Vector<casacore::Int> & feed1 () const;
296  virtual void setFeed1 (const casacore::Vector<casacore::Int> & value);
297  virtual const casacore::Vector<casacore::Float> & feedPa1 () const;
298  virtual const casacore::Vector<casacore::Int> & feed2 () const;
299  virtual void setFeed2 (const casacore::Vector<casacore::Int> & value);
300  virtual const casacore::Vector<casacore::Float> & feedPa2 () const;
301  virtual const casacore::Vector<casacore::Int> & fieldId () const;
302  virtual void setFieldId (const casacore::Vector<casacore::Int> &);
303 // virtual const casacore::Matrix<casacore::Bool> & flag () const;
304 // virtual void setFlag (const casacore::Matrix<casacore::Bool>&);
305  virtual const casacore::Array<casacore::Bool> & flagCategory () const;
306  virtual void setFlagCategory (const casacore::Array<casacore::Bool>&);
307  virtual const casacore::Cube<casacore::Bool> & flagCube () const;
308  virtual void setFlagCube (const casacore::Cube<casacore::Bool>&);
309  virtual const casacore::Vector<casacore::Bool> & flagRow () const;
310  virtual void setFlagRow (const casacore::Vector<casacore::Bool>&);
311  virtual const casacore::Matrix<casacore::Float> & imagingWeight () const;
312  void setImagingWeight (const casacore::Matrix<casacore::Float> & newImagingWeights);
313  virtual casacore::Int nAntennas () const;
314  virtual casacore::Int nChannels () const;
315  virtual casacore::Int nCorrelations () const;
316  virtual casacore::Int nRows () const;
317  virtual const casacore::Vector<casacore::Int> & observationId () const;
319  virtual const casacore::MDirection& phaseCenter () const;
320  virtual casacore::Int polarizationFrame () const;
321  virtual casacore::Int polarizationId () const;
322  virtual const casacore::Vector<casacore::Int> & processorId () const;
324  virtual const casacore::Vector<casacore::uInt> & rowIds () const;
325  virtual const casacore::Vector<casacore::Int> & scan () const;
326  virtual void setScan (const casacore::Vector<casacore::Int> & value);
327  virtual const casacore::Matrix<casacore::Float> & sigma () const;
328  virtual void setSigma (const casacore::Matrix<casacore::Float> &);
329  //virtual const casacore::Matrix<casacore::Float> & sigmaMat () const;
330  //virtual casacore::Int spectralWindow () const;
331  virtual const casacore::Vector<casacore::Int> & spectralWindows () const;
333  virtual const casacore::Vector<casacore::Int> & stateId () const;
334  virtual void setStateId (const casacore::Vector<casacore::Int> & value);
335  virtual const casacore::Vector<casacore::Double> & time () const;
336  virtual void setTime (const casacore::Vector<casacore::Double> & value);
337  virtual const casacore::Vector<casacore::Double> & timeCentroid () const;
339  virtual const casacore::Vector<casacore::Double> & timeInterval () const;
341  virtual const casacore::Matrix<casacore::Double> & uvw () const;
342  virtual void setUvw (const casacore::Matrix<casacore::Double> & value);
343  virtual const casacore::Cube<casacore::Complex> & visCubeCorrected () const;
345 // virtual const casacore::Matrix<CStokesVector> & visCorrected () const;
346 // virtual void setVisCorrected (const casacore::Matrix<CStokesVector> &);
347  virtual const casacore::Cube<casacore::Float> & visCubeFloat () const;
348  virtual void setVisCubeFloat (const casacore::Cube<casacore::Float> &);
349  virtual const casacore::Cube<casacore::Complex> & visCubeModel () const;
350  virtual void setVisCubeModel (const casacore::Complex & c);
351  virtual void setVisCubeModel (const casacore::Cube<casacore::Complex>& vis);
352 // virtual void setVisCubeModel(const casacore::Vector<casacore::Float>& stokes);
353  virtual void setVisCubeModel(const casacore::Vector<casacore::Float>& stokes); // by supplied Stokes vector
354 // virtual void setVisModel (casacore::Matrix<CStokesVector> &);
355  virtual const casacore::Cube<casacore::Complex> & visCube () const;
356  virtual void setVisCube(const casacore::Complex & c);
357  virtual void setVisCube (const casacore::Cube<casacore::Complex> &);
358 // virtual const casacore::Matrix<CStokesVector> & vis () const;
359 // virtual void setVis (casacore::Matrix<CStokesVector> &);
360  virtual const casacore::Matrix<casacore::Float> & weight () const;
361  virtual void setWeight (const casacore::Matrix<casacore::Float>&);
362  virtual const casacore::Cube<casacore::Float> & weightSpectrum () const;
364  virtual const casacore::Cube<casacore::Float> & sigmaSpectrum () const;
366 
367 protected:
368 
369  //virtual void cacheCopy (const VisBufferImpl2 & other, casacore::Bool markAsCached);
370 
372  casacore::Bool useWeightSpectrum,
375  casacore::Int nChannelsOut);
376  void adjustWeightAndSigmaMatrices (casacore::Int nChannelsAveraged, casacore::Int nChannelsOut, casacore::Int nRows,
377  casacore::Int nCorrelations, casacore::Int nChannelsSelected,
378  const casacore::Matrix <casacore::Float> & rowWeightFactors);
379 
381  const casacore::Vector<casacore::Int> & channels,
382  const casacore::Matrix<casacore::Int> & averagingBounds);
383 
384  void averageFlagInfoChannels (const casacore::Matrix<casacore::Int> & averagingBounds,
385  casacore::Int nChannelsOut, casacore::Bool useWeightSpectrum);
386 
387  template<typename T>
388  void averageVisCubeChannels (T & dataCache,
389  casacore::Int nChanOut,
390  const casacore::Matrix<casacore::Int>& averagingbounds);
391 
392  virtual void cacheClear (casacore::Bool markAsCached = false);
393  virtual void cacheResizeAndZero (const VisBufferComponents2 & exclusions = VisBufferComponents2());
394 
395  virtual void checkVisIter (const char * func, const char * file, int line, const char * extra = "") const;
396  void computeRowWeightFactors (casacore::Matrix <casacore::Float> & rowWeightFactors, casacore::Bool useWeightSpectrum);
399  casacore::Bool isNewSpectralWindow, const Subchunk & subchunk,
401  const casacore::Vector<casacore::Int> & correlations,
402  const casacore::Vector<casacore::Stokes::StokesTypes> & correlationsDefined,
403  const casacore::Vector<casacore::Stokes::StokesTypes> & correlationsSelected,
405 
406  virtual void copyRow (casacore::Int sourceRow, casacore::Int destinationRow);
407  virtual void deleteRows (const casacore::Vector<casacore::Int> & rowsToDelete);
408  virtual void dirtyComponentsAdd (const VisBufferComponents2 & additionalDirtyComponents);
409  virtual void dirtyComponentsAdd (VisBufferComponent2 component);
410  virtual void dirtyComponentsClear ();
411  virtual VisBufferComponents2 dirtyComponentsGet () const;
412  virtual void dirtyComponentsSet (const VisBufferComponents2 & dirtyComponents);
413  virtual void dirtyComponentsSet (VisBufferComponent2 component);
414  virtual casacore::Bool hasShape () const;
418 
419  virtual void sortCorrelationsAux (casacore::Bool makeSorted);
420  virtual ViImplementation2 * getViiP () const; // protected, non-const access to VI
422  virtual void resizeRows (casacore::Int newNRows);
423  virtual void stateCopy (const VisBufferImpl2 & other); // copy relevant noncached members
424  virtual void setFillable (casacore::Bool isFillable);
425  virtual void setRekeyable (casacore::Bool isRekeyable);
426  virtual bool setWritability (bool newWritability); // override;
427  virtual void setupValidShapes ();
428  template <typename Coord>
429  void updateCoord (Coord & item, const Coord & otherItem);
430 
431  virtual casacore::Vector<casacore::Bool> & flagRowRef (); // [nR]
432  virtual casacore::Cube<casacore::Bool> & flagCubeRef (); // [nC,nF,nR]
433  virtual casacore::Cube<casacore::Complex> & visCubeRef (); // [nC,nF,nR]
434  virtual casacore::Cube<casacore::Complex> & visCubeCorrectedRef (); // [nC,nF,nR]
435  virtual casacore::Cube<casacore::Complex> & visCubeModelRef (); // [nC,nF,nR]
436  virtual casacore::Cube<casacore::Float> & weightSpectrumRef (); // [nC,nF,nR]
437  virtual casacore::Cube<casacore::Float> & sigmaSpectrumRef (); // [nC,nF,nR]
438 
448  const Subchunk & subchunk, const casacore::Vector<casacore::Int> & correlations,
449  const casacore::Vector<casacore::Stokes::StokesTypes> & correlationsDefined,
450  const casacore::Vector<casacore::Stokes::StokesTypes> & correlationsSelected,
454 
455 private:
456 
458  void checkVisIterBase (const char * func, const char * file, int line, const char * extra = "") const;
460  void constructCache();
461  virtual void validate();
462 
464  //
465  // Fillers
466  //
467  // These methods fill the needed value into the cache. This
468  // usually means getting it from the attached ViImplementation2
469  // but the needed value can be generated as well.
470  //
471  // The name of the filler should match up with the accessor method
472  // (see above) as well as the member name in the cache (see
473  // VisBufferCache class in VisBuffer.cc).
474 
475 
476  virtual void fillAntenna1 (casacore::Vector<casacore::Int>& value) const;
477  virtual void fillAntenna2 (casacore::Vector<casacore::Int>& value) const;
478  virtual void fillArrayId (casacore::Vector<casacore::Int>& value) const;
479  virtual void fillCorrType (casacore::Vector<casacore::Int>& value) const;
483  virtual void fillDataDescriptionId (casacore::Int& value) const;
488  const casacore::Vector<casacore::Int> & antenna,
492  virtual void fillFeed1 (casacore::Vector<casacore::Int>& value) const;
493  virtual void fillFeed2 (casacore::Vector<casacore::Int>& value) const;
497  const casacore::Vector <casacore::Int> & antenna,
498  const casacore::Vector <casacore::Int> & feed) const;
499  virtual void fillFieldId (casacore::Vector<casacore::Int>& value) const;
500  virtual void fillFlag (casacore::Matrix<casacore::Bool>& value) const;
502  virtual void fillFlagCube (casacore::Cube<casacore::Bool>& value) const;
503  virtual void fillFlagRow (casacore::Vector<casacore::Bool>& value) const;
507  virtual void fillNAntennas (casacore::Int& value) const;
508  virtual void fillNChannel (casacore::Int& value) const;
509  virtual void fillNCorr (casacore::Int& value) const;
510  virtual void fillNRow (casacore::Int& value) const;
512  virtual void fillPhaseCenter (casacore::MDirection& value) const;
513  virtual void fillPolFrame (casacore::Int& value) const;
514  virtual void fillPolarizationId (casacore::Int& value) const;
516  virtual void fillRowIds (casacore::Vector<casacore::uInt>& value) const;
517  virtual void fillScan (casacore::Vector<casacore::Int>& value) const;
518  virtual void fillSigma (casacore::Matrix<casacore::Float>& value) const;
519  //virtual void fillSigmaMat (casacore::Matrix<casacore::Float>& value) const;
520  //virtual void fillSpectralWindow (casacore::Int& value) const;
522  virtual void fillStateId (casacore::Vector<casacore::Int>& value) const;
523  virtual void fillTime (casacore::Vector<casacore::Double>& value) const;
526  virtual void fillUvw (casacore::Matrix<casacore::Double>& value) const;
527 // virtual void fillVisibilityCorrected (casacore::Matrix<CStokesVector>& value) const;
528 // virtual void fillVisibilityModel (casacore::Matrix<CStokesVector>& value) const;
529 // virtual void fillVisibilityObserved (casacore::Matrix<CStokesVector>& value) const;
530  virtual void fillWeight (casacore::Matrix<casacore::Float>& value) const;
531  //virtual void fillWeightMat (casacore::Matrix<casacore::Float>& value) const;
534 
538 };
539 
540 } // end namespace vi
541 
542 } // end namespace casa
543 
544 
545 #endif
546 
virtual casacore::Bool isRekeyable() const
virtual const casacore::Cube< casacore::Bool > & flagCube() const
A Vector of integers, for indexing into Array&lt;T&gt; objects.
Definition: IPosition.h:119
virtual void fillPhaseCenter(casacore::MDirection &value) const
A Measure: astronomical direction.
Definition: MDirection.h:174
virtual casacore::Float parang0(casacore::Double time) const
NOMINAL parallactic angle (feed p.a.
void appendRow(ms::Vbi2MsRow *rowSrc, casacore::Int initialCapacity, const VisBufferComponents2 &optionalComponentsToCopy, bool doCopy=true)
A 1-D Specialization of the Array class.
virtual VisModelDataI * getVisModelData() const
void adjustWeightAndSigmaMatrices(casacore::Int nChannelsAveraged, casacore::Int nChannelsOut, casacore::Int nRows, casacore::Int nCorrelations, casacore::Int nChannelsSelected, const casacore::Matrix< casacore::Float > &rowWeightFactors)
int Int
Definition: aipstype.h:50
virtual const casacore::Vector< casacore::Double > & exposure() const
virtual const casacore::Cube< casacore::Complex > & visCube() const
virtual void setVisModel (casacore::Matrix&lt;CStokesVector&gt; &amp;);
virtual const casacore::Cube< casacore::Float > & weightSpectrum() const
virtual const casacore::Matrix&lt;casacore::Float&gt; &amp; weightMat () const = 0; // [nC,nR] virtual void set...
ms::MsRow * getRow(casacore::Int row) const
virtual casacore::Vector< casacore::Int > getCorrelationTypes() const
virtual casacore::Cube< casacore::Float > & weightSpectrumRef()
casacore::Bool sigmaSpectrumPresent() const
virtual void setShape(casacore::Int nCorrelations, casacore::Int nChannels, casacore::Int nRows, casacore::Bool clearTheCache=true)
virtual void fillDataDescriptionIds(casacore::Vector< casacore::Int > &value) const
virtual casacore::Bool isNewSpectralWindow() const
virtual void fillNCorr(casacore::Int &value) const
friend class casa::vi::tavg::VbAvg
VisBufferImpl2(VisBufferOptions options=VbNoOptions)
Create empty VisBufferImpl2 you can assign to or attach.
void normalizeRow(casacore::Int row, casacore::Int nCorrelations, const casacore::Cube< casacore::Bool > &flagged, casacore::Cube< casacore::Complex > &visCube, casacore::Cube< casacore::Complex > &modelCube, casacore::Matrix< casacore::Float > &weightMat)
virtual casacore::Bool isNewArrayId() const
Rotate visibility phase for given vector (dim = nrow of vb) of phases (metres)
virtual void fillTime(casacore::Vector< casacore::Double > &value) const
casacore::uInt row() const
virtual const casacore::MDirection & phaseCenter() const
Returns the phase center of the array for the specified row.
virtual void fillProcessorId(casacore::Vector< casacore::Int > &value) const
casacore::Float getSigmaScaled(casacore::Int row) const
virtual const casacore::Vector< casacore::MDirection > & direction1() const
virtual void setVisCube(const casacore::Complex &c)
virtual casacore::Int getChannelNumber(casacore::Int rowInBuffer, casacore::Int frequencyIndex) const
virtual casacore::MDirection azel0(casacore::Double time) const
virtual void fillSigmaSpectrum(casacore::Cube< casacore::Float > &value) const
virtual casacore::Vector< casacore::Int > getChannelNumbersSelected(casacore::Int outputChannelIndex) const
virtual const casacore::Cube< casacore::Complex > & visCubeModel() const
void setIterationInfo(casacore::Int msId, const casacore::String &msName, casacore::Bool isNewMs, casacore::Bool isNewArrayId, casacore::Bool isNewFieldId, casacore::Bool isNewSpectralWindow, const Subchunk &subchunk, const casacore::Vector< casacore::Int > &correlations, const casacore::Vector< casacore::Stokes::StokesTypes > &correlationsDefined, const casacore::Vector< casacore::Stokes::StokesTypes > &correlationsSelected, casacore::CountedPtr< WeightScaling > weightScaling)
virtual casacore::Cube< casacore::Complex > & visCubeCorrectedRef()
virtual casacore::String getFillErrorMessage() const
class MsRowAttributes {
Definition: MsRows.h:131
virtual void fillDataDescriptionId(casacore::Int &value) const
virtual void fillNChannel(casacore::Int &value) const
virtual casacore::Cube< casacore::Float > & sigmaSpectrumRef()
virtual const casacore::Vector< casacore::Float > & feedPa(casacore::Double time) const
–&gt; This needs to be removed: virtual casacore::Bool fetch(const asyncio::PrefetchColumns *pfc); ...
virtual const casacore::Cube< casacore::Complex > & visCubeCorrected() const
virtual const casacore::Matrix&lt;CStokesVector&gt; &amp; vis () const = 0; // [nF,nR] virtual void setVis (cas...
virtual void setSigma(const casacore::Matrix< casacore::Float > &)
TableExprNode phase(const TableExprNode &node)
The phase (i.e.
Definition: ExprNode.h:1405
VisBufferState * state_p
virtual ViImplementation2 * getViiP() const
void updateCoord(Coord &item, const Coord &otherItem)
virtual casacore::Bool areCorrelationsSorted() const
virtual casacore::Bool hasShape() const
virtual void writeChangesBack()
virtual void configureNewSubchunk(casacore::Int msId, const casacore::String &msName, casacore::Bool isNewMs, casacore::Bool isNewArrayId, casacore::Bool isNewFieldId, casacore::Bool isNewSpectralWindow, const Subchunk &subchunk, casacore::Int nRows, casacore::Int nChannels, casacore::Int nCorrelations, const casacore::Vector< casacore::Int > &correlations, const casacore::Vector< casacore::Stokes::StokesTypes > &correlationsDefined, const casacore::Vector< casacore::Stokes::StokesTypes > &correlationsSelected, casacore::CountedPtr< WeightScaling > weightScaling)
virtual void fillDirection2(casacore::Vector< casacore::MDirection > &value) const
void computeRowWeightFactors(casacore::Matrix< casacore::Float > &rowWeightFactors, casacore::Bool useWeightSpectrum)
virtual void fillSpectralWindows(casacore::Vector< casacore::Int > &value) const
virtual void fillSigmaMat (casacore::Matrix&lt;casacore::Float&gt;&amp; value) const; virtual void fillSpectral...
virtual void checkVisIter(const char *func, const char *file, int line, const char *extra="") const
friend class casa::vi::avg::VbAvg
virtual casacore::Bool isWritable() const
virtual void fillFeedPa2(casacore::Vector< casacore::Float > &feedPa) const
virtual casacore::IPosition getValidShape(casacore::Int) const
casacore::Data accessors and one or more set methods are provided N weight vs weightMat will not modify the cached value in a different representation *virtual const casacore::Vector< casacore::Int > & antenna1() const
virtual const casacore::Vector< casacore::Int > & processorId() const
virtual void deleteRows(const casacore::Vector< casacore::Int > &rowsToDelete)
VisBufferOptions
These are options to be applied to a VisBuffer, usually when it&#39;s created.
Definition: VisBuffer2.h:80
virtual casacore::IPosition getShape() const
virtual void setTimeCentroid(const casacore::Vector< casacore::Double > &value)
virtual casacore::String msName(casacore::Bool stripPath=false) const
virtual void fillFlagRow(casacore::Vector< casacore::Bool > &value) const
virtual casacore::Bool areCorrelationsInCanonicalOrder() const
virtual void setSpectralWindows(const casacore::Vector< casacore::Int > &spectralWindows)
virtual const casacore::Matrix< casacore::Float > & weight() const
virtual const casacore::Matrix&lt;CStokesVector&gt; &amp; vis () const; virtual void setVis (casacore::Matrix&lt;C...
virtual void fillExposure(casacore::Vector< casacore::Double > &value) const
virtual casacore::Bool isNewMs() const
void construct(ViImplementation2 *vi, VisBufferOptions options)
virtual casacore::Int nRows() const
Returns the number of rows in this VisBuffer.
virtual void setArrayId(const casacore::Vector< casacore::Int > &)
virtual const casacore::Vector< casacore::Float > & feedPa2() const
Calculates the parallactic angle for feed 0 of the row&#39;s Antenna2.
virtual casacore::Vector< casacore::Bool > & flagRowRef()
virtual void cacheClear(casacore::Bool markAsCached=false)
virtual const casacore::Vector< casacore::Int > & scan() const
virtual casacore::Int nCorrelations() const
Returns the number of correlations along the visCube correlation axis.
void registerCacheItem(VbCacheItemBase *)
VisBufferCache * cache_p
virtual void setWeightSpectrum(const casacore::Cube< casacore::Float > &)
virtual void setObservationId(const casacore::Vector< casacore::Int > &value)
virtual const casacore::Vector< casacore::Int > & correlationTypes() const
Returns the correlation type of each correlation in the VisCube.
virtual void fillImagingWeight(casacore::Matrix< casacore::Float > &value) const
virtual void unSortCorr()
virtual void setFlagCube(const casacore::Cube< casacore::Bool > &)
Options options
virtual void setExposure(const casacore::Vector< casacore::Double > &value)
virtual void fillCubeObserved(casacore::Cube< casacore::Complex > &value) const
virtual casacore::Vector< casacore::Stokes::StokesTypes > getCorrelationTypesSelected() const
virtual casacore::Bool isNewFieldId() const
casa::ms::Vbi2MsRow * msRow_p
virtual void fillFeed2(casacore::Vector< casacore::Int > &value) const
virtual const casacore::Array< casacore::Bool > & flagCategory() const
virtual const casacore::Matrix&lt;casacore::Bool&gt; &amp; flag () const; virtual void setFlag (const casacore:...
virtual void fillJonesC(casacore::Vector< casacore::SquareMatrix< casacore::Complex, 2 > > &value) const
virtual const casacore::Vector< casacore::Bool > & flagRow() const
friend class VisBufferImpl2AsyncWrapper
virtual void sortCorr()
casacore::Sort/unsort the correlations, if necessary (Rudimentary handling of non-canonically sorted ...
virtual void resetWeightsUsingSigma()
Fill weightMat according to sigma column.
virtual void copy(const VisBuffer2 &other, casacore::Bool fetchIfNeeded=true)
Copies all of the components (or just the one in the cache) from the specified VisBuffer into this on...
virtual void copyRow(casacore::Int sourceRow, casacore::Int destinationRow)
virtual void setFillable(casacore::Bool isFillable)
virtual void dirtyComponentsAdd(const VisBufferComponents2 &additionalDirtyComponents)
virtual void normalize()
Normalize the visCube by the modelVisCube (and optionally also divide visCube_p by its normalized amp...
virtual void setFlagRow(const casacore::Vector< casacore::Bool > &)
Referenced counted pointer for constant data.
Definition: VisModelData.h:42
virtual void fillCubeModel(casacore::Cube< casacore::Complex > &value) const
Fast Square Matrix class with fixed (templated) size.
virtual const casacore::Vector< casacore::Double > & time() const
virtual void setFeed1(const casacore::Vector< casacore::Int > &value)
void adjustWeightFactorsAndFlags(casacore::Matrix< casacore::Float > &rowWeightFactors, casacore::Bool useWeightSpectrum, casacore::Int nRows, casacore::Int nCorrelations, casacore::Int nChannelsOut)
virtual void cacheCopy (const VisBufferImpl2 &amp; other, casacore::Bool markAsCached); ...
virtual const casacore::Vector< casacore::Int > & getChannelNumbers(casacore::Int rowInBuffer) const
virtual const casacore::Vector< casacore::Int > & antenna2() const
virtual void fillWeight(casacore::Matrix< casacore::Float > &value) const
virtual void fillVisibilityCorrected (casacore::Matrix&lt;CStokesVector&gt;&amp; value) const; virtual void fil...
virtual bool setWritability(bool newWritability)
virtual const casacore::Vector< casacore::Float > & parang(casacore::Double time) const
Calculates the parallactic angle of each antenna in the array at the specified time.
double Double
Definition: aipstype.h:55
virtual casacore::Cube< casacore::Complex > & visCubeModelRef()
virtual void fillFeed1(casacore::Vector< casacore::Int > &value) const
virtual casacore::Int msId() const
virtual void setFieldId(const casacore::Vector< casacore::Int > &)
virtual void fillFeedPaAux(casacore::Vector< casacore::Float > &feedPa, const casacore::Vector< casacore::Int > &antenna, const casacore::Vector< casacore::Int > &feed) const
virtual void fillStateId(casacore::Vector< casacore::Int > &value) const
virtual void fillRowIds(casacore::Vector< casacore::uInt > &value) const
friend class VisBufferImpl2Async
virtual void setAntenna2(const casacore::Vector< casacore::Int > &value)
casacore::Int averageChannelFrequencies(casacore::Int nChannelsOut, const casacore::Vector< casacore::Int > &channels, const casacore::Matrix< casacore::Int > &averagingBounds)
virtual const casacore::Vector< casacore::Int > & fieldId() const
virtual const vi::SubtableColumns & subtableColumns() const
virtual void fillArrayId(casacore::Vector< casacore::Int > &value) const
virtual const casacore::Matrix< casacore::Float > & sigma() const
virtual void setWeight(const casacore::Matrix< casacore::Float > &)
virtual VisBufferComponents2 dirtyComponentsGet() const
virtual void fillWeightSpectrum(casacore::Cube< casacore::Float > &value) const
virtual void fillWeightMat (casacore::Matrix&lt;casacore::Float&gt;&amp; value) const;
virtual const casacore::Vector< casacore::Int > & stateId() const
virtual const casacore::Matrix&lt;casacore::Float&gt; &amp; sigmaMat () const = 0; // [nC,nR] ...
virtual void fillDirectionAux(casacore::Vector< casacore::MDirection > &value, const casacore::Vector< casacore::Int > &antenna, const casacore::Vector< casacore::Int > &feed, const casacore::Vector< casacore::Float > &feedPa) const
virtual const casacore::Vector< casacore::Int > & spectralWindows() const
virtual const casacore::Matrix&lt;casacore::Float&gt; &amp; sigmaMat () const; virtual casacore::Int spectralWi...
virtual const casacore::Matrix< casacore::Double > & uvw() const
virtual void setFlagCategory(const casacore::Array< casacore::Bool > &)
virtual casacore::Double hourang(casacore::Double time) const
Hour angle for specified time.
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
void setImagingWeight(const casacore::Matrix< casacore::Float > &newImagingWeights)
virtual void fillPolFrame(casacore::Int &value) const
virtual const casacore::Matrix< casacore::Float > & imagingWeight() const
This method returns the imagin g If an imaging weight generator has not been supplied to the associat...
virtual casacore::Cube< casacore::Bool > & flagCubeRef()
virtual Subchunk getSubchunk() const
virtual casacore::Int nAntennas() const
float Float
Definition: aipstype.h:54
virtual void fillDirection1(casacore::Vector< casacore::MDirection > &value) const
virtual void fillPolarizationId(casacore::Int &value) const
virtual void fillTimeInterval(casacore::Vector< casacore::Double > &value) const
virtual casacore::Int polarizationId() const
virtual void setSigmaSpectrum(const casacore::Cube< casacore::Float > &value)
virtual const casacore::Vector< casacore::Int > & feed2() const
A Table intended to hold astronomical data (a set of Measurements).
virtual void fillCorrType(casacore::Vector< casacore::Int > &value) const
virtual casacore::Bool isAttached() const
virtual void setVisCubeCorrected(const casacore::Cube< casacore::Complex > &)
virtual void phaseCenterShift(const casacore::Vector< casacore::Double > &phase)
Rotate visibility phase for given vector (dim = nrow of vb) of phases (metres)
virtual void setFeed2(const casacore::Vector< casacore::Int > &value)
virtual ~VisBufferImpl2()
Destructor (detaches from VisIter)
virtual void setAntenna1(const casacore::Vector< casacore::Int > &value)
virtual casacore::Cube< casacore::Complex > & visCubeRef()
virtual void fillFieldId(casacore::Vector< casacore::Int > &value) const
virtual void fillFlagCategory(casacore::Array< casacore::Bool > &value) const
virtual void setDataDescriptionIds(const casacore::Vector< casacore::Int > &)
virtual const casacore::Vector< casacore::Double > & timeCentroid() const
virtual const casacore::Vector< casacore::Int > & feed1() const
virtual void setScan(const casacore::Vector< casacore::Int > &value)
VisBuffer2s encapsulate one chunk of visibility data for processing.
Definition: VisBuffer2.h:141
virtual void fillFloatData(casacore::Cube< casacore::Float > &value) const
virtual void fillFlagCube(casacore::Cube< casacore::Bool > &value) const
virtual void setUvw(const casacore::Matrix< casacore::Double > &value)
virtual void fillObservationId(casacore::Vector< casacore::Int > &value) const
virtual const casacore::Vector< casacore::Int > & dataDescriptionIds() const
virtual casacore::Int dataDescriptionId () const; virtual void setDataDescriptionId (casacore::Int va...
virtual const casacore::MeasurementSet & ms() const
Reference to underlying MS, via the Vii.
virtual void setVisCubeFloat(const casacore::Cube< casacore::Float > &)
virtual void initWeightSpectrum(const casacore::Cube< casacore::Float > &wtspec)
VisibilityIterator2 iterates through one or more readonly MeasurementSets.
virtual void setRekeyable(casacore::Bool isRekeyable)
const Double c
Fundamental physical constants (SI units):
virtual const casacore::Cube< casacore::Float > & visCubeFloat() const
virtual const casacore::Matrix&lt;CStokesVector&gt; &amp; visCorrected () const; virtual void setVisCorrected (...
casacore::Int appendSize() const
virtual void fillUvw(casacore::Matrix< casacore::Double > &value) const
String: the storage and methods of handling collections of characters.
Definition: String.h:223
virtual void dirtyComponentsClear()
virtual void validate()
virtual const casacore::Vector< casacore::Double > & getFrequencies(casacore::Int rowInBuffer, casacore::Int frame=FrameNotSpecified) const
virtual void fillTimeCentroid(casacore::Vector< casacore::Double > &value) const
virtual const casacore::Cube< casacore::Float > & sigmaSpectrum() const
virtual const casacore::Vector< casacore::MDirection > & azel(casacore::Double time) const
Returns the pointing angle for each antenna in the array at the specified time.
virtual void resizeRows(casacore::Int newNRows)
virtual const casacore::Vector< casacore::Int > & observationId() const
void averageVisCubeChannels(T &dataCache, casacore::Int nChanOut, const casacore::Matrix< casacore::Int > &averagingbounds)
virtual casacore::Double getFrequency(casacore::Int rowInBuffer, casacore::Int frequencyIndex, casacore::Int frame=FrameNotSpecified) const
virtual void fillSigma(casacore::Matrix< casacore::Float > &value) const
virtual void stateCopy(const VisBufferImpl2 &other)
vi::VisBuffer2 * vb() const
casacore::Float getWeightScaled(casacore::Int row) const
virtual const casacore::Matrix&lt;CStokesVector&gt; &amp; visModel () const = 0; // [nF,nR] virtual void setVis...
virtual void fillFeedPa1(casacore::Vector< casacore::Float > &feedPa) const
ms::MsRow * getRowMutable(casacore::Int row)
void checkVisIterBase(const char *func, const char *file, int line, const char *extra="") const
This class encapsulates an enum with values corresponding to the various data components accessible v...
virtual const casacore::Vector< casacore::Double > & timeInterval() const
virtual const casacore::Vector< casacore::uInt > & rowIds() const
The returned casacore::Vector serves as a map between the rows in the VisBuffer and the row IDs in th...
virtual void setProcessorId(const casacore::Vector< casacore::Int > &value)
virtual void fillNRow(casacore::Int &value) const
virtual const casacore::Vector< casacore::MDirection > & direction2() const
virtual void setTimeInterval(const casacore::Vector< casacore::Double > &value)
virtual void validateShapes() const
virtual void fillScan(casacore::Vector< casacore::Int > &value) const
virtual void setVisCubeModel(const casacore::Complex &c)
VisBufferImpls encapsulate one chunk of visibility data for processing.
virtual casacore::Int polarizationFrame() const
Returns the polarization frame for the specified row.
virtual void setTime(const casacore::Vector< casacore::Double > &value)
void averageFlagInfoChannels(const casacore::Matrix< casacore::Int > &averagingBounds, casacore::Int nChannelsOut, casacore::Bool useWeightSpectrum)
virtual const casacore::Vector< casacore::SquareMatrix< casacore::Complex, 2 > > & cjones() const
Returns the Jones C matrix for each antenna.
virtual void fillFlag(casacore::Matrix< casacore::Bool > &value) const
virtual casacore::Bool existsColumn(VisBufferComponent2 id) const
virtual casacore::Int nChannels() const
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
virtual casacore::Bool isFillable() const
virtual void setStateId(const casacore::Vector< casacore::Int > &value)
virtual casacore::CountedPtr< WeightScaling > getWeightScaling() const
virtual void dirtyComponentsSet(const VisBufferComponents2 &dirtyComponents)
virtual void fillNAntennas(casacore::Int &value) const
virtual void fillCubeCorrected(casacore::Cube< casacore::Complex > &value) const
virtual const casacore::Vector< casacore::Float > & feedPa1() const
Calculates the parallactic angle for feed 0 of the row&#39;s Antenna1.
virtual const casacore::Vector< casacore::Int > & arrayId() const
virtual void copyCoordinateInfo(const VisBuffer2 *vb, casacore::Bool dirDependent, casacore::Bool allowShapeChange=false, casacore::Bool fetchIfNeeded=true)
Copies the coordinate components (or just the ones in the cache if fetchIfNeeded is false) from the s...
virtual void setupValidShapes()
virtual casacore::Vector< casacore::Stokes::StokesTypes > getCorrelationTypesDefined() const
casacore::Bool weightSpectrumPresent() const
virtual void cacheResizeAndZero(const VisBufferComponents2 &exclusions=VisBufferComponents2())
virtual void sortCorrelationsAux(casacore::Bool makeSorted)
virtual void initSigmaSpectrum(const casacore::Cube< casacore::Float > &sigspec)
virtual void copyComponents(const VisBuffer2 &other, const VisBufferComponents2 &components, casacore::Bool allowShapeChange=false, casacore::Bool fetchIfNeeded=true)
Copies the specified components (or just the one in the cache) from the specified VisBuffer into this...
Defines nreal time structures used by the VLA table filler.
Definition: nreal.h:100
virtual void invalidate()