casacore
|
Templated base class for the TaQL UDF conversion engines. More...
#include <MeasEngine.h>
Public Member Functions | |
MeasEngine () | |
virtual | ~MeasEngine () |
M::Types | refType () const |
Get the reference type. More... | |
Bool | handleMeasType (const TENShPtr &operand, Bool doThrow) |
Handle a doppler reference type. More... | |
Record | makeAttributes (typename M::Types refType, Int valueType=1) const |
Make the expression result attributes. More... | |
Public Member Functions inherited from casacore::BaseEngine | |
BaseEngine () | |
virtual | ~BaseEngine () |
void | adaptForConstant (const IPosition &shapeConstant, uInt nvalues=0) |
Adapt the output shape and dimensionality for possible constant values. More... | |
void | extendBase (const BaseEngine &, Bool removeFirstAxis=False) |
Extend the shape (if not empty) with the engine's shape. More... | |
const IPosition & | shape () const |
Get the output shape. More... | |
Int | ndim () const |
Get the output dimensionality. More... | |
const Unit & | unit () const |
Get the unit of the function's result. More... | |
const Unit & | inUnit () const |
Get the unit of the expression. More... | |
Bool | isConstant () const |
Tell if the expression is constant. More... | |
Protected Member Functions | |
void | handleMeasArray (const TENShPtr &operand) |
Handle the operand representing an array of Meas values. More... | |
void | handleConstant (const TENShPtr &operand) |
Handle a constant Meas value. More... | |
virtual void | handleValues (TableExprNode &operand, const TableExprId &id, Array< M > &positions)=0 |
Let a derive class handle the values. More... | |
Protected Member Functions inherited from casacore::BaseEngine | |
virtual void | deriveAttr (const Unit &unit, Int nval) |
Let a derived class derive its attributes. More... | |
virtual void | setValueType (Int valueType) |
Let a derived class set its value type. More... | |
virtual String | stripMeasType (const String &type) |
Let a derived class strip part of the reference type. More... | |
Protected Attributes | |
Array< M > | itsConstants |
M::Types | itsRefType |
ScalarMeasColumn< M > | itsMeasScaCol |
ArrayMeasColumn< M > | itsMeasArrCol |
Protected Attributes inherited from casacore::BaseEngine | |
Bool | itsIsConst |
IPosition | itsShape |
Int | itsNDim |
Unit | itsInUnit |
Unit | itsOutUnit |
TableExprNode | itsExprNode |
Templated base class for the TaQL UDF conversion engines.
Public interface
DopplerEngine defines Engines (user defined functions) that can be used in TaQL to convert Measures for dopplers. In this way such derived values appear to be ordinary TaQL functions.
Doppler conversions require a MeasFrame containing sky direction, epoch and position on earth. In TaQL these functions can be called like:
which converts the dopplers from LSRK to TOPO.
toref
is a single constant string. pos
can have various value types. A single numeric array is a series of RA,DEC in J2000. If given as a set, the last argument of the set can be the reference types of the values in the set. The values can be strings (indicating planetary objects) or value pairs giving lon,lat. The default reference type is J2000. All such functions return data with type double and unit Hz.
Dopplers can be given like: [v1,v2,...], fromRef where fromRef is the reference type.
A doppler can also be a table column which usually knows its type. It can also be an expression (e.g. DOPPLER[0,]) which also knows the type.
It makes it possible to handle measures in TaQL.
Definition at line 92 of file MeasEngine.h.
|
inline |
Definition at line 95 of file MeasEngine.h.
|
virtual |
|
protected |
Handle a constant Meas value.
|
protected |
Handle the operand representing an array of Meas values.
Bool casacore::MeasEngine< M >::handleMeasType | ( | const TENShPtr & | operand, |
Bool | doThrow | ||
) |
Handle a doppler reference type.
If the reference type is invalid, an exception is only thrown if doThrow=True
. In this way a string argument can be a source name for a direction.
|
protectedpure virtual |
Let a derive class handle the values.
Implemented in casacore::EarthMagneticEngine, casacore::DirectionEngine, casacore::PositionEngine, casacore::FrequencyEngine, casacore::RadialVelocityEngine, casacore::DopplerEngine, and casacore::EpochEngine.
Record casacore::MeasEngine< M >::makeAttributes | ( | typename M::Types | refType, |
Int | valueType = 1 |
||
) | const |
Make the expression result attributes.
|
inline |
Get the reference type.
Definition at line 102 of file MeasEngine.h.
|
protected |
Definition at line 128 of file MeasEngine.h.
|
protected |
Definition at line 131 of file MeasEngine.h.
|
protected |
Definition at line 130 of file MeasEngine.h.
|
protected |
Definition at line 129 of file MeasEngine.h.
Referenced by casacore::MeasEngine< MEpoch >::refType().