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

More...

`#include <BaseEngine.h>`

## Public Member Functions

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

## Protected Member Functions

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.
virtual String | stripMeasType (const String &type)
| Let a derived class strip part of the reference type.

## Protected Attributes

Bool | itsIsConst
IPosition | itsShape
Int | itsNDim
Unit | itsInUnit
Unit | itsOutUnit
TableExprNode | itsExprNode

## Detailed Description

Abstract base class for the TaQL UDF conversion engines

### Intended use:

Public interface

### Review Status

Test programs:
  tMeas

### Prerequisite

- EngineBase

### Synopsis

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

Doppler conversions require a MeasFrame containing sky direction, epoch and position on earth. In TaQL these functions can be called like:

meas.rv ('TOPO', 1 'm/s', 'LSRK', 'CasA', date(),
[1e6m,1e6m,1e6m], 'WGS84')
casacore::date
TableExprNode date(const TableExprNode &node)
Definition ExprNode.h:1515

which converts the dopplers from LSRK to TOPO.

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

Dopplers can be given like: [v1,v2,...], fromRef where fromRef is the reference type.

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

### Motivation

It makes it possible to handle measures in TaQL.

Definition at line 89 of file BaseEngine.h.

## Constructor & Destructor Documentation

## BaseEngine()

casacore::BaseEngine::BaseEngine | ( |  | ) |

inline

Definition at line 92 of file BaseEngine.h.

References casacore::False, itsIsConst, and itsNDim.

Referenced by extendBase().

## ~BaseEngine()

virtual casacore::BaseEngine::~BaseEngine | ( |  | ) |

virtual

## Member Function Documentation

## adaptForConstant()

void casacore::BaseEngine::adaptForConstant | ( | const IPosition & | shapeConstant,
|  | uInt | nvalues = 0 )

Adapt the output shape and dimensionality for possible constant values.

It also sets the itsIsConst flag. If the given shape is not empty the shape is set to it and an extra axis is added if nvalues>0 (for e.g. LONLAT). If nvalues=1, the first axis is removed from the shape. Note that the shape might have been set to the column's shape if a measure column is used.

## deriveAttr()

virtual void casacore::BaseEngine::deriveAttr | ( | const Unit & | unit,
|  | Int | nval )

protected virtual

Let a derived class derive its attributes.

The default implementation does nothing.

Reimplemented in casacore::EarthMagneticEngine, and casacore::PositionEngine.

References unit().

## extendBase()

void casacore::BaseEngine::extendBase | ( | const BaseEngine & | ,
|  | Bool | removeFirstAxis = False )

Extend the shape (if not empty) with the engine's shape.

If the engine is not const, itsIsConst is cleared.

References BaseEngine(), and casacore::False.

## inUnit()

const Unit & casacore::BaseEngine::inUnit | ( |  | ) | const

inline

Get the unit of the expression.

Definition at line 125 of file BaseEngine.h.

References itsInUnit.

## isConstant()

Bool casacore::BaseEngine::isConstant | ( |  | ) | const

inline

Tell if the expression is constant.

Definition at line 129 of file BaseEngine.h.

References itsIsConst.

## ndim()

Int casacore::BaseEngine::ndim | ( |  | ) | const

inline

Get the output dimensionality.

Definition at line 117 of file BaseEngine.h.

References itsNDim.

## setValueType()

virtual void casacore::BaseEngine::setValueType | ( | Int | valueType | ) |

protected virtual

Let a derived class set its value type.

By default is does nothing.

Reimplemented in casacore::EarthMagneticEngine, and casacore::PositionEngine.

## shape()

const IPosition & casacore::BaseEngine::shape | ( |  | ) | const

inline

Get the output shape.

Definition at line 113 of file BaseEngine.h.

References itsShape.

## stripMeasType()

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

protected virtual

Let a derived class strip part of the reference type.

The default implementation returns the full type string.

Reimplemented in casacore::EarthMagneticEngine, casacore::EpochEngine, and casacore::PositionEngine.

## unit()

const Unit & casacore::BaseEngine::unit | ( |  | ) | const

inline

Get the unit of the function's result.

Definition at line 121 of file BaseEngine.h.

References itsOutUnit.

Referenced by deriveAttr(), casacore::EarthMagneticEngine::deriveAttr(), and casacore::PositionEngine::deriveAttr().

## Member Data Documentation

## itsExprNode

TableExprNode casacore::BaseEngine::itsExprNode

protected

Definition at line 152 of file BaseEngine.h.

## itsInUnit

Unit casacore::BaseEngine::itsInUnit

protected

Definition at line 150 of file BaseEngine.h.

Referenced by inUnit().

## itsIsConst

Bool casacore::BaseEngine::itsIsConst

protected

Definition at line 147 of file BaseEngine.h.

Referenced by BaseEngine(), and isConstant().

## itsNDim

Int casacore::BaseEngine::itsNDim

protected

Definition at line 149 of file BaseEngine.h.

Referenced by BaseEngine(), and ndim().

## itsOutUnit

Unit casacore::BaseEngine::itsOutUnit

protected

Definition at line 151 of file BaseEngine.h.

Referenced by unit().

## itsShape

IPosition casacore::BaseEngine::itsShape

protected

Definition at line 148 of file BaseEngine.h.

Referenced by shape().

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

- meas/MeasUDF/BaseEngine.h