casacore
|
Abstract base class for the TaQL UDF conversion engines. More...
#include <BaseEngine.h>
Public Member Functions | |
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 | |
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 | |
Bool | itsIsConst |
IPosition | itsShape |
Int | itsNDim |
Unit | itsInUnit |
Unit | itsOutUnit |
TableExprNode | itsExprNode |
Abstract 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 91 of file BaseEngine.h.
|
inline |
Definition at line 94 of file BaseEngine.h.
|
virtual |
Adapt the output shape and dimensionality for possible constant values.
It also sets the itsIsConst flag. If the given shape is not empty the shape is set to it and an extra axis is added if nvalues>0 (for e.g. LONLAT). If nvalues=1, the first axis is removed from the shape. Note that the shape might have been set to the column's shape if a measure column is used.
Let a derived class derive its attributes.
The default implementation does nothing.
Reimplemented in casacore::EarthMagneticEngine, and casacore::PositionEngine.
void casacore::BaseEngine::extendBase | ( | const BaseEngine & | , |
Bool | removeFirstAxis = False |
||
) |
Extend the shape (if not empty) with the engine's shape.
If the engine is not const, itsIsConst is cleared.
|
inline |
|
inline |
Tell if the expression is constant.
Definition at line 131 of file BaseEngine.h.
References itsIsConst.
|
inline |
|
protectedvirtual |
Let a derived class set its value type.
By default is does nothing.
Reimplemented in casacore::EarthMagneticEngine, and casacore::PositionEngine.
|
inline |
Let a derived class strip part of the reference type.
The default implementation returns the full type string.
Reimplemented in casacore::EarthMagneticEngine, casacore::PositionEngine, and casacore::EpochEngine.
|
inline |
Get the unit of the function's result.
Definition at line 123 of file BaseEngine.h.
References itsOutUnit.
|
protected |
Definition at line 154 of file BaseEngine.h.
|
protected |
Definition at line 152 of file BaseEngine.h.
Referenced by inUnit().
|
protected |
Definition at line 149 of file BaseEngine.h.
Referenced by isConstant().
|
protected |
Definition at line 151 of file BaseEngine.h.
Referenced by ndim().
|
protected |
Definition at line 153 of file BaseEngine.h.
Referenced by unit().
|
protected |
Definition at line 150 of file BaseEngine.h.
Referenced by shape().