casa
5.7.0-16
|
TaQL UDFs to calculate derived MS values. More...
#include <UDFMSCal.h>
Public Types | |
enum | ColType { HA, HADEC, PA, LAST, AZEL, ITRF, UVWWVL, UVWWVLS, NEWUVW, NEWUVWWVL, NEWUVWWVLS, DELAY, 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 Types inherited from casacore::UDFBase | |
typedef UDFBase * | MakeUDFObject (const String &functionName) |
The signature of a global or static member function creating an object of the UDF. More... | |
Public Member Functions | |
UDFMSCal (ColType, Int arg) | |
Create object the given ColType and SelType. More... | |
UDFMSCal (const String &funcName) | |
Create the object for getting a value from a column in a subtable. More... | |
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. More... | |
virtual Bool | getBool (const TableExprId &id) |
Get the value. More... | |
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. More... | |
Public Member Functions inherited from casacore::UDFBase | |
UDFBase () | |
Only default constructor is needed. More... | |
virtual | ~UDFBase () |
Destructor. More... | |
virtual TaqlRegex | getRegex (const TableExprId &id) |
virtual MVTime | getDate (const TableExprId &id) |
virtual MArray< MVTime > | getArrayDate (const TableExprId &id) |
const String & | getUnit () const |
Get the unit. More... | |
const Record & | getAttributes () const |
Get the attributes. More... | |
void | getAggrNodes (vector< TableExprNodeRep * > &aggr) |
Get the nodes in the function operands representing an aggregate function. More... | |
void | getColumnNodes (vector< TableExprNodeRep * > &cols) |
Get the nodes in the function operands representing a table column. More... | |
void | init (const std::vector< TENShPtr > &arg, const Table &table, const TaQLStyle &) |
Initialize the function object. More... | |
TableExprNodeRep::NodeDataType | dataType () const |
Get the data type. More... | |
Int | ndim () const |
Get the dimensionality of the results. More... | |
const IPosition & | shape () const |
Get the result shape if the same for all results. More... | |
Bool | isConstant () const |
Tell if the UDF gives a constant result. More... | |
Bool | isAggregate () const |
Tell if the UDF is an aggregate function. More... | |
void | disableApplySelection () |
Do not apply the selection. More... | |
void | applySelection (const Vector< uInt > &rownrs) |
If needed, let the UDF re-create column objects for a selection of rows. More... | |
Static Public Member Functions | |
static UDFBase * | makeHA (const String &) |
Function to create an object. More... | |
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 * | makeITRF (const String &) |
static UDFBase * | makeUvwWvl (const String &) |
static UDFBase * | makeUvwWvls (const String &) |
static UDFBase * | makeUvwJ2000 (const String &) |
static UDFBase * | makeWvlJ2000 (const String &) |
static UDFBase * | makeWvlsJ2000 (const String &) |
static UDFBase * | makeUvwAPP (const String &) |
static UDFBase * | makeWvlAPP (const String &) |
static UDFBase * | makeWvlsAPP (const String &) |
static UDFBase * | makeDelay (const String &) |
static UDFBase * | makeDelay1 (const String &) |
static UDFBase * | makeDelay2 (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 &) |
Static Public Member Functions inherited from casacore::UDFBase | |
static void | registerUDF (const String &name, MakeUDFObject *func) |
Register the name and construction function of a UDF (thread-safe). More... | |
static UDFBase * | createUDF (const String &name, const TaQLStyle &style) |
Create a UDF object (thread-safe). More... | |
Private Member Functions | |
void | setupStokes (const Table &table, std::vector< TENShPtr > &operands) |
Setup the Stokes conversion. More... | |
void | setupSelection (const Table &table, std::vector< TENShPtr > &operands) |
Setup the baseline selection. More... | |
void | setupDir (TENShPtr &operand) |
Setup direction conversion if a direction is explicitly given. More... | |
void | setupGetValue (const Table &table, std::vector< TENShPtr > &operands) |
Setup getting column values from a subtable. More... | |
void | setupWvls (const Table &table, std::vector< TENShPtr > &operands, uInt nargMax) |
Setup getting the wavelength information. More... | |
Int64 | getRowNr (const TableExprId &id) |
Get the rownr in the subtable for GetValue. More... | |
Array< Double > | toWvls (const TableExprId &) |
Convert the UVW coordinates to wavelengths for the full spectrum. More... | |
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 |
Additional Inherited Members | |
Protected Member Functions inherited from casacore::UDFBase | |
std::vector< TENShPtr > & | operands () |
Get the operands. More... | |
void | setDataType (TableExprNodeRep::NodeDataType) |
Set the data type. More... | |
void | setNDim (Int ndim) |
Set the dimensionality of the results. More... | |
void | setShape (const IPosition &shape) |
Set the shape of the results if it is fixed and known. More... | |
void | setUnit (const String &unit) |
Set the unit of the result. More... | |
void | setAttributes (const Record &attributes) |
Set the attributes of the result. More... | |
void | setConstant (Bool isConstant) |
Define if the result is constant (e.g. More... | |
void | setAggregate (Bool isAggregate) |
Define if the UDF is an aggregate function (usually used in GROUPBY). More... | |
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 117 of file UDFMSCal.h.
Define the possible 'column' types.
Enumerator | |
---|---|
HA | |
HADEC | |
PA | |
LAST | |
AZEL | |
ITRF | |
UVWWVL | |
UVWWVLS | |
NEWUVW | |
NEWUVWWVL | |
NEWUVWWVLS | |
DELAY | |
STOKES | |
SELECTION | |
GETVALUE |
Definition at line 121 of file UDFMSCal.h.
Define the possible selection types.
Enumerator | |
---|---|
BASELINE | |
CORR | |
TIME | |
UVDIST | |
SPW | |
FIELD | |
FEED | |
ARRAY | |
SCAN | |
STATE | |
OBS |
Definition at line 125 of file UDFMSCal.h.
|
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 |
Reimplemented from casacore::UDFBase.
|
virtual |
Reimplemented from casacore::UDFBase.
|
virtual |
Reimplemented from casacore::UDFBase.
|
virtual |
Reimplemented from casacore::UDFBase.
|
virtual |
Reimplemented from casacore::UDFBase.
|
virtual |
Get the value.
Reimplemented from casacore::UDFBase.
|
virtual |
Reimplemented from casacore::UDFBase.
|
virtual |
Reimplemented from casacore::UDFBase.
|
virtual |
Reimplemented from casacore::UDFBase.
|
private |
Get the rownr in the subtable for GetValue.
If itsArg==1 it uses indirection using itsDDIds.
|
virtual |
Reimplemented from casacore::UDFBase.
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.
|
private |
Setup direction conversion if a direction is explicitly given.
|
private |
Setup getting column values from a subtable.
|
private |
Setup the baseline selection.
|
private |
Setup the Stokes conversion.
|
private |
Setup getting the wavelength information.
|
private |
Convert the UVW coordinates to wavelengths for the full spectrum.
|
private |
Definition at line 245 of file UDFMSCal.h.
|
private |
Definition at line 241 of file UDFMSCal.h.
Definition at line 257 of file UDFMSCal.h.
|
private |
Definition at line 239 of file UDFMSCal.h.
|
private |
Definition at line 249 of file UDFMSCal.h.
|
private |
Definition at line 251 of file UDFMSCal.h.
|
private |
Definition at line 242 of file UDFMSCal.h.
|
private |
Definition at line 240 of file UDFMSCal.h.
|
private |
Definition at line 252 of file UDFMSCal.h.
|
private |
Definition at line 250 of file UDFMSCal.h.
Definition at line 256 of file UDFMSCal.h.
Definition at line 255 of file UDFMSCal.h.
|
private |
Definition at line 244 of file UDFMSCal.h.
|
private |
Definition at line 243 of file UDFMSCal.h.
|
private |
Definition at line 258 of file UDFMSCal.h.
Definition at line 259 of file UDFMSCal.h.