Loading...
Searching...
No Matches
casacore::EpochEngine Class Reference
meas package (libcasa_meas) » MeasUDF_module

More...

`#include <EpochEngine.h>`

## Public Member Functions

| EpochEngine ()
virtual | ~EpochEngine ()
Bool | sidFrac () const
| Tell if the fraction has to be used for sidereal times.
Array< Double > | getArrayDouble (const TableExprId &id)
| Get the values.
Array< MEpoch > | getEpochs (const TableExprId &id)
| Get the epochs.
void | handleEpoch (std::vector< TENShPtr > &args, uInt &argnr)
| Handle the argument(s) giving the input epochs and reference type.
void | setConverter (MEpoch::Types toType, Bool sidFrac)
| Set the MeasConvert object.
void | setPositionEngine (PositionEngine &engine)
| Set the possible position engine.
Public Member Functions inherited from casacore::MeasEngine< MEpoch >
| MeasEngine ()
virtual | ~MeasEngine ()
MEpoch::Types | refType () const
| Get the reference type.
Bool | handleMeasType (const TENShPtr &operand, Bool doThrow)
| Handle a doppler reference type.
Record | makeAttributes (typename MEpoch::Types refType, Int valueType=1) const
| Make the expression result attributes.
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.
void | extendBase (const BaseEngine &, Bool removeFirstAxis=False)
| Extend the shape (if not empty) with the engine's shape.
const IPosition & | shape () const
| Get the output shape.
Int | ndim () const
| Get the output dimensionality.
const Unit & | unit () const
| Get the unit of the function's result.
const Unit & | inUnit () const
| Get the unit of the expression.
Bool | isConstant () const
| Tell if the expression is constant.

## Private Member Functions

virtual String | stripMeasType (const String &type)
| Strip a possible prefix from the epoch type.
virtual void | handleValues (TableExprNode &operand, const TableExprId &id, Array< MEpoch > &epochs)
| Let a derive class handle the values.

## Private Attributes

Bool | itsSidFrac
MeasFrame | itsFrame
MEpoch::Convert | itsConverter
PositionEngine * | itsPositionEngine

## Additional Inherited Members

Protected Member Functions inherited from casacore::MeasEngine< MEpoch >
void | handleMeasArray (const TENShPtr &operand)
| Handle the operand representing an array of Meas values.
void | handleConstant (const TENShPtr &operand)
| Handle a constant Meas value.
Protected Member Functions inherited from casacore::BaseEngine
virtual void | deriveAttr (const Unit &unit, Int nval)
| Let a derived class derive its attributes.
virtual void | setValueType (Int valueType)
| Let a derived class set its value type.
Protected Attributes inherited from casacore::MeasEngine< MEpoch >
Array< MEpoch > | itsConstants
MEpoch::Types | itsRefType
ScalarMeasColumn< MEpoch > | itsMeasScaCol
ArrayMeasColumn< MEpoch > | itsMeasArrCol
Protected Attributes inherited from casacore::BaseEngine
Bool | itsIsConst
IPosition | itsShape
Int | itsNDim
Unit | itsInUnit
Unit | itsOutUnit
TableExprNode | itsExprNode

## Detailed Description

Engine for TaQL UDF Epoch conversions

### Intended use:

Public interface

### Review Status

Test programs:
  tMeas

### Prerequisite

- EngineBase

### 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')
casacore::time
TableExprNode time(const TableExprNode &node)
Definition ExprNode.h:1584

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

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 88 of file EpochEngine.h.

## Constructor & Destructor Documentation

## EpochEngine()

casacore::EpochEngine::EpochEngine | ( |  | ) |

## ~EpochEngine()

virtual casacore::EpochEngine::~EpochEngine | ( |  | ) |

virtual

## Member Function Documentation

## getArrayDouble()

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

Get the values.

## getEpochs()

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

Get the epochs.

## handleEpoch()

void casacore::EpochEngine::handleEpoch | ( | std::vector< TENShPtr > & | args,
|  | uInt & | argnr )

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

The epoch can be a column in a table.

## handleValues()

virtual void casacore::EpochEngine::handleValues | ( | TableExprNode & | operand,
|  | const TableExprId & | id,
|  | Array< MEpoch > & | positions )

private virtual

Let a derive class handle the values.

Implements casacore::MeasEngine< MEpoch >.

## setConverter()

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

Set the MeasConvert object.

References sidFrac().

## setPositionEngine()

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

Set the possible position engine.

It can be done only once.

## sidFrac()

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

inline

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

Definition at line 96 of file EpochEngine.h.

References itsSidFrac.

Referenced by setConverter().

## stripMeasType()

virtual String casacore::EpochEngine::stripMeasType | ( | const String & | type | ) |

private virtual

Strip a possible prefix from the epoch type.

Reimplemented from casacore::BaseEngine.

## Member Data Documentation

## itsConverter

MEpoch::Convert casacore::EpochEngine::itsConverter

private

Definition at line 127 of file EpochEngine.h.

## itsFrame

MeasFrame casacore::EpochEngine::itsFrame

private

Definition at line 126 of file EpochEngine.h.

## itsPositionEngine

PositionEngine* casacore::EpochEngine::itsPositionEngine

private

Definition at line 128 of file EpochEngine.h.

## itsSidFrac

Bool casacore::EpochEngine::itsSidFrac

private

Definition at line 125 of file EpochEngine.h.

Referenced by sidFrac().

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

- meas/MeasUDF/EpochEngine.h