casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
VisModelDataI.h
Go to the documentation of this file.
1 
2 #include <casa/aips.h>
3 #include <vector>
4 #if ! defined (MSVIS_VisModelDataI_H)
5 #define MSVIS_VisModelDataI_H
6 
7 namespace casacore{
8 
9  class MeasurementSet;
10  class RecordInterface;
11  class String;
12  class TableRecord;
13  template <typename T> class Vector;
14  template <typename T> class Matrix;
15 }
16 
17 namespace casa {
18 
19  class VisBuffer;
20  namespace vi{class VisBuffer2;}
21 
22 
23  class VisModelDataI;
24 
25 
26 
28 
29  public:
30 
31  typedef VisModelDataI * (* Factory) ();
32 
33  static bool setFactory (Factory, casacore::Int whichone=0);
34 
35  //empty constructor
37 
38  //From a FTMachine Record
39  //VisModelDataI(const casacore::Record& ftmachinerec, const casacore::Vector<casacore::Int>& validfieldids, const casacore::Vector<casacore::Int>& msIds);
40  virtual ~VisModelDataI() {}
41 
42  //Add Image/FTMachine to generate visibilities for
43  //void addFTMachine(const casacore::Record& recordFTMachine, const casacore::Vector<casacore::Int>& validfieldids, const casacore::Vector<casacore::Int>& msIds);
44  //Add componentlist to generate visibilities for
45  //void addCompFTMachine(const ComponentList& cl, const casacore::Vector<casacore::Int>& validfieldids,
46  // const casacore::Vector<casacore::Int>& msIds);
47  //For simple model a special case for speed
48 
49  // void addFlatModel(const casacore::Vector<casacore::Double>& value, const casacore::Vector<casacore::Int>& validfieldids,
50  // const casacore::Vector<casacore::Int>& msIds);
51 
52  // //add componentlists or ftmachines
53  virtual void addModel(const casacore::RecordInterface& rec, const casacore::Vector<casacore::Int>& msids, const VisBuffer& vb) = 0;
54  virtual void addModel(const casacore::RecordInterface& rec, const casacore::Vector<casacore::Int>& msids, const vi::VisBuffer2& vb) = 0;
55  virtual VisModelDataI * clone () = 0;
56 
57  static VisModelDataI * create ();
58  static VisModelDataI * create2 ();
59  // //put the model data for this VisBuffer in the modelVisCube
60  virtual casacore::Bool getModelVis(VisBuffer& vb) = 0;
61  virtual casacore::Bool getModelVis(vi::VisBuffer2& vb) = 0;
62  // //this is a helper function that writes the model record to the ms
63 
64  virtual void putModelI (const casacore::MeasurementSet& thems, const casacore::RecordInterface& rec,
67  const casacore::Vector<casacore::Int>& incr, casacore::Bool iscomponentlist=true, casacore::Bool incremental=false) = 0;
68  //Version 2 record to keep track of state and scan number
69  virtual void putModelI(const casacore::MeasurementSet& thems,const casacore::RecordInterface& rec, const casacore::Matrix<casacore::Int>& indexComb, const casacore::Matrix<casacore::Int>& chansel,
70  casacore::Bool iscomponentlist=true, casacore::Bool incremental=false)=0;
71 
72  // //helper function to clear the keywordSet of the ms of the model for the fields
73  // //in that ms
74  virtual void clearModelI(const casacore::MeasurementSet& thems) = 0;
75  // // ...with field selection and optionally spw
76  // static void clearModel(const casacore::MeasurementSet& thems, const casacore::String field, const casacore::String spws=casacore::String(""));
77 
78  // //Functions to see if model is defined in the casacore::MS either in the SOURCE table or else in the MAIN
79  virtual casacore::Bool isModelDefinedI(const casacore::Int fieldId, const casacore::MeasurementSet& thems, casacore::String& key, casacore::Int& sourceRow) = 0;
80  // static casacore::Bool isModelDefined(const casacore::String& elkey, const casacore::MeasurementSet& thems);
81 
82  // //Get a given model that is defined by key
83  // //Forcing user to use a casacore::TableRecord rather than Generic casacore::RecordInterface ...just so as to avoid a copy.
84  virtual casacore::Bool getModelRecordI(const casacore::String& theKey, casacore::TableRecord& theRec, const casacore::MeasurementSet& theMs) = 0;
85 
86  // // casacore::List the fields
87  // static void listModel(const casacore::MeasurementSet& thems);
88 
89  // static FTMachine* NEW_FT(const casacore::Record& ftrec);
90  // //check if an addFT or addCompFT is necessary
91  // //casacore::Bool hasFT(casacore::Int msid, casacore::Int fieldid);
92  // //casacore::Bool hasCL(casacore::Int msid, casacore::Int fieldid);
93  // //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
94  // //returns a -2 if it has been tested before but does have it.
95  // //returns a 1 if it has a model stored
96  virtual casacore::Int hasModel(casacore::Int msid, casacore::Int field, casacore::Int spw) = 0;
97 
98  virtual casacore::Bool isVersion2() = 0;
101  virtual void init(const VisBuffer& vb) = 0;
102  virtual void init(const vi::VisBuffer2& vb) = 0;
103 
104  private:
105 
108 
109 };
110 
111 
112 
113 }
114 
115 #endif // ! defined (MSVIS_VisModelDataI_H)
int Int
Definition: aipstype.h:50
std::vector< double > Vector
Definition: ds9context.h:24
virtual ~VisModelDataI()
From a FTMachine Record VisModelDataI(const casacore::Record&amp; ftmachinerec, const casacore::Vector&lt;ca...
Definition: VisModelDataI.h:40
virtual casacore::Bool isVersion2()=0
VisModelDataI *(* Factory)()
Definition: VisModelDataI.h:31
virtual casacore::Bool isModelDefinedI(const casacore::Int fieldId, const casacore::MeasurementSet &thems, casacore::String &key, casacore::Int &sourceRow)=0
//...with field selection and optionally spw static void clearModel(const casacore::MeasurementSet&amp; t...
virtual casacore::Bool getModelRecordI(const casacore::String &theKey, casacore::TableRecord &theRec, const casacore::MeasurementSet &theMs)=0
static casacore::Bool isModelDefined(const casacore::String&amp; elkey, const casacore::MeasurementSet&amp; t...
virtual void init(const VisBuffer &vb)=0
Make sure that VisModel has been called once loaded checks and detection of version 1 or 2 is valid...
static Factory factory_p
virtual void putModelI(const casacore::MeasurementSet &thems, const casacore::RecordInterface &rec, const casacore::Vector< casacore::Int > &validfields, const casacore::Vector< casacore::Int > &spws, const casacore::Vector< casacore::Int > &starts, const casacore::Vector< casacore::Int > &nchan, const casacore::Vector< casacore::Int > &incr, casacore::Bool iscomponentlist=true, casacore::Bool incremental=false)=0
//this is a helper function that writes the model record to the ms
VisModelDataI()
empty constructor
Definition: VisModelDataI.h:36
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
virtual VisModelDataI * clone()=0
A hierarchical collection of named fields of various types.
Definition: TableRecord.h:182
A Table intended to hold astronomical data (a set of Measurements).
virtual casacore::Int hasModel(casacore::Int msid, casacore::Int field, casacore::Int spw)=0
// casacore::List the fields static void listModel(const casacore::MeasurementSet&amp; thems); ...
VisBuffer2s encapsulate one chunk of visibility data for processing.
Definition: VisBuffer2.h:141
virtual void addModel(const casacore::RecordInterface &rec, const casacore::Vector< casacore::Int > &msids, const VisBuffer &vb)=0
Add Image/FTMachine to generate visibilities for void addFTMachine(const casacore::Record&amp; recordFTMa...
virtual void clearModelI(const casacore::MeasurementSet &thems)=0
//helper function to clear the keywordSet of the ms of the model for the fields in that ms ...
static VisModelDataI * create2()
String: the storage and methods of handling collections of characters.
Definition: String.h:223
static VisModelDataI * create()
VisBuffers encapsulate one chunk of visibility data for processing.
Definition: VisBuffer.h:153
Abstract base class for Record classes.
static Factory factory2_p
virtual casacore::Bool getModelVis(VisBuffer &vb)=0
//put the model data for this VisBuffer in the modelVisCube
static bool setFactory(Factory, casacore::Int whichone=0)
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42