casacore
|
Engine for TaQL UDF Position conversions. More...
#include <PositionEngine.h>
Public Member Functions | |
PositionEngine () | |
MPosition::Types | refType () const |
Get the reference type. More... | |
Int | valueType () const |
Get the value type. More... | |
const IPosition & | shape () const |
Get the shape. More... | |
Int | ndim () const |
Get the dimensionality. More... | |
Bool | isConstant () const |
Tell if the expression is constant. More... | |
const Unit & | unit () const |
Get the unit. More... | |
Array< Double > | getArrayDouble (const TableExprId &id, MPosition::Types toRefType, Int toValueType) |
Get the values. More... | |
Array< MPosition > | getPositions (const TableExprId &id) |
Get the positions. More... | |
void | handlePosition (Int toValueType, PtrBlock< TableExprNodeRep *> &args, uInt &argnr) |
Handle the argument(s) giving the input positions and reference type. More... | |
void | handlePosType (TableExprNodeRep *operand) |
Handle a position reference type and optional suffix. More... | |
Private Member Functions | |
void | makeDefaults (const Unit &unit) |
MPosition | makePosition (const Quantity &qh, const Quantity &q1, const Quantity &q2) const |
Make an MPosition from xyz or angles,height. More... | |
void | handleScalars (TableExprNodeRep *e1, TableExprNodeRep *e2, TableExprNodeRep *heightNode) |
void | handleObservatory (TableExprNodeRep *operand) |
void | handlePosArray (TableExprNodeRep *&operand) |
void | handlePosArray (TableExprNodeRep *angles, TableExprNodeRep *height) |
void | handleConstant (TableExprNodeRep *operand) |
void | handleValues (TableExprNode &operand, const TableExprId &id, Array< MPosition > &positions) |
Engine for TaQL UDF Position conversions.
Public interface
PositionEngine defines Engines (user defined functions) that can be used in TaQL to convert Measures for positions. In this way such derived values appear to be ordinary TaQL functions.
In TaQL these functions can be called like:
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 functions have data type double and unit radian.
Positions can be given like: [x1,y1,z1,x2,y2,z2,...], fromRef [lon1,lat1,lon2,lat2,...], fromRef [lon1,lat1,lon2,lat2,...], [h1,h2,...], fromRef where fromRef is the reference type optionally followed by _xxx where xxx can be 'xyz' or 'll' to specify if the values are given as xyz or as lon,lat. If xxx is not given, it will be derived from the unit type of the values (length means xyz, angle means lon,lat with default height is 0). If xxx nor units are given, 3 values means xyz and 2 values means lon,lat. If heights are also given, xxx must be 'll' if it is also given.
A position can also be a table column which usually knows its type. It can also be an expression (e.g. POSITION[0,]) which also knows the type.
It makes it possible to handle measures in TaQL.
Definition at line 100 of file PositionEngine.h.
casacore::PositionEngine::PositionEngine | ( | ) |
Array<Double> casacore::PositionEngine::getArrayDouble | ( | const TableExprId & | id, |
MPosition::Types | toRefType, | ||
Int | toValueType | ||
) |
Get the values.
Referenced by unit().
Array<MPosition> casacore::PositionEngine::getPositions | ( | const TableExprId & | id | ) |
Get the positions.
Referenced by unit().
|
private |
Referenced by unit().
|
private |
Referenced by unit().
|
private |
Referenced by unit().
|
private |
void casacore::PositionEngine::handlePosition | ( | Int | toValueType, |
PtrBlock< TableExprNodeRep *> & | args, | ||
uInt & | argnr | ||
) |
Handle the argument(s) giving the input positions and reference type.
The position can be a column in a table.
Referenced by unit().
void casacore::PositionEngine::handlePosType | ( | TableExprNodeRep * | operand | ) |
Handle a position reference type and optional suffix.
Referenced by unit().
|
private |
Referenced by unit().
|
private |
Referenced by unit().
|
inline |
Tell if the expression is constant.
Definition at line 123 of file PositionEngine.h.
References itsConstants.
|
inline |
|
inline |
|
inline |
|
inline |
Get the unit.
Definition at line 127 of file PositionEngine.h.
References getArrayDouble(), getPositions(), handleConstant(), handleObservatory(), handlePosArray(), handlePosition(), handlePosType(), handleScalars(), handleValues(), itsOutUnit, makeDefaults(), and makePosition().
|
inline |
Get the value type.
It also gives the nr of output values per position. 0=default, 1=height, 2=angles, 3=xyz
Definition at line 111 of file PositionEngine.h.
References itsValueType.
Definition at line 169 of file PositionEngine.h.
Referenced by isConstant().
|
private |
Definition at line 168 of file PositionEngine.h.
|
private |
Definition at line 173 of file PositionEngine.h.
|
private |
Definition at line 166 of file PositionEngine.h.
|
private |
Definition at line 174 of file PositionEngine.h.
|
private |
Definition at line 165 of file PositionEngine.h.
Referenced by ndim().
|
private |
Definition at line 167 of file PositionEngine.h.
Referenced by unit().
|
private |
Definition at line 170 of file PositionEngine.h.
Referenced by refType().
|
private |
Definition at line 164 of file PositionEngine.h.
Referenced by shape().
|
private |
Definition at line 171 of file PositionEngine.h.
Referenced by valueType().