casacore
|
#include <PositionEngine.h>
Public Member Functions | |
PositionEngine () | |
virtual | ~PositionEngine () |
Int | valueType () const |
Get the value type. 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, const std::vector< TENShPtr > &args, uInt &argnr) |
Handle the argument(s) giving the input positions and reference type. More... | |
Public Member Functions inherited from casacore::MeasEngine< MPosition > | |
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... | |
Private Member Functions | |
virtual String | stripMeasType (const String &type) |
Let a derived class strip part of the reference type. More... | |
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... | |
MPosition | makePosition (const Quantity &qh, const Quantity &q1, const Quantity &q2) const |
Make an MPosition from xyz or height,angles. More... | |
void | handleScalars (const TENShPtr &e1, const TENShPtr &e2, const TENShPtr &e3, Int nval) |
void | handleObservatory (const TENShPtr &operand) |
void | handlePosArray (const TENShPtr &angles, const TENShPtr &height) |
virtual void | handleValues (TableExprNode &operand, const TableExprId &id, Array< MPosition > &positions) |
Let a derive class handle the values. More... | |
Private Attributes | |
Int | itsValueType |
Additional Inherited Members | |
Protected Member Functions inherited from casacore::MeasEngine< MPosition > | |
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... | |
Protected Attributes inherited from casacore::MeasEngine< MPosition > | |
Array< MPosition > | itsConstants |
M::Types | itsRefType |
ScalarMeasColumn< MPosition > | itsMeasScaCol |
ArrayMeasColumn< MPosition > | itsMeasArrCol |
Protected Attributes inherited from casacore::BaseEngine | |
Bool | itsIsConst |
IPosition | itsShape |
Int | itsNDim |
Unit | itsInUnit |
Unit | itsOutUnit |
TableExprNode | itsExprNode |
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 defining the reference frame to convert to. Note it should be omitted for the functions (e.g., meas.wgs) with an implicit destination reference frame. The reference type WGS84 or ITRF can optionally have the suffix XYZ, LLH, LL (or LONLAT) and H (or HEIGHT) telling how the result should be returned. pos
specifies the position(s) which can be done in various ways. POSITION[0,]
. Often this is a TableMeasures column which is recognized as such, also its source reference frame. If such a column is used in a expression, it will not be recognized as a TableMeasures column and its reference frame should be given. The result of the function is an array with shape [2|3,pos] if lon,lat(,h) or x,y,z is returned and shape [pos] if height is returned. The last element is the shape of the position argument. It is omitted if it has length 1. In such a case getting the height results in a scalar.
It makes it possible to handle measures in TaQL.
Definition at line 126 of file PositionEngine.h.
casacore::PositionEngine::PositionEngine | ( | ) |
|
virtual |
Let a derived class derive its attributes.
The default implementation does nothing.
Reimplemented from casacore::BaseEngine.
Array<Double> casacore::PositionEngine::getArrayDouble | ( | const TableExprId & | id, |
MPosition::Types | toRefType, | ||
Int | toValueType | ||
) |
Get the values.
Array<MPosition> casacore::PositionEngine::getPositions | ( | const TableExprId & | id | ) |
Get the positions.
|
private |
|
private |
void casacore::PositionEngine::handlePosition | ( | Int | toValueType, |
const std::vector< TENShPtr > & | args, | ||
uInt & | argnr | ||
) |
Handle the argument(s) giving the input positions and reference type.
The position can be a column in a table.
|
private |
|
privatevirtual |
Let a derive class handle the values.
Implements casacore::MeasEngine< MPosition >.
|
private |
Make an MPosition from xyz or height,angles.
|
privatevirtual |
Let a derived class set its value type.
By default is does nothing.
Reimplemented from casacore::BaseEngine.
Let a derived class strip part of the reference type.
The default implementation returns the full type string.
Reimplemented from casacore::BaseEngine.
|
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 135 of file PositionEngine.h.
References itsValueType.
|
private |
Definition at line 173 of file PositionEngine.h.
Referenced by valueType().