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

Engine for TaQL UDF Epoch conversions. More...

#include <EpochEngine.h>

Public Member Functions

 EpochEngine ()
 
MEpoch::Types refType () const
 Get the reference type. More...
 
Bool sidFrac () const
 Tell if the fraction has to be used for sidereal times. 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)
 Get the values. More...
 
Array< MEpochgetEpochs (const TableExprId &id)
 Get the epochs. More...
 
void handleEpoch (PtrBlock< TableExprNodeRep *> &args, uInt &argnr)
 Handle the argument(s) giving the input epochs and reference type. More...
 
Bool handleEpochType (TableExprNodeRep *operand, Bool doThrow)
 Handle a epoch reference type. More...
 
void setConverter (MEpoch::Types toType, Bool sidFrac)
 Set the MeasConvert object. More...
 
void setPositionEngine (PositionEngine &engine)
 Set the possible position engine. More...
 

Private Member Functions

void handleEpochArray (TableExprNodeRep *operand)
 
void handleConstant (TableExprNodeRep *operand)
 

Private Attributes

IPosition itsShape
 
Int itsNDim
 
Unit itsUnit
 
Bool itsSidFrac
 
MeasFrame itsFrame
 
MEpoch::Convert itsConverter
 
Vector< MEpochitsConstants
 
MEpoch::Types itsRefType
 
TableExprNode itsExprNode
 
ScalarMeasColumn< MEpochitsMeasScaCol
 
ArrayMeasColumn< MEpochitsMeasArrCol
 
PositionEngineitsPositionEngine
 

Detailed Description

Engine for TaQL UDF Epoch conversions.

Intended use:

Public interface

Review Status

Test programs:
tMeas

Prerequisite

Synopsis

EpochEngine defines Engines (user defined functions) that can be used in TaQL to convert Measures for epochs. In this way such derived values appear to be ordinary TaQL functions.

In TaQL these functions can be called like:

meas.epoch (toref, time, fromref)
meas.last (time, fromref, pos, posref)
For example,
meas.epoch ('UTC', 1e9 s, 'WGS84')

All functions have data type double and unit radian.

A epoch can also be a table column which usually knows its type. It can also be an expression (e.g. EPOCH[0,]) which also knows the type.

Motivation

It makes it possible to handle measures in TaQL.

Definition at line 89 of file EpochEngine.h.

Constructor & Destructor Documentation

◆ EpochEngine()

casacore::EpochEngine::EpochEngine ( )

Member Function Documentation

◆ getArrayDouble()

Array<Double> casacore::EpochEngine::getArrayDouble ( const TableExprId id)

Get the values.

Referenced by unit().

◆ getEpochs()

Array<MEpoch> casacore::EpochEngine::getEpochs ( const TableExprId id)

Get the epochs.

Referenced by unit().

◆ handleConstant()

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

Referenced by unit().

◆ handleEpoch()

void casacore::EpochEngine::handleEpoch ( PtrBlock< TableExprNodeRep *> &  args,
uInt argnr 
)

Handle the argument(s) giving the input epochs and reference type.

The epoch can be a column in a table.

Referenced by unit().

◆ handleEpochArray()

void casacore::EpochEngine::handleEpochArray ( TableExprNodeRep operand)
private

Referenced by unit().

◆ handleEpochType()

Bool casacore::EpochEngine::handleEpochType ( TableExprNodeRep operand,
Bool  doThrow 
)

Handle a epoch reference type.

If the reference type is invalid, an exception is only thrown if doThrow=True. In this way a string argument can be an observatory name for a position.

Referenced by unit().

◆ isConstant()

Bool casacore::EpochEngine::isConstant ( ) const

Tell if the expression is constant.

Referenced by ndim().

◆ ndim()

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

Get the dimensionality.

Definition at line 107 of file EpochEngine.h.

References isConstant(), and itsNDim.

◆ refType()

MEpoch::Types casacore::EpochEngine::refType ( ) const
inline

Get the reference type.

Definition at line 95 of file EpochEngine.h.

References itsRefType.

◆ setConverter()

void casacore::EpochEngine::setConverter ( MEpoch::Types  toType,
Bool  sidFrac 
)

Set the MeasConvert object.

Referenced by unit().

◆ setPositionEngine()

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

Set the possible position engine.

It can be done only once.

Referenced by unit().

◆ shape()

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

Get the shape.

Definition at line 103 of file EpochEngine.h.

References itsShape.

◆ sidFrac()

Bool casacore::EpochEngine::sidFrac ( ) const
inline

Tell if the fraction has to be used for sidereal times.

Definition at line 99 of file EpochEngine.h.

References itsSidFrac.

Referenced by unit().

◆ unit()

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

Member Data Documentation

◆ itsConstants

Vector<MEpoch> casacore::EpochEngine::itsConstants
private

Definition at line 152 of file EpochEngine.h.

◆ itsConverter

MEpoch::Convert casacore::EpochEngine::itsConverter
private

Definition at line 151 of file EpochEngine.h.

◆ itsExprNode

TableExprNode casacore::EpochEngine::itsExprNode
private

Definition at line 154 of file EpochEngine.h.

◆ itsFrame

MeasFrame casacore::EpochEngine::itsFrame
private

Definition at line 150 of file EpochEngine.h.

◆ itsMeasArrCol

ArrayMeasColumn<MEpoch> casacore::EpochEngine::itsMeasArrCol
private

Definition at line 156 of file EpochEngine.h.

◆ itsMeasScaCol

ScalarMeasColumn<MEpoch> casacore::EpochEngine::itsMeasScaCol
private

Definition at line 155 of file EpochEngine.h.

◆ itsNDim

Int casacore::EpochEngine::itsNDim
private

Definition at line 147 of file EpochEngine.h.

Referenced by ndim().

◆ itsPositionEngine

PositionEngine* casacore::EpochEngine::itsPositionEngine
private

Definition at line 157 of file EpochEngine.h.

◆ itsRefType

MEpoch::Types casacore::EpochEngine::itsRefType
private

Definition at line 153 of file EpochEngine.h.

Referenced by refType().

◆ itsShape

IPosition casacore::EpochEngine::itsShape
private

Definition at line 146 of file EpochEngine.h.

Referenced by shape().

◆ itsSidFrac

Bool casacore::EpochEngine::itsSidFrac
private

Definition at line 149 of file EpochEngine.h.

Referenced by sidFrac().

◆ itsUnit

Unit casacore::EpochEngine::itsUnit
private

Definition at line 148 of file EpochEngine.h.

Referenced by unit().


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