VisModelDataI.h

Go to the documentation of this file.
00001 #include <casa/aips.h>
00002 
00003 #if ! defined (MSVIS_VisModelDataI_H)
00004 #define MSVIS_VisModelDataI_H
00005 
00006 namespace casa {
00007 
00008   class MeasurementSet;
00009   class RecordInterface;
00010   class String;
00011   class TableRecord;
00012   class VisBuffer;
00013   namespace vi{class VisBuffer2;}
00014 
00015   class VisModelDataI;
00016 
00017   template <typename T> class Vector;
00018 
00019 
00020 class VisModelDataI {
00021 
00022  public:
00023 
00024   typedef VisModelDataI * (* Factory) ();
00025 
00026   static bool setFactory (Factory, Int whichone=0);
00027 
00028   //empty constructor
00029   VisModelDataI() {}
00030 
00031   //From a FTMachine Record
00032   //VisModelDataI(const Record& ftmachinerec, const Vector<Int>& validfieldids, const Vector<Int>& msIds);
00033   virtual ~VisModelDataI() {}
00034 
00035   //Add Image/FTMachine to generate visibilities for
00036   //void addFTMachine(const Record& recordFTMachine, const Vector<Int>& validfieldids, const Vector<Int>& msIds);
00037   //Add componentlist to generate visibilities for
00038   //void addCompFTMachine(const ComponentList& cl, const Vector<Int>& validfieldids, 
00039   //                    const Vector<Int>& msIds);
00040   //For simple model a special case for speed 
00041   
00042   // void addFlatModel(const Vector<Double>& value, const Vector<Int>& validfieldids, 
00043   //                const Vector<Int>& msIds);
00044 
00045   // //add componentlists or ftmachines 
00046   virtual void addModel(const RecordInterface& rec,  const Vector<Int>& msids, const VisBuffer& vb) = 0;
00047   virtual void addModel(const RecordInterface& rec,  const Vector<Int>& msids, const vi::VisBuffer2& vb) = 0;
00048   virtual VisModelDataI * clone () = 0;
00049 
00050   static VisModelDataI * create ();
00051   static VisModelDataI * create2 ();
00052   // //put the model data for this VisBuffer in the modelVisCube
00053   virtual Bool getModelVis(VisBuffer& vb) = 0;
00054   virtual Bool getModelVis(vi::VisBuffer2& vb) = 0;
00055   // //this is a helper function that writes the model record to the ms 
00056 
00057   virtual void putModelI (const MeasurementSet& thems, const RecordInterface& rec,
00058                           const Vector<Int>& validfields, const Vector<Int>& spws,
00059                           const Vector<Int>& starts, const Vector<Int>& nchan,
00060                           const Vector<Int>& incr, Bool iscomponentlist=True, Bool incremental=False) = 0;
00061 
00062   // //helper function to clear the keywordSet of the ms of the model  for the fields 
00063   // //in that ms
00064   virtual void clearModelI(const MeasurementSet& thems) = 0;
00065   // // ...with field selection and optionally spw
00066   // static void clearModel(const MeasurementSet& thems, const String field, const String spws=String(""));
00067 
00068   // //Functions to see if model is defined in the MS either in the SOURCE table or else in the MAIN
00069   virtual Bool isModelDefinedI(const Int fieldId, const MeasurementSet& thems, String& key, Int& sourceRow) = 0;
00070   // static Bool isModelDefined(const String& elkey, const MeasurementSet& thems);
00071 
00072   // //Get a given model that is defined by key
00073   // //Forcing user to use a TableRecord rather than Generic RecordInterface ...just so as to avoid a copy.
00074   virtual Bool getModelRecordI(const String& theKey, TableRecord& theRec, const MeasurementSet& theMs) = 0;
00075 
00076   // // List the fields
00077   // static void listModel(const MeasurementSet& thems);
00078 
00079   // static FTMachine* NEW_FT(const Record& ftrec);
00080   // //check if an addFT or addCompFT is necessary
00081   // //Bool hasFT(Int msid, Int fieldid);
00082   // //Bool hasCL(Int msid, Int fieldid);
00083   // //returns a -1 if there is no model for this combination of ms,field,spw...but has not been  // checked yet if there is one
00084   // //returns a -2 if it has been tested before but does have it.
00085   // //returns a 1 if it has a model stored 
00086   virtual Int hasModel(Int msid, Int field, Int spw) = 0; 
00087 
00088  private:
00089 
00090   static Factory factory_p;
00091   static Factory factory2_p;
00092 
00093 };
00094 
00095 
00096 
00097 }
00098 
00099 #endif // ! defined (MSVIS_VisModelDataI_H)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1