VisibilityIteratorImplAsync2.h

Go to the documentation of this file.
00001 //# VisibilityIterator.h: Step through the MeasurementEquation by visibility
00002 //# Copyright (C) 1996,1997,1998,1999,2000,2001,2002,2003
00003 //# Associated Universities, Inc. Washington DC, USA.
00004 //#
00005 //# This library is free software; you can redistribute it and/or modify it
00006 //# under the terms of the GNU Library General Public License as published by
00007 //# the Free Software Foundation; either version 2 of the License, or (at your
00008 //# option) any later version.
00009 //#
00010 //# This library is distributed in the hope that it will be useful, but WITHOUT
00011 //# ANY WARRANTY; without even the Implied warranty of MERCHANTABILITY or
00012 //# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00013 //# License for more details.
00014 //#
00015 //# You should have received a copy of the GNU Library General Public License
00016 //# along with this library; if not, write to the Free Software Foundation,
00017 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
00018 //#
00019 //# Correspondence concerning AIPS++ should be addressed as follows:
00020 //#        Internet email: aips2-request@nrao.edu.
00021 //#        Postal address: AIPS++ Project Office
00022 //#                        National Radio Astronomy Observatory
00023 //#                        520 Edgemont Road
00024 //#                        Charlottesville, VA 22903-2475 USA
00025 //#
00026 //# $Id: VisibilityIterator2.h,v 19.14 2006/02/28 04:48:58 mvoronko Exp $
00027 
00028 #ifndef MSVIS_VISIBILITYITERATORIMPLASYNC2_H
00029 #define MSVIS_VISIBILITYITERATORIMPLASYNC2_H
00030 
00031 #include <casa/Arrays/Cube.h>
00032 #include <casa/Arrays/Matrix.h>
00033 #include <casa/Arrays/Slicer.h>
00034 #include <casa/BasicSL/String.h>
00035 #include <casa/Containers/Stack.h>
00036 #include <casa/Quanta/MVDoppler.h>
00037 #include <casa/aips.h>
00038 #include <measures/Measures/MCDoppler.h>
00039 #include <measures/Measures/MDoppler.h>
00040 #include <measures/Measures/MeasConvert.h>
00041 #include <measures/Measures/Stokes.h>
00042 #include <ms/MSOper/MSDerivedValues.h>
00043 #include <ms/MeasurementSets/MSIter.h>
00044 #include <ms/MeasurementSets/MSColumns.h>
00045 #include <ms/MeasurementSets/MeasurementSet.h>
00046 #include <scimath/Mathematics/RigidVector.h>
00047 #include <scimath/Mathematics/SquareMatrix.h>
00048 #include <msvis/MSVis/StokesVector.h>
00049 #include <msvis/MSVis/VisBufferComponents2.h>
00050 #include <msvis/MSVis/VisBufferImplAsync2.h>
00051 #include <msvis/MSVis/VisImagingWeight.h>
00052 #include <msvis/MSVis/VisibilityIterator2.h>
00053 #include <tables/Tables/ArrayColumn.h>
00054 #include <tables/Tables/ScalarColumn.h>
00055 
00056 #include <map>
00057 #include <vector>
00058 
00059 namespace casa { //# NAMESPACE CASA - BEGIN
00060 
00061 namespace vi {
00062 
00063 //# forward decl
00064 
00065 class AsynchronousInterface;
00066 class VisBuffer2;
00067 class VisBufferAsyncWrapper2;
00068 class VlaData;
00069 
00070 // <summary>
00071 // VisibilityIterator2 iterates through one or more readonly MeasurementSets
00072 // </summary>
00073 
00074 // <use visibility=export>
00075 
00076 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
00077 // </reviewed>
00078 
00079 // <prerequisite>
00080 //   <li> <linkto class="MSIter">MSIter</linkto>
00081 //   <li> <linkto class="MeasurementSet">MeasurementSet</linkto>
00082 //   <li> <linkto class="VisSet">VisSet</linkto>
00083 // </prerequisite>
00084 //
00085 // <etymology>
00086 // The VisibilityIterator2 is a readonly iterator returning visibilities
00087 // </etymology>
00088 //
00089 // <synopsis>
00090 // VisibilityIterator2 provides iteration with various sort orders
00091 // for one or more MSs. It has member functions to retrieve the fields
00092 // commonly needed in synthesis calibration and imaging.
00093 //
00094 // One should use <linkto class="VisBuffer">VisBuffer</linkto>
00095 // to access chunks of data.
00096 // </synopsis>
00097 //
00098 // <example>
00099 // <code>
00100 // //
00101 // </code>
00102 // </example>
00103 //
00104 // <motivation>
00105 // For imaging and calibration you need to access an MS in some consistent
00106 // order (by field, spectralwindow, time interval etc.). This class provides
00107 // that access.
00108 // </motivation>
00109 //
00110 // <thrown>
00111 //    <li>
00112 //    <li>
00113 // </thrown>
00114 //
00115 // <todo asof="1997/05/30">
00116 //   <li> cleanup the currently dual interface for visibilities and flags
00117 //   <li> sort out what to do with weights when interpolating
00118 // </todo>
00119 
00120 class VisibilityIteratorImplAsync2 : public VisibilityIteratorImpl2 {
00121 
00122     friend class AsyncEnabler;
00123     friend class ViImplAsync2;
00124     friend class VisibilityIterator2;
00125     friend class VLAT; // allow VI lookahead thread class to access protected functions
00126     // VLAT should not access private parts, especially variables
00127 
00128 public:
00129 
00130     //# the following is a copy of the enum in MSIter
00131     //# can't think of a way to get one that known to the outside world from here
00132     //  enum PolFrame {
00133     //    // Circular polarization
00134     //    Circular=0,
00135     //    // Linear polarization
00136     //    Linear=1
00137     //  };
00138     //
00139     //  enum DataColumn {
00140     //    // Observed data
00141     //    Observed=0,
00142     //    // Model data
00143     //    Model,
00144     //    // Corrected data
00145     //    Corrected
00146     //  };
00147 
00148     //    class AsyncEnabler {
00149     //    public:
00150     //        AsyncEnabler (VisibilityIterator2 &);
00151     //        AsyncEnabler (VisibilityIterator2 *);
00152     //        ~AsyncEnabler ();
00153     //
00154     //        void release ();
00155     //
00156     //    private:
00157     //
00158     //        Bool oldEnabledState_p;
00159     //        VisibilityIterator2 * roVisibilityIterator2_p;
00160     //    };
00161 
00162     // Default constructor - useful only to assign another iterator later
00164 
00165     // Construct from an MS and a Block of MS column enums specifying the
00166     // iteration order.  If no order is specified, it uses the default sort
00167     // order of MSIter, which is not necessarily the raw order of ms!
00168     // The default ordering is ARRAY_ID, FIELD_ID, DATA_DESC_ID,
00169     // and TIME, but check MSIter.h to be sure.
00170     // These columns will be added first if they are not specified.
00171     //
00172     // An optional timeInterval (in seconds) can be given to iterate through
00173     // chunks of time.  The default interval of 0 groups all times together.
00174     // Every 'chunk' of data contains all data within a certain time interval and
00175     // with identical values of the other iteration columns (e.g.  DATA_DESC_ID
00176     // and FIELD_ID).  Using selectChannel (), a number of groups of channels can
00177     // be requested.  At present the channel group iteration will always occur
00178     // before the interval iteration.
00179 //    VisibilityIteratorImplAsync (const MeasurementSet & ms,
00180 //                                const Block<Int> & sortColumns,
00181 //                                Double timeInterval = 0);
00182 
00183     // Same as above, but with the option of using the raw order of ms
00184     // (addDefaultSortCols=false).
00185 //    VisibilityIteratorImplAsync (const MeasurementSet & ms,
00186 //                                const Block<Int> & sortColumns, const Bool addDefaultSortCols,
00187 //                                Double timeInterval = 0);
00188 
00189     // Same as previous constructors, but with multiple MSs to iterate over.
00190 //    VisibilityIteratorImplAsync (const Block<MeasurementSet> & mss,
00191 //                                const Block<Int> & sortColumns,
00192 //                                Double timeInterval = 0);
00193 
00194     VisibilityIteratorImplAsync2 (VisibilityIterator2 * rovi,
00195                                   const Block<MeasurementSet> & mss,
00196                                   const Block<Int> & sortColumns,
00197                                   Bool addDefaultSortCols,
00198                                   Double timeInterval,
00199                                   Bool createVb,
00200                                   Bool isWritable);
00201 
00202     // Copy construct. This calls the assigment operator.
00203     VisibilityIteratorImplAsync2 (const VisibilityIteratorImplAsync2 & other,
00204                                   VisibilityIterator2 * rovi);
00205 
00206     // Destructor
00207     virtual ~VisibilityIteratorImplAsync2 ();
00208 
00209         // Members
00210 
00211     // Reset iterator to origin/start of data (of current chunk)
00212     virtual void origin ();
00213     // Reset iterator to true start of data (first chunk)
00214     virtual void originChunks ();
00215 
00216     // Return the time interval (in seconds) used for iteration.
00217     // This is not the same as the INTERVAL column.
00218 
00219     // Set or reset the time interval (in seconds) to use for iteration.
00220     // You should call originChunks () to reset the iteration after
00221     // calling this.
00222 
00223     virtual void setInterval (Double timeInterval);
00224 
00225     // Set the 'blocking' size for returning data.
00226     // With the default (0) only a single integration is returned at a time, this
00227     // is what is currently required for the calibration software. With blocking
00228     // set, up to nRows can be returned in one go. The chunk
00229     // size determines the actual maximum.
00230 
00231     virtual void setRowBlocking (Int nRows = 0);
00232 
00233     virtual Bool existsColumn (VisBufferComponent2 id) const;
00234 
00235     // Return False if no more data (in current chunk)
00236 
00237     virtual Bool more () const;
00238 
00239     virtual Subchunk getSubchunkId () const;
00240 
00241     virtual void setFrequencySelections (const FrequencySelections & selection);
00242 
00243     // Return False if no more 'Chunks' of data left
00244 
00245     virtual Bool moreChunks () const;
00246 
00247     // Check if ms has change since last iteration
00248 
00249     virtual Bool isNewArrayId () const;
00250     virtual Bool isNewFieldId () const;
00251     virtual Bool isNewMs () const;
00252     virtual Bool isNewSpectralWindow () const;
00253 
00254     virtual Int msId () const;
00255 
00256     //reference to actual ms in interator
00257     virtual const MeasurementSet & ms () const;
00258 
00259     // Advance to the next Chunk of data
00260     virtual void nextChunk ();
00261 
00262     // Return antenna1
00263     virtual void antenna1 (Vector<Int> & ant1) const;
00264 
00265     // Return antenna2
00266     virtual void antenna2 (Vector<Int> & ant2) const;
00267 
00268     // Return feed1
00269     virtual void feed1 (Vector<Int> & fd1) const;
00270 
00271     // Return feed2
00272     virtual void feed2 (Vector<Int> & fd2) const;
00273 
00274 
00275     // Return feed configuration matrix for specified antenna
00276     void jonesC (Vector<SquareMatrix<Complex, 2> > & cjones) const;
00277 
00278     // Return receptor angles for all antennae and feeds
00279     // First axis of the cube is a receptor number,
00280     // 2nd is antennaId, 3rd is feedId
00281     // Note: the method is intended to provide an access to MSIter::receptorAngles
00282     // for VisBuffer in the multi-feed case. It may be worth to change the
00283     // interface of feed_pa to return the information for all feeds.
00284     virtual const Cube<Double> & receptorAngles () const;
00285 
00286     // return a string mount identifier for each antenna
00287     virtual const Vector<String> & antennaMounts () const;
00288 
00289     // Return a cube containing pairs of coordinate offsets for each
00290     // receptor of each feed (values are in radians, coordinate system is fixed
00291     // with antenna and is the same one as used to define the BEAM_OFFSET
00292     // parameter in the feed table). The cube axes are receptor, antenna, feed.
00293     virtual const Cube<RigidVector<Double, 2> > & getBeamOffsets () const;
00294 
00295     // Return the current FieldId
00296 
00297     virtual Int fieldId () const;
00298 
00299     // Return the current ArrayId
00300     virtual Int arrayId () const;
00301 
00302     // Return flag for each polarization, channel and row
00303     virtual void flag (Cube<Bool> & flags) const;
00304 
00305     // Return flag for each channel & row
00306     virtual void flag (Matrix<Bool> & flags) const;
00307 
00308     // Determine whether FLAG_CATEGORY is valid.
00309     Bool existsFlagCategory() const;
00310 
00311     // Return flags for each polarization, channel, category, and row.
00312     virtual void flagCategory (Array<Bool> & flagCategories) const;
00313 
00314     // Return row flag
00315     virtual void flagRow (Vector<Bool> & rowflags) const;
00316 
00317     // Return scan number
00318     virtual void scan (Vector<Int> & scans) const;
00319 
00320     // Return the OBSERVATION_IDs
00321     virtual void observationId (Vector<Int> & obsids) const;
00322 
00323     // Return the PROCESSOR_IDs
00324     virtual void processorId (Vector<Int> & procids) const;
00325 
00326     // Return the STATE_IDs
00327     virtual void stateId (Vector<Int> & stateids) const;
00328 
00329     // Return the current phase center as an MDirection
00330     virtual const MDirection & phaseCenter () const;
00331 
00332     // Return frame for polarization (returns PolFrame enum)
00333     virtual Int polFrame () const;
00334 
00335     // Return the correlation type (returns Stokes enums)
00336     virtual void corrType (Vector<Int> & corrTypes) const;
00337 
00338     // Return sigma
00339     virtual void sigma (Vector<Float> & sig) const;
00340 
00341     // Return sigma matrix (pol-dep)
00342     virtual void sigmaMat (Matrix<Float> & sigmat) const;
00343 
00344     // Return current SpectralWindow
00345     virtual Int spectralWindow () const;
00346 
00347     // Return current Polarization Id
00348     virtual Int polarizationId () const;
00349 
00350     // Return current DataDescription Id
00351     virtual Int dataDescriptionId () const;
00352 
00353     // Return MJD midpoint of interval.
00354     virtual void time (Vector<Double> & t) const;
00355 
00356     // Return MJD centroid of interval.
00357     virtual void timeCentroid (Vector<Double> & t) const;
00358 
00359     // Return nominal time interval
00360     virtual void timeInterval (Vector<Double> & ti) const;
00361 
00362     // Return actual time interval
00363     virtual void  exposure (Vector<Double> & expo) const;
00364 
00365     // Return the visibilities as found in the MS, Cube (npol,nchan,nrow).
00366     virtual void visibilityCorrected (Cube<Complex> & vis) const;
00367     virtual void visibilityModel (Cube<Complex> & vis) const;
00368     virtual void visibilityObserved (Cube<Complex> & vis) const;
00369 
00370     // Return FLOAT_DATA as a Cube (npol, nchan, nrow) if found in the MS.
00371     virtual void floatData (Cube<Float> & fcube) const;
00372 
00373     // Return the visibility 4-vector of polarizations for each channel.
00374     // If the MS doesn't contain all polarizations, it is assumed it
00375     // contains one or two parallel hand polarizations.
00376     virtual void visibilityCorrected (Matrix<CStokesVector> & vis) const;
00377     virtual void visibilityModel (Matrix<CStokesVector> & vis) const;
00378     virtual void visibilityObserved (Matrix<CStokesVector> & vis) const;
00379 
00380     // Return the shape of the visibility Cube
00381     virtual IPosition visibilityShape () const;
00382 
00383     // Return u,v and w (in meters)
00384 
00385     virtual void uvw (Matrix<Double> & uvwmat) const;
00386 
00387     // Return weight
00388     virtual void weight (Vector<Float> & wt) const;
00389 
00390     // Returns the nPol_p x curNumRow_p weight matrix
00391     virtual void weightMat (Matrix<Float> & wtmat) const;
00392 
00393     // Determine whether WEIGHT_SPECTRUM exists.
00394     Bool existsWeightSpectrum () const;
00395 
00396     // Return weightspectrum (a weight for each channel)
00397     virtual void weightSpectrum (Cube<Float> & wtsp) const;
00398 
00399     // Return imaging weight (a weight for each channel)
00400     //virtual Matrix<Float> & imagingWeight (Matrix<Float> & wt) const;
00401     const VisImagingWeight & getImagingWeightGenerator () const;
00402 
00403     // Return True if FieldId/Source has changed since last iteration
00404     virtual Bool newFieldId () const;
00405 
00406     // Return True if arrayID has changed since last iteration
00407     virtual Bool newArrayId () const;
00408 
00409     // Return True if SpectralWindow has changed since last iteration
00410     virtual Bool newSpectralWindow () const;
00411 
00412     // Return the number of correlations in the current iteration
00413 
00414     virtual Int nPolarizations () const;
00415 
00416     // Return the number of rows in the current iteration
00417     virtual Int nRows () const;
00418 
00419     // Return the row ids as from the original root table. This is useful
00420     // to find correspondance between a given row in this iteration to the
00421     // original ms row
00422     virtual void getRowIds (Vector<uInt> & rowids) const;
00423 
00424     // Return the numbers of rows in the current chunk
00425 
00426     virtual Int nRowsInChunk () const;
00427 
00428     // Return the number of sub-intervals in the current chunk
00429 
00430     //virtual Int nSubInterval () const;
00431 
00432     // Call to use the slurp i/o method for all scalar columns. This
00433     // will set the BucketCache cache size to the full column length
00434     // and cause the full column to be cached in memory, if
00435     // any value of the column is used. In case of out-of-memory,
00436     // it will automatically fall-back on the smaller cache size.
00437     // Slurping the column is to be considered as a work-around for the
00438     // Table i/o code, which uses BucketCache and performs extremely bad
00439     // for random access. Slurping is useful when iterating non-sequentially
00440     // an MS or parts of an MS, it is not tested with multiple MSs.
00441     virtual void slurp () const;
00442 
00443     // Get the spw, start  and nchan for all the ms's is this Visiter that
00444     // match the frequecy "freqstart-freqStep" and "freqEnd+freqStep" range
00445     // Can help in doing channel selection above..
00446     // freqFrame is the frame the caller frequency values are in (freqStart and freqEnd)
00447     // These will be converted to the frame of the selected spw to match
00448 
00449 //    virtual void getSpwInFreqRange (Block<Vector<Int> > & spw,
00450 //                                    Block<Vector<Int> > & start,
00451 //                                    Block<Vector<Int> > & nchan,
00452 //                                    Double freqStart, Double freqEnd,
00453 //                                    Double freqStep, MFrequency::Types freqFrame = MFrequency::LSRK) const;
00454 
00455     // Get the range of frequency convered by the selected data in the frame requested
00456 
00457 //    virtual void getFreqInSpwRange(Double& freqStart, Double& freqEnd, MFrequency::Types freqframe = MFrequency::LSRK) const;
00458 
00459     // Access the current ROMSColumns object in MSIter
00460     virtual const vi::SubtableColumns & subtableColumns () const;
00461 
00462     // get back the selected spectral windows and spectral channels for
00463     // current ms
00464 
00465     virtual const SpectralWindowChannels & getSpectralWindowChannels (Int msId, Int spectralWindowId) const;
00466 
00467     //assign a VisImagingWeight object to this iterator
00468     virtual void useImagingWeight (const VisImagingWeight & imWgt);
00469     //return number  of Ant
00470     virtual Int numberAnt ();
00471     //Return number of rows in all selected ms's
00472     virtual Int numberCoh ();
00473 
00474     // Return number of spws, polids, ddids
00475     virtual Int numberSpw ();
00476     virtual Int numberPol ();
00477     virtual Int numberDDId ();
00478 
00479     Int getDataDescriptionId () const;
00480     const MeasurementSet & getMeasurementSet () const;;
00481     Int getMeasurementSetId () const;
00482     Int getNAntennas () const;
00483     virtual MEpoch getEpoch () const;
00484     MFrequency::Types getObservatoryFrequencyType () const; //???
00485     MPosition getObservatoryPosition () const;
00486     Vector<Float> getReceptor0Angle ();
00487 
00488     // Write/modify the flags in the data.
00489     // This will flag all channels in the original data that contributed to
00490     // the output channel in the case of channel averaging.
00491     // All polarizations have the same flag value.
00492     virtual void writeFlag (const Matrix<Bool> & flag);
00493 
00494     // Write/modify the flags in the data.
00495     // This writes the flags as found in the MS, Cube (npol,nchan,nrow),
00496     // where nrow is the number of rows in the current iteration (given by
00497     // nRow ()).
00498     virtual void writeFlag (const Cube<Bool> & flag);
00499 
00500     // Write/modify the flag row column; dimension Vector (nrow)
00501     virtual void writeFlagRow (const Vector<Bool> & rowflags);
00502 
00503     void writeFlagCategory(const Array<Bool>& fc);
00504 
00505     // Write/modify the visibilities.
00506     // This is possibly only for a 'reference' MS which has a new DATA column.
00507     // The first axis of the matrix should equal the selected number of channels
00508     // in the original MS.
00509     // If the MS does not contain all polarizations, only the parallel
00510     // hand polarizations are used.
00511     void writeVisCorrected (const Matrix<CStokesVector> & visibilityStokes);
00512     void writeVisModel (const Matrix<CStokesVector> & visibilityStokes);
00513     void writeVisObserved (const Matrix<CStokesVector> & visibilityStokes);
00514 
00515     // Write/modify the visibilities
00516     // This writes the data as found in the MS, Cube (npol,nchan,nrow).
00517     virtual void writeVisCorrected (const Cube<Complex> & vis);
00518     virtual void writeVisModel (const Cube<Complex> & vis);
00519     virtual void writeVisObserved (const Cube<Complex> & vis);
00520 
00521     // Write/modify the weights
00522     virtual void writeWeight (const Vector<Float> & wt);
00523 
00524     // Write/modify the weightMat
00525     virtual void writeWeightMat (const Matrix<Float> & wtmat);
00526 
00527     // Write/modify the weightSpectrum
00528     virtual void writeWeightSpectrum (const Cube<Float> & wtsp);
00529 
00530     // Write/modify the Sigma
00531     virtual void writeSigma (const Vector<Float> & sig);
00532 
00533     // Write/modify the ncorr x nrow SigmaMat.
00534     virtual void writeSigmaMat (const Matrix<Float> & sigmat);
00535 
00536     virtual void writeBackChanges (VisBuffer2 *);
00537 
00538 protected:
00539 
00540     void attachColumnsSafe (const Table & t);
00541 
00542     // attach the column objects to the currently selected table
00543 
00544     virtual void attachColumns (const Table & t);
00545 
00546     // returns the table, to which columns are attached,
00547     // can be overridden in derived classes
00548 
00549     virtual const Table attachTable () const;
00550 
00551     // advance the iteration
00552 
00553     virtual void advance ();
00554 
00555     virtual void applyPendingChanges ();
00556 
00557     // set the iteration state
00558 
00559     virtual void configureNewChunk ();
00560 
00561     // set the currently selected table
00562 
00563     virtual void configureNewSubchunk ();
00564 
00565     const ChannelSelector *
00566     createDefaultChannelSelector (Double time, Int msId, Int spectralWindowId);
00567 
00568     virtual const ChannelSelector * determineChannelSelection (Double time);
00569 
00570     Slice findChannelsInRange (Double lowerFrequency, Double upperFrequency,
00571                                const SpectralWindowChannels & spectralWindowChannels);
00572 
00573     void fillVisBuffer ();
00574 
00575     // Methods to get the data out of a table column according to whatever selection
00576     // criteria (e.g., slicing) is in effect.
00577 
00578     template <typename T>
00579     void getColumnRows (const ROArrayColumn<T> & column, Array<T> & array) const;
00580 
00581     template <typename T>
00582     void
00583     getColumnRowsMatrix (const ROArrayColumn<T> & column, Matrix<T> & array) const;
00584 
00585     template <typename T>
00586     void getColumnRows (const ROScalarColumn<T> & column, Vector<T> & array) const;
00587 
00588     Vector<Double> getFrequencies (Double time, Int frameOfReference) const;
00589     Vector<Int> getChannels (Double time, Int frameOfReference) const;
00590 
00591     Int getReportingFrameOfReference () const;
00592 
00593     // Returns the MS objects that this VI is iterating over.
00594 
00595     std::vector<MeasurementSet> getMeasurementSets () const;
00596 
00597     // Provides access to the MS-derived values object
00598 
00599     const MSDerivedValues & getMsd () const; // for use by Async I/O *ONLY*
00600 
00601     const MsIterInfo & getMsIterInfo () const;
00602 
00603     // Get privileged (non-const) access to the containing ROVI
00604 
00605     VisBufferImplAsync2 * getVisBufferAsync () const;
00606     VisBufferAsyncWrapper2 * getVisBufferWrapper () const;
00607 
00608     VisibilityIterator2 * getViP () const;
00609 
00610     void getVisibilityAsStokes (Matrix<CStokesVector> & visibilityStokes,
00611                                 const ROArrayColumn<Complex> & column) const;
00612 
00613     // Ctor auxiliary method
00614 
00615     virtual void initialize (const Block<MeasurementSet> & mss);
00616 
00617     // Returns true if MS Iterator is currently pointing to a selected
00618     // spectral window
00619 
00620     Bool isInASelectedSpectralWindow () const;
00621 
00622     // Creates a channel selection for the current subchunk based on the channel
00623     // or frequency selection made by the user.
00624 
00625     ChannelSelector *
00626     makeChannelSelectorC (const FrequencySelection & selection,
00627                           Double time, Int msId, Int spectralWindowId);
00628 
00629     ChannelSelector *
00630     makeChannelSelectorF (const FrequencySelection & selection,
00631                           Double time, Int msId, Int spectralWindowId);
00632 
00633     MFrequency::Convert makeFrequencyConverter (Double time, Int otherFrameOfReference,
00634                                                 Bool toObservedFrame) const;
00635 
00636 
00637     // Method to reset the VI back to the start.  Unlike the public version
00638     // there is a parameter to allow forcing the rewind even if the
00639     // MS Iter is already at the origin.
00640 
00641     virtual void originChunks (Bool forceRewind);
00642 
00643     // Advances the MS Iterator until it points at a spectral window
00644     // that is part of the frequency selection.
00645 
00646     void positionMsIterToASelectedSpectralWindow ();
00647 
00648     void readComplete ();
00649 
00650     // Sets the default frequency reporting frame of reference.  This
00651     // affects the default frame for obtaining the frequencies in a
00652     // VisBuffer.
00653 
00654     void setReportingFrameOfReference (Int);
00655 
00656     // Adjusts the tile cache for some columns so that the cache size is
00657     // optimized for the current input state (e.g., a new data description).
00658 
00659     virtual void setTileCache ();
00660 
00661     // Throws exception if there is a pending (i.e., unapplied) change to
00662     // the VI's properties.  Called when the VI is advanced since the user
00663     // probably forgot to apply the changes.
00664 
00665     virtual void throwIfPendingChanges ();
00666 
00667 
00668     // Returns true if the named column uses a tiled data manager in the specified MS
00669 
00670     Bool usesTiledDataManager (const String & columnName, const MeasurementSet & ms) const;
00671 
00672 private:
00673 
00674     AsynchronousInterface * interface_p;
00675     VlaData * vlaData_p;
00676 
00677 };
00678 
00679 } // end namespace vi
00680 
00681 } //# NAMESPACE CASA - END
00682 
00683 #endif
00684 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1