casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
casacore::BaseEngine Class Reference

Abstract base class for the TaQL UDF conversion engines. More...

#include <BaseEngine.h>

Inheritance diagram for casacore::BaseEngine:
casacore::MeasEngine< M > casacore::MeasEngine< MDirection > casacore::MeasEngine< MDoppler > casacore::MeasEngine< MEarthMagnetic > casacore::MeasEngine< MEpoch > casacore::MeasEngine< MFrequency > casacore::MeasEngine< MPosition > casacore::MeasEngine< MRadialVelocity >

Public Member Functions

 BaseEngine ()
 
virtual ~BaseEngine ()
 
void adaptForConstant (const IPosition &shapeConstant, uInt nvalues=0)
 Adapt the output shape and dimensionality for possible constant values. More...
 
void extendBase (const BaseEngine &, Bool removeFirstAxis=False)
 Extend the shape (if not empty) with the engine's shape. More...
 
const IPositionshape () const
 Get the output shape. More...
 
Int ndim () const
 Get the output dimensionality. More...
 
const Unitunit () const
 Get the unit of the function's result. More...
 
const UnitinUnit () const
 Get the unit of the expression. More...
 
Bool isConstant () const
 Tell if the expression is constant. More...
 

Protected Member Functions

virtual void deriveAttr (const Unit &unit, Int nval)
 Let a derived class derive its attributes. More...
 
virtual void setValueType (Int valueType)
 Let a derived class set its value type. More...
 
virtual String stripMeasType (const String &type)
 Let a derived class strip part of the reference type. More...
 

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

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')

which converts the dopplers from LSRK to TOPO.

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 91 of file BaseEngine.h.

Constructor & Destructor Documentation

casacore::BaseEngine::BaseEngine ( )
inline

Definition at line 94 of file BaseEngine.h.

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

Member Function Documentation

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.

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

Let a derived class derive its attributes.

The default implementation does nothing.

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

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.

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

Get the unit of the expression.

Definition at line 127 of file BaseEngine.h.

References itsInUnit.

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

Tell if the expression is constant.

Definition at line 131 of file BaseEngine.h.

References itsIsConst.

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

Get the output dimensionality.

Definition at line 119 of file BaseEngine.h.

References itsNDim.

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

Let a derived class set its value type.

By default is does nothing.

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

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

Get the output shape.

Definition at line 115 of file BaseEngine.h.

References itsShape.

virtual String casacore::BaseEngine::stripMeasType ( const String type)
protectedvirtual

Let a derived class strip part of the reference type.

The default implementation returns the full type string.

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

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

Get the unit of the function's result.

Definition at line 123 of file BaseEngine.h.

References itsOutUnit.

Member Data Documentation

TableExprNode casacore::BaseEngine::itsExprNode
protected

Definition at line 154 of file BaseEngine.h.

Unit casacore::BaseEngine::itsInUnit
protected

Definition at line 152 of file BaseEngine.h.

Referenced by inUnit().

Bool casacore::BaseEngine::itsIsConst
protected

Definition at line 149 of file BaseEngine.h.

Referenced by isConstant().

Int casacore::BaseEngine::itsNDim
protected

Definition at line 151 of file BaseEngine.h.

Referenced by ndim().

Unit casacore::BaseEngine::itsOutUnit
protected

Definition at line 153 of file BaseEngine.h.

Referenced by unit().

IPosition casacore::BaseEngine::itsShape
protected

Definition at line 150 of file BaseEngine.h.

Referenced by shape().


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