casacore
|
Engine for TaQL UDF Direction conversions. More...
#include <DirectionEngine.h>
Public Member Functions | |
DirectionEngine () | |
MDirection::Types | refType () const |
Get the reference 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, Bool riseSet) |
Get the values. More... | |
Array< MDirection > | getDirections (const TableExprId &id) |
Get the directions. More... | |
void | handleDirection (PtrBlock< TableExprNodeRep * > &args, uInt &argnr, Bool riseSet) |
Handle the argument(s) giving the input directions and reference type. More... | |
void | handleDirType (TableExprNodeRep *operand) |
Handle a direction reference type. More... | |
void | setConverter (MDirection::Types toType) |
Set the MeasConvert object. More... | |
void | setEpochEngine (EpochEngine &engine) |
Set the possible epoch engine. More... | |
void | setPositionEngine (PositionEngine &engine) |
Set the possible position engine. More... | |
Private Member Functions | |
void | handleScalars (TableExprNodeRep *e1, TableExprNodeRep *e2) |
void | handleNames (TableExprNodeRep *operand) |
void | handleDirArray (TableExprNodeRep *&operand) |
void | handleConstant (TableExprNodeRep *operand) |
void | handleValues (TableExprNode &operand, const TableExprId &id, Array< MDirection > &directions) |
void | calcRiseSet (double dec, double el, double lat, double ra, double epoch, double &rise, double &set) const |
Calucate the rise and set time of a source for a given elevation, latitude, and epoch. More... | |
Engine for TaQL UDF Direction conversions.
Public interface
DirectionEngine defines Engines (user defined functions) that can be used in TaQL to convert Measures for directions. 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 such functions return data with type double and unit radian.
Futhermore, it is possible to get the rise/set date/time of a source given the source direction, position on earth, and date. These functions return data with type double and unit d (day). If the source is visible all day, the rise time is 0 and set time is 1. If the source is not visible at all, the rise time is 1 and set time is 0. For example: meas.riseset ('SUN', date(), 'WSRT')
Directions 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 direction can also be a table column which usually knows its type. It can also be an expression (e.g. DIRECTION[0,]) which also knows the type.
It makes it possible to handle measures in TaQL.
Definition at line 106 of file DirectionEngine.h.
casacore::DirectionEngine::DirectionEngine | ( | ) |
|
private |
Calucate the rise and set time of a source for a given elevation, latitude, and epoch.
Referenced by unit().
Array<Double> casacore::DirectionEngine::getArrayDouble | ( | const TableExprId & | id, |
Bool | riseSet | ||
) |
Array<MDirection> casacore::DirectionEngine::getDirections | ( | const TableExprId & | id | ) |
Get the directions.
Referenced by unit().
|
private |
Referenced by unit().
|
private |
Referenced by unit().
void casacore::DirectionEngine::handleDirection | ( | PtrBlock< TableExprNodeRep * > & | args, |
uInt & | argnr, | ||
Bool | riseSet | ||
) |
Handle the argument(s) giving the input directions and reference type.
The direction can be a column in a table.
Referenced by unit().
void casacore::DirectionEngine::handleDirType | ( | TableExprNodeRep * | operand | ) |
Handle a direction reference type.
Referenced by unit().
|
private |
Referenced by unit().
|
private |
Referenced by unit().
|
private |
Referenced by unit().
Bool casacore::DirectionEngine::isConstant | ( | ) | const |
Tell if the expression is constant.
Referenced by ndim().
|
inline |
Get the dimensionality.
Definition at line 120 of file DirectionEngine.h.
References isConstant(), and itsNDim.
|
inline |
void casacore::DirectionEngine::setConverter | ( | MDirection::Types | toType | ) |
Set the MeasConvert object.
Referenced by unit().
void casacore::DirectionEngine::setEpochEngine | ( | EpochEngine & | engine | ) |
void casacore::DirectionEngine::setPositionEngine | ( | PositionEngine & | engine | ) |
|
inline |
|
inline |
Get the unit.
Definition at line 127 of file DirectionEngine.h.
References calcRiseSet(), getArrayDouble(), getDirections(), handleConstant(), handleDirArray(), handleDirection(), handleDirType(), handleNames(), handleScalars(), handleValues(), itsUnit, setConverter(), setEpochEngine(), and setPositionEngine().
|
private |
Definition at line 178 of file DirectionEngine.h.
|
private |
Definition at line 177 of file DirectionEngine.h.
|
private |
Definition at line 182 of file DirectionEngine.h.
|
private |
Definition at line 180 of file DirectionEngine.h.
|
private |
Definition at line 176 of file DirectionEngine.h.
|
private |
Definition at line 181 of file DirectionEngine.h.
|
private |
Definition at line 174 of file DirectionEngine.h.
Referenced by ndim().
|
private |
Definition at line 183 of file DirectionEngine.h.
|
private |
Definition at line 179 of file DirectionEngine.h.
Referenced by refType().
|
private |
Definition at line 173 of file DirectionEngine.h.
Referenced by shape().
|
private |
Definition at line 175 of file DirectionEngine.h.
Referenced by unit().