casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
VisBufferImplAsync2.h
Go to the documentation of this file.
00001 /*
00002  * VisibilityBufferAsync.h
00003  *
00004  *  Created on: Nov 3, 2010
00005  *      Author: jjacobs
00006  */
00007 
00008 #ifndef VISIBILITYBUFFERASYNC2_H_
00009 #define VISIBILITYBUFFERASYNC2_H_
00010 
00011 #include <synthesis/MSVis/VisBufferImpl2.h>
00012 
00013 namespace casa {
00014 namespace vi {
00015 
00016 class VisibilityIteratorAsync2;
00017 class VlaDatum;
00018 class VLAT;
00019 
00020 class MsIterInfo {
00021 
00022 public:
00023 
00024     void fill (const MSIter & msIter);
00025 
00026     Bool allBeamOffsetsZero () const;
00027     Vector<String>  & antennaMounts () const;
00028     Int arrayId () const;
00029     Int dataDescriptionId () const;
00030     Int fieldId () const;
00031     String fieldName () const;
00032     const MFrequency & frequency0 () const;
00033     const Vector<Double> & getBeamOffsets () const;
00034     Bool more () const;
00035     Int msId () const;
00036     Bool newArray () const;
00037     Int newDataDescriptionId () const;
00038     Bool newField () const;
00039     Bool newMS () const;
00040     Bool newSpectralWindow () const;
00041     Int numMS () const;
00042     const MDirection & phaseCenter () const;
00043     Int polFrame () const;
00044     Int polarizationId () const;
00045     const Matrix<Double> & receptorAngle () const;
00046     const String & sourceName () const;
00047     Int spectralWindowId () const;
00048     const MPosition & telescopePosition () const;
00049 
00050 
00051 private:
00052 
00053     Bool allBeamOffsetsZero_p;
00054     Vector<String>  antennaMounts_p;
00055     Int arrayId_p;
00056     Int dataDescriptionId_p;
00057     Int fieldId_p;
00058     String fieldName_p;
00059     MFrequency frequency0_p;
00060     Vector<Double> getBeamOffsets_p;
00061     Bool more_p;
00062     Int msId_p;
00063     Bool newArray_p;
00064     Int newDataDescriptionId_p;
00065     Bool newField_p;
00066     Bool newMS_p;
00067     Bool newSpectralWindow_p;
00068     Int numMS_p;
00069     MDirection phaseCenter_p;
00070     Int polFrame_p;
00071     Int polarizationId_p;
00072     Matrix<Double> receptorAngle_p;
00073     String sourceName_p;
00074     Int spectralWindowId_p;
00075     MPosition telescopePosition_p;
00076 
00077 };
00078 
00079 class VisBufferImplAsync2 : public VisBufferImpl2 {
00080 
00081     friend class Rovia_Test;
00082     friend class ViImplAsync2;
00083     friend class VisBufferAsync2Wrapper2;
00084     friend class VlaDatum;
00085     friend class VLAT;
00086 
00087 public:
00088 
00089     //VisBufferAsync2 (const VisBuffer& vb);
00090 
00091     ~VisBufferImplAsync2 ();
00092 
00093     const MsIterInfo & msIterInfo () const;
00094 
00095 protected:
00096 
00097     // The constructors are not public because creation should be performed
00098     // by a factory object (e.g., VisBufferAutoPtr).  The use of a factory
00099     // makes it possible to fine tune at run time whether a VisBuffer or a
00100     // VisBufferAsync2 is created.
00101 
00102     VisBufferImplAsync2 ();
00103     VisBufferImplAsync2 (VisibilityIterator2 & iter, Bool isWritable);
00104 
00105 //    void attachToVisIter(VisibilityIterator2 & iter);
00106 //    void checkVisIter (const char * func, const char * file, int line, const char * extra = "") const;
00107 //    void clear ();
00108     void construct ();
00109 //    virtual void copyAsyncValues (const VisBufferAsync2 & other);
00110 //    virtual void copyCache (const VisBuffer2 & other, Bool force);
00111 //    template<typename T> void copyVector (const Vector<T> & from, Vector<T> & to);
00112 //    Vector<MDirection>& fillDirection1();
00113 //    Vector<MDirection>& fillDirection2();
00114 //    void fillFrom (const VisBufferAsync2 & other);
00115 //    MDirection & fillPhaseCenter();
00116 //    Bool getAllBeamOffsetsZero () const;
00117 //    const Vector <String> & getAntennaMounts () const;
00118 //    const Cube <RigidVector <Double, 2> > & getBeamOffsets () const;
00119 //    const MeasurementSet & getMs () const;
00120 //    Int getNSpw () const;
00121 //    MDirection getPhaseCenter () const;
00122 //    const Cube <Double> & getReceptorAngles () const;
00123 //    void setAngleInfo (Bool allBeamOffsetsZero,
00124 //                       const Vector<String> antennaMounts,
00125 //                       Cube<RigidVector<Double, 2> > beamOffsets,
00126 //                       const Cube<Double> & receptorAngles);
00127 //    void initializeScalars ();
00128 //    /////void setDataDescriptionId (Int id);
00129 //    void setFilling (Bool isFilling);
00130 //    void setLsrInfo (const Block <Int> & channelGroupNumber,
00131 //                     const Block <Int> & channelIncrement,
00132 //                     const Block <Int> & channelStart,
00133 //                     const Block <Int> & channelWidth,
00134 //                     const MPosition & observatoryPosition,
00135 //                     const MDirection & phaseCenter,
00136 //                     Bool velocitySelection);
00137 //    void setMeasurementSet (const MeasurementSet & ms);
00138 //    void setMeasurementSetId (Int id, bool isNew);
00139 //    void setMEpoch (const MEpoch & mEpoch);
00140 //    void setMSD (const MSDerivedValues & msd);
00141 //    void setNAntennas (Int);
00142 //    void setNCoh (Int);
00143 //    void setNSpw (Int);
00144 //    void setNewEntityFlags (bool newArrayId, bool newFieldId, bool newSpectralWindow);
00145 //    void setPolarizationId (Int);
00146 //    void setNRowChunk (Int);
00147 //    void setReceptor0Angle (const Vector<Float> & receptor0Angle);
00148 //    void setRowIds (const Vector<uInt> & rowIds);
00149 //    void setSelectedNVisibilityChannels (const Vector<Int> & nVisibilityChannels);
00150 //    void setSelectedSpectralWindows (const Vector<Int> & spectralWindows);
00151 //    void setTopoFreqs (const Vector<Double> & lsrFreq, const Vector<Double> & selFreq_p);
00152 //    void setVisibilityShape (const IPosition & pvisibilityShape);
00153 //    void updateCoordInfo (const VisBuffer2 *, const Bool dirDependent=True);
00154 //
00155 //    static MDirection unsharedCopyDirection (const MDirection & direction);
00156 //    static void unsharedCopyDirectionVector (Vector<MDirection> & direction);
00157 //    static MEpoch unsharedCopyEpoch (const MEpoch & mEpoch);
00158 //    static MPosition unsharedCopyPosition (const MPosition & position);
00159 
00160 private:
00161 
00162 //    Bool fillAllBeamOffsetsZero ();
00163 //    Vector <String> fillAntennaMounts ();
00164 //    Cube <RigidVector <Double, 2> > fillBeamOffsets ();
00165 //    Cube <Double> fillReceptorAngles ();
00166 
00167     Bool                           allBeamOffsetsZero_p;
00168     Vector<String>                 antennaMounts_p;
00169     mutable Vector<MDirection>     azelCached_p;      // mutable because it is a cached value
00170     mutable Double                 azelCachedTime_p;  // mutable because it is a cached value
00171     Cube<RigidVector<Double, 2> >  beamOffsets_p;
00172     Block<Int>                     channelGroupNumber_p;
00173     Block<Int>                     channelIncrement_p;
00174     Block<Int>                     channelStart_p;
00175     Block<Int>                     channelWidth_p;
00176     //Int                            dataDescriptionId_p;
00177     mutable Vector<Float>          feedpaCached_p;      // mutable because it is a cached value
00178     mutable Double                 feedpaCachedTime_p;  // mutable because it is a cached value
00179     Bool                           isFilling_p;
00180     Vector<Double>                 lsrFrequency_p; // calculated by getTopoFreqs if velSelection_p
00181     MEpoch                         mEpoch_p;
00182     const MeasurementSet *         measurementSet_p;  // [use]
00183     mutable ROMSColumns *          msColumns_p; // [own]
00184     MSDerivedValues *              msd_p; // [own]
00185     Int                            nAntennas_p;
00186     Int                            nCoh_p;
00187     Bool                           newArrayId_p;
00188     Bool                           newFieldId_p;
00189     Bool                           newSpectralWindow_p;
00190     Int                            nRowChunk_p;
00191     Int                            nSpw_p;
00192     //const ROScalarColumn<Int> *    obsMFreqTypes_p; // [use]
00193     MPosition                      observatoryPosition_p;
00194     mutable Vector<Float>          parangCached_p;      // mutable because it is a cached value
00195     mutable Double                 parangCachedTime_p;  // mutable because it is a cached value
00196     Int                            polarizationId_p;
00197     Vector<Float>                  receptor0Angle_p;
00198     Cube<Double>                   receptorAngles_p;
00199     Vector<Double>                 selFreq_p;
00200     Vector<Int>                    selectedNVisibilityChannels_p;
00201     Vector<Int>                    selectedSpectralWindows_p;
00202     Bool                           velSelection_p;
00203     IPosition                      visibilityShape_p;
00204 
00205 
00206 
00207 };
00208 
00209 
00210 //template<typename T>
00211 //void VisBufferAsync2::copyVector (const Vector<T> & from, Vector<T> & to)
00212 //{
00213 //    // Make an independent copy of the vector.
00214 //    // N.B.: the independence is only at the top Vector level
00215 //    //       so any deep dependence is not undone
00216 //
00217 //    Vector<T> tmp = from;
00218 //    to = tmp.copy();
00219 //}
00220 
00221 
00222 } // end namespace vi
00223 
00224 } // end namespace casa
00225 
00226 
00227 #endif /* VISIBILITYBUFFERASYNC_H_ */