casacore
Public Member Functions | Private Member Functions | Private Attributes | List of all members
casacore::DirectionEngine Class Reference

Engine for TaQL UDF Direction conversions. More...

#include <DirectionEngine.h>

Public Member Functions

 DirectionEngine ()
 
MDirection::Types refType () const
 Get the reference type. More...
 
const IPositionshape () const
 Get the shape. More...
 
Int ndim () const
 Get the dimensionality. More...
 
Bool isConstant () const
 Tell if the expression is constant. More...
 
const Unitunit () const
 Get the unit. More...
 
Array< DoublegetArrayDouble (const TableExprId &id, Bool riseSet)
 Get the values. More...
 
Array< MDirectiongetDirections (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...
 

Private Attributes

IPosition itsShape
 
Int itsNDim
 
Unit itsUnit
 
MeasFrame itsFrame
 
MDirection::Convert itsConverter
 
Vector< MDirectionitsConstants
 
MDirection::Types itsRefType
 
TableExprNode itsExprNode
 
ArrayMeasColumn< MDirectionitsMeasCol
 
EpochEngineitsEpochEngine
 
PositionEngineitsPositionEngine
 

Detailed Description

Engine for TaQL UDF Direction conversions.

Intended use:

Public interface

Review Status

Test programs:
tMeas

Prerequisite

Synopsis

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:

meas.dir ('APP', 'MOON', date(), [1e6m,1e6m,1e6m], 'WGS84')

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.

Motivation

It makes it possible to handle measures in TaQL.

Definition at line 106 of file DirectionEngine.h.

Constructor & Destructor Documentation

§ DirectionEngine()

casacore::DirectionEngine::DirectionEngine ( )

Member Function Documentation

§ calcRiseSet()

void casacore::DirectionEngine::calcRiseSet ( double  dec,
double  el,
double  lat,
double  ra,
double  epoch,
double &  rise,
double &  set 
) const
private

Calucate the rise and set time of a source for a given elevation, latitude, and epoch.

Referenced by unit().

§ getArrayDouble()

Array<Double> casacore::DirectionEngine::getArrayDouble ( const TableExprId id,
Bool  riseSet 
)

Get the values.

The Bools tell if rise/set times have to be calculated.

Referenced by unit().

§ getDirections()

Array<MDirection> casacore::DirectionEngine::getDirections ( const TableExprId id)

Get the directions.

Referenced by unit().

§ handleConstant()

void casacore::DirectionEngine::handleConstant ( TableExprNodeRep operand)
private

Referenced by unit().

§ handleDirArray()

void casacore::DirectionEngine::handleDirArray ( TableExprNodeRep *&  operand)
private

Referenced by unit().

§ handleDirection()

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().

§ handleDirType()

void casacore::DirectionEngine::handleDirType ( TableExprNodeRep operand)

Handle a direction reference type.

Referenced by unit().

§ handleNames()

void casacore::DirectionEngine::handleNames ( TableExprNodeRep operand)
private

Referenced by unit().

§ handleScalars()

void casacore::DirectionEngine::handleScalars ( TableExprNodeRep e1,
TableExprNodeRep e2 
)
private

Referenced by unit().

§ handleValues()

void casacore::DirectionEngine::handleValues ( TableExprNode operand,
const TableExprId id,
Array< MDirection > &  directions 
)
private

Referenced by unit().

§ isConstant()

Bool casacore::DirectionEngine::isConstant ( ) const

Tell if the expression is constant.

Referenced by ndim().

§ ndim()

Int casacore::DirectionEngine::ndim ( ) const
inline

Get the dimensionality.

Definition at line 120 of file DirectionEngine.h.

References isConstant(), and itsNDim.

§ refType()

MDirection::Types casacore::DirectionEngine::refType ( ) const
inline

Get the reference type.

Definition at line 112 of file DirectionEngine.h.

References itsRefType.

§ setConverter()

void casacore::DirectionEngine::setConverter ( MDirection::Types  toType)

Set the MeasConvert object.

Referenced by unit().

§ setEpochEngine()

void casacore::DirectionEngine::setEpochEngine ( EpochEngine engine)

Set the possible epoch engine.

It can be done only once.

Referenced by unit().

§ setPositionEngine()

void casacore::DirectionEngine::setPositionEngine ( PositionEngine engine)

Set the possible position engine.

It can be done only once.

Referenced by unit().

§ shape()

const IPosition& casacore::DirectionEngine::shape ( ) const
inline

Get the shape.

Definition at line 116 of file DirectionEngine.h.

References itsShape.

§ unit()

const Unit& casacore::DirectionEngine::unit ( ) const
inline

Member Data Documentation

§ itsConstants

Vector<MDirection> casacore::DirectionEngine::itsConstants
private

Definition at line 178 of file DirectionEngine.h.

§ itsConverter

MDirection::Convert casacore::DirectionEngine::itsConverter
private

Definition at line 177 of file DirectionEngine.h.

§ itsEpochEngine

EpochEngine* casacore::DirectionEngine::itsEpochEngine
private

Definition at line 182 of file DirectionEngine.h.

§ itsExprNode

TableExprNode casacore::DirectionEngine::itsExprNode
private

Definition at line 180 of file DirectionEngine.h.

§ itsFrame

MeasFrame casacore::DirectionEngine::itsFrame
private

Definition at line 176 of file DirectionEngine.h.

§ itsMeasCol

ArrayMeasColumn<MDirection> casacore::DirectionEngine::itsMeasCol
private

Definition at line 181 of file DirectionEngine.h.

§ itsNDim

Int casacore::DirectionEngine::itsNDim
private

Definition at line 174 of file DirectionEngine.h.

Referenced by ndim().

§ itsPositionEngine

PositionEngine* casacore::DirectionEngine::itsPositionEngine
private

Definition at line 183 of file DirectionEngine.h.

§ itsRefType

MDirection::Types casacore::DirectionEngine::itsRefType
private

Definition at line 179 of file DirectionEngine.h.

Referenced by refType().

§ itsShape

IPosition casacore::DirectionEngine::itsShape
private

Definition at line 173 of file DirectionEngine.h.

Referenced by shape().

§ itsUnit

Unit casacore::DirectionEngine::itsUnit
private

Definition at line 175 of file DirectionEngine.h.

Referenced by unit().


The documentation for this class was generated from the following file: