TaQL UDFs to calculate derived MS values. More...
#include <UDFMSCal.h>
Public Types | |
enum | ColType { HA, HADEC, PA, LAST, AZEL, NEWUVW, UVWWVL, UVWWVLS, NEWUVWWVL, NEWUVWWVLS, STOKES, SELECTION, GETVALUE } |
Define the possible 'column' types. More... | |
enum | SelType { BASELINE, CORR, TIME, UVDIST, SPW, FIELD, FEED, ARRAY, SCAN, STATE, OBS } |
Define the possible selection types. More... | |
Public Member Functions | |
UDFMSCal (ColType, Int arg) | |
Create object the given ColType and SelType. | |
UDFMSCal (const String &funcName) | |
Create the object for getting a value from a column in a subtable. | |
UDFMSCal (const String &funcName, const String &subtabName, const String &idColName, Int arg=0) | |
UDFMSCal (const String &funcName, const String &subtabName, const String &idColName, const String &colName) | |
virtual void | setup (const Table &, const TaQLStyle &) |
Setup the object. | |
virtual Bool | getBool (const TableExprId &id) |
Get the value. | |
virtual Int64 | getInt (const TableExprId &id) |
virtual Double | getDouble (const TableExprId &id) |
virtual DComplex | getDComplex (const TableExprId &id) |
virtual String | getString (const TableExprId &id) |
virtual MArray< Bool > | getArrayBool (const TableExprId &id) |
virtual MArray< Int64 > | getArrayInt (const TableExprId &id) |
virtual MArray< Double > | getArrayDouble (const TableExprId &id) |
virtual MArray< DComplex > | getArrayDComplex (const TableExprId &id) |
virtual MArray< String > | getArrayString (const TableExprId &id) |
virtual void | recreateColumnObjects (const Vector< uInt > &rownrs) |
Let a derived class recreate its column objects in case a selection has to be applied. | |
Static Public Member Functions | |
static UDFBase * | makeHA (const String &) |
Function to create an object. | |
static UDFBase * | makeHA1 (const String &) |
static UDFBase * | makeHA2 (const String &) |
static UDFBase * | makeHADEC (const String &) |
static UDFBase * | makeHADEC1 (const String &) |
static UDFBase * | makeHADEC2 (const String &) |
static UDFBase * | makePA1 (const String &) |
static UDFBase * | makePA2 (const String &) |
static UDFBase * | makeLAST (const String &) |
static UDFBase * | makeLAST1 (const String &) |
static UDFBase * | makeLAST2 (const String &) |
static UDFBase * | makeAZEL (const String &) |
static UDFBase * | makeAZEL1 (const String &) |
static UDFBase * | makeAZEL2 (const String &) |
static UDFBase * | makeUVW (const String &) |
static UDFBase * | makeWvl (const String &) |
static UDFBase * | makeWvls (const String &) |
static UDFBase * | makeUvwWvl (const String &) |
static UDFBase * | makeUvwWvls (const String &) |
static UDFBase * | makeStokes (const String &) |
static UDFBase * | makeBaseline (const String &) |
static UDFBase * | makeCorr (const String &) |
static UDFBase * | makeTime (const String &) |
static UDFBase * | makeUVDist (const String &) |
static UDFBase * | makeSpw (const String &) |
static UDFBase * | makeField (const String &) |
static UDFBase * | makeFeed (const String &) |
static UDFBase * | makeArray (const String &) |
static UDFBase * | makeScan (const String &) |
static UDFBase * | makeState (const String &) |
static UDFBase * | makeObs (const String &) |
static UDFBase * | makeAnt1Name (const String &) |
static UDFBase * | makeAnt2Name (const String &) |
static UDFBase * | makeAnt1Col (const String &) |
static UDFBase * | makeAnt2Col (const String &) |
static UDFBase * | makeStateCol (const String &) |
static UDFBase * | makeObsCol (const String &) |
static UDFBase * | makeSpwCol (const String &) |
static UDFBase * | makePolCol (const String &) |
static UDFBase * | makeFieldCol (const String &) |
static UDFBase * | makeProcCol (const String &) |
static UDFBase * | makeSubCol (const String &) |
Private Member Functions | |
void | setupStokes (const Table &table, PtrBlock< TableExprNodeRep * > &operands) |
Setup the Stokes conversion. | |
void | setupSelection (const Table &table, PtrBlock< TableExprNodeRep * > &operands) |
Setup the baseline selection. | |
void | setupDir (TableExprNodeRep *&operand) |
Setup direction conversion if a direction is explicitly given. | |
void | setupGetValue (const Table &table, PtrBlock< TableExprNodeRep * > &operands) |
Setup getting column values from a subtable. | |
void | setupWvls (const Table &table, PtrBlock< TableExprNodeRep * > &operands, uInt nargMax) |
Setup getting the wavelength information. | |
Int64 | getRowNr (const TableExprId &id) |
Get the rownr in the subtable for GetValue. | |
Array< Double > | toWvls (const TableExprId &) |
Convert the UVW coordinates to wavelengths for the full spectrum. | |
Private Attributes | |
MSCalEngine | itsEngine |
StokesConverter | itsStokesConv |
TableExprNode | itsDataNode |
TableExprNode | itsIdNode |
ArrayColumn< Double > | itsUvwCol |
ColType | itsType |
Int | itsArg |
String | itsFuncName |
String | itsSubTabName |
String | itsIdColName |
String | itsSubColName |
Vector< Double > | itsTmpVector |
Array< Double > | itsTmpUvwWvl |
Vector< Int > | itsDDIds |
vector< Double > | itsWavel |
vector< Vector< Double > > | itsWavels |
TaQL UDFs to calculate derived MS values.
Public interface
UDFMSCal defines UDFs (user defined functions) that can be used in TaQL to get derived MeasurementSet values hourangle, parallactic angle, azimuth/elevation, and local sidereal time. In this way such derived values appear to be ordinary TaQL functions.
The following functions can be defined:
The first functions have data type double and unit radian (except UVW). The HADEC, AZEL, and UVW functions return arrays while the others return scalars.
The STOKES function can have data type Complex, Double or Bool.
The latter functions are selection functions and return a Bool scalar.
This class is meant for a MeasurementSet, but can be used for any table containing an ANTENNA and FIELD subtable and the relevant columns in the main table (ANTENNA1 and/or ANTENNA2, FIELD_ID, and TIME).
In principle the array center is the Observatory position, which is taken from the Measures Observatory table using the telescope name found in the OBSERVATION subtable. However, if the subtable is not defined or empty or if the telescope name is unknown, the position of the first antenna is used as the array position.
The engine can also be used for a CASA Calibration Table. It understands how it references the MeasurementSets. Because calibration tables contain no ANTENNA2 columns, functions XX2 are the same as XX1.
It makes it possible to do queries on these values without having to add columns for them.
Definition at line 116 of file UDFMSCal.h.
Define the possible 'column' types.
HA | |
HADEC | |
PA | |
LAST | |
AZEL | |
NEWUVW | |
UVWWVL | |
UVWWVLS | |
NEWUVWWVL | |
NEWUVWWVLS | |
STOKES | |
SELECTION | |
GETVALUE |
Definition at line 120 of file UDFMSCal.h.
Define the possible selection types.
Definition at line 124 of file UDFMSCal.h.
casacore::UDFMSCal::UDFMSCal | ( | const String & | funcName | ) | [explicit] |
Create the object for getting a value from a column in a subtable.
casacore::UDFMSCal::UDFMSCal | ( | const String & | funcName, | |
const String & | subtabName, | |||
const String & | idColName, | |||
Int | arg = 0 | |||
) |
casacore::UDFMSCal::UDFMSCal | ( | const String & | funcName, | |
const String & | subtabName, | |||
const String & | idColName, | |||
const String & | colName | |||
) |
virtual MArray<Bool> casacore::UDFMSCal::getArrayBool | ( | const TableExprId & | id | ) | [virtual] |
Reimplemented from casacore::UDFBase.
virtual MArray<DComplex> casacore::UDFMSCal::getArrayDComplex | ( | const TableExprId & | id | ) | [virtual] |
Reimplemented from casacore::UDFBase.
virtual MArray<Double> casacore::UDFMSCal::getArrayDouble | ( | const TableExprId & | id | ) | [virtual] |
Reimplemented from casacore::UDFBase.
virtual MArray<Int64> casacore::UDFMSCal::getArrayInt | ( | const TableExprId & | id | ) | [virtual] |
Reimplemented from casacore::UDFBase.
virtual MArray<String> casacore::UDFMSCal::getArrayString | ( | const TableExprId & | id | ) | [virtual] |
Reimplemented from casacore::UDFBase.
virtual Bool casacore::UDFMSCal::getBool | ( | const TableExprId & | id | ) | [virtual] |
Get the value.
Reimplemented from casacore::UDFBase.
virtual DComplex casacore::UDFMSCal::getDComplex | ( | const TableExprId & | id | ) | [virtual] |
Reimplemented from casacore::UDFBase.
virtual Double casacore::UDFMSCal::getDouble | ( | const TableExprId & | id | ) | [virtual] |
Reimplemented from casacore::UDFBase.
virtual Int64 casacore::UDFMSCal::getInt | ( | const TableExprId & | id | ) | [virtual] |
Reimplemented from casacore::UDFBase.
Int64 casacore::UDFMSCal::getRowNr | ( | const TableExprId & | id | ) | [private] |
Get the rownr in the subtable for GetValue.
If itsArg==1 it uses indirection using itsDDIds.
virtual String casacore::UDFMSCal::getString | ( | const TableExprId & | id | ) | [virtual] |
Reimplemented from casacore::UDFBase.
Function to create an object.
Let a derived class recreate its column objects in case a selection has to be applied.
Reimplemented from casacore::UDFBase.
Setup the object.
Implements casacore::UDFBase.
void casacore::UDFMSCal::setupDir | ( | TableExprNodeRep *& | operand | ) | [private] |
Setup direction conversion if a direction is explicitly given.
void casacore::UDFMSCal::setupGetValue | ( | const Table & | table, | |
PtrBlock< TableExprNodeRep * > & | operands | |||
) | [private] |
Setup getting column values from a subtable.
void casacore::UDFMSCal::setupSelection | ( | const Table & | table, | |
PtrBlock< TableExprNodeRep * > & | operands | |||
) | [private] |
Setup the baseline selection.
void casacore::UDFMSCal::setupStokes | ( | const Table & | table, | |
PtrBlock< TableExprNodeRep * > & | operands | |||
) | [private] |
Setup the Stokes conversion.
void casacore::UDFMSCal::setupWvls | ( | const Table & | table, | |
PtrBlock< TableExprNodeRep * > & | operands, | |||
uInt | nargMax | |||
) | [private] |
Setup getting the wavelength information.
Array<Double> casacore::UDFMSCal::toWvls | ( | const TableExprId & | ) | [private] |
Convert the UVW coordinates to wavelengths for the full spectrum.
Int casacore::UDFMSCal::itsArg [private] |
Definition at line 237 of file UDFMSCal.h.
TableExprNode casacore::UDFMSCal::itsDataNode [private] |
Definition at line 233 of file UDFMSCal.h.
Vector<Int> casacore::UDFMSCal::itsDDIds [private] |
Definition at line 249 of file UDFMSCal.h.
MSCalEngine casacore::UDFMSCal::itsEngine [private] |
Definition at line 231 of file UDFMSCal.h.
String casacore::UDFMSCal::itsFuncName [private] |
Definition at line 241 of file UDFMSCal.h.
String casacore::UDFMSCal::itsIdColName [private] |
Definition at line 243 of file UDFMSCal.h.
TableExprNode casacore::UDFMSCal::itsIdNode [private] |
Definition at line 234 of file UDFMSCal.h.
Definition at line 232 of file UDFMSCal.h.
String casacore::UDFMSCal::itsSubColName [private] |
Definition at line 244 of file UDFMSCal.h.
String casacore::UDFMSCal::itsSubTabName [private] |
Definition at line 242 of file UDFMSCal.h.
Array<Double> casacore::UDFMSCal::itsTmpUvwWvl [private] |
Definition at line 248 of file UDFMSCal.h.
Vector<Double> casacore::UDFMSCal::itsTmpVector [private] |
Definition at line 247 of file UDFMSCal.h.
ColType casacore::UDFMSCal::itsType [private] |
Definition at line 236 of file UDFMSCal.h.
ArrayColumn<Double> casacore::UDFMSCal::itsUvwCol [private] |
Definition at line 235 of file UDFMSCal.h.
vector<Double> casacore::UDFMSCal::itsWavel [private] |
Definition at line 250 of file UDFMSCal.h.
vector<Vector<Double> > casacore::UDFMSCal::itsWavels [private] |
Definition at line 251 of file UDFMSCal.h.