UDFMSCal.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef DERIVEDMSCAL_UDFMSCAL_H
00029 #define DERIVEDMSCAL_UDFMSCAL_H
00030
00031
00032 #include <casacore/casa/aips.h>
00033 #include <casacore/derivedmscal/DerivedMC/MSCalEngine.h>
00034 #include <casacore/ms/MeasurementSets/StokesConverter.h>
00035 #include <casacore/ms/MSSel/MSSelectionErrorHandler.h>
00036 #include <casacore/tables/TaQL/UDFBase.h>
00037 #include <casacore/tables/TaQL/ExprNode.h>
00038
00039 namespace casacore {
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116 class UDFMSCal: public UDFBase
00117 {
00118 public:
00119
00120 enum ColType {HA, HADEC, PA, LAST, AZEL, NEWUVW,
00121 UVWWVL, UVWWVLS, NEWUVWWVL, NEWUVWWVLS,
00122 STOKES, SELECTION, GETVALUE};
00123
00124 enum SelType {BASELINE, CORR, TIME, UVDIST, SPW, FIELD,
00125 FEED, ARRAY, SCAN, STATE, OBS};
00126
00127
00128 UDFMSCal (ColType, Int arg);
00129
00130
00131
00132 explicit UDFMSCal (const String& funcName);
00133 UDFMSCal (const String& funcName, const String& subtabName,
00134 const String& idColName, Int arg=0);
00135 UDFMSCal (const String& funcName, const String& subtabName,
00136 const String& idColName, const String& colName);
00137
00138
00139
00140 static UDFBase* makeHA (const String&);
00141 static UDFBase* makeHA1 (const String&);
00142 static UDFBase* makeHA2 (const String&);
00143 static UDFBase* makeHADEC (const String&);
00144 static UDFBase* makeHADEC1 (const String&);
00145 static UDFBase* makeHADEC2 (const String&);
00146 static UDFBase* makePA1 (const String&);
00147 static UDFBase* makePA2 (const String&);
00148 static UDFBase* makeLAST (const String&);
00149 static UDFBase* makeLAST1 (const String&);
00150 static UDFBase* makeLAST2 (const String&);
00151 static UDFBase* makeAZEL (const String&);
00152 static UDFBase* makeAZEL1 (const String&);
00153 static UDFBase* makeAZEL2 (const String&);
00154 static UDFBase* makeUVW (const String&);
00155 static UDFBase* makeWvl (const String&);
00156 static UDFBase* makeWvls (const String&);
00157 static UDFBase* makeUvwWvl (const String&);
00158 static UDFBase* makeUvwWvls (const String&);
00159 static UDFBase* makeStokes (const String&);
00160 static UDFBase* makeBaseline (const String&);
00161 static UDFBase* makeCorr (const String&);
00162 static UDFBase* makeTime (const String&);
00163 static UDFBase* makeUVDist (const String&);
00164 static UDFBase* makeSpw (const String&);
00165 static UDFBase* makeField (const String&);
00166 static UDFBase* makeFeed (const String&);
00167 static UDFBase* makeArray (const String&);
00168 static UDFBase* makeScan (const String&);
00169 static UDFBase* makeState (const String&);
00170 static UDFBase* makeObs (const String&);
00171 static UDFBase* makeAnt1Name (const String&);
00172 static UDFBase* makeAnt2Name (const String&);
00173 static UDFBase* makeAnt1Col (const String&);
00174 static UDFBase* makeAnt2Col (const String&);
00175 static UDFBase* makeStateCol (const String&);
00176 static UDFBase* makeObsCol (const String&);
00177 static UDFBase* makeSpwCol (const String&);
00178 static UDFBase* makePolCol (const String&);
00179 static UDFBase* makeFieldCol (const String&);
00180 static UDFBase* makeProcCol (const String&);
00181 static UDFBase* makeSubCol (const String&);
00182
00183
00184 virtual void setup (const Table&, const TaQLStyle&);
00185
00186
00187 virtual Bool getBool (const TableExprId& id);
00188 virtual Int64 getInt (const TableExprId& id);
00189 virtual Double getDouble (const TableExprId& id);
00190 virtual DComplex getDComplex (const TableExprId& id);
00191 virtual String getString (const TableExprId& id);
00192 virtual MArray<Bool> getArrayBool (const TableExprId& id);
00193 virtual MArray<Int64> getArrayInt (const TableExprId& id);
00194 virtual MArray<Double> getArrayDouble (const TableExprId& id);
00195 virtual MArray<DComplex> getArrayDComplex (const TableExprId& id);
00196 virtual MArray<String> getArrayString (const TableExprId& id);
00197
00198
00199
00200 virtual void recreateColumnObjects (const Vector<uInt>& rownrs);
00201
00202 private:
00203
00204 void setupStokes (const Table& table,
00205 PtrBlock<TableExprNodeRep*>& operands);
00206
00207
00208 void setupSelection (const Table& table,
00209 PtrBlock<TableExprNodeRep*>& operands);
00210
00211
00212 void setupDir (TableExprNodeRep*& operand);
00213
00214
00215 void setupGetValue (const Table& table,
00216 PtrBlock<TableExprNodeRep*>& operands);
00217
00218
00219 void setupWvls (const Table& table,
00220 PtrBlock<TableExprNodeRep*>& operands,
00221 uInt nargMax);
00222
00223
00224
00225 Int64 getRowNr (const TableExprId& id);
00226
00227
00228 Array<Double> toWvls (const TableExprId&);
00229
00230
00231 MSCalEngine itsEngine;
00232 StokesConverter itsStokesConv;
00233 TableExprNode itsDataNode;
00234 TableExprNode itsIdNode;
00235 ArrayColumn<Double> itsUvwCol;
00236 ColType itsType;
00237 Int itsArg;
00238
00239
00240
00241 String itsFuncName;
00242 String itsSubTabName;
00243 String itsIdColName;
00244 String itsSubColName;
00245
00246
00247 Vector<Double> itsTmpVector;
00248 Array<Double> itsTmpUvwWvl;
00249 Vector<Int> itsDDIds;
00250 vector<Double> itsWavel;
00251 vector<Vector<Double> > itsWavels;
00252 };
00253
00254
00255
00256
00257
00258
00259
00260
00261 class UDFMSCalErrorHandler : public MSSelectionErrorHandler
00262 {
00263 public:
00264 virtual ~UDFMSCalErrorHandler()
00265 {}
00266 virtual void handleError (MSSelectionError&)
00267 {}
00268 virtual void reportError (const char*, const String)
00269 {}
00270 };
00271
00272
00273 }
00274
00275 #endif