casacore
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
casacore::BaseEngine Class Reference

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. 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')
TableExprNode date(const TableExprNode &node)
Definition: ExprNode.h:1511

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

◆ BaseEngine()

casacore::BaseEngine::BaseEngine ( )
inline

Definition at line 94 of file BaseEngine.h.

◆ ~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 
)
protectedvirtual

Let a derived class derive its attributes.

The default implementation does nothing.

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

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

◆ inUnit()

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

Get the unit of the expression.

Definition at line 127 of file BaseEngine.h.

References itsInUnit.

◆ isConstant()

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

Tell if the expression is constant.

Definition at line 131 of file BaseEngine.h.

References itsIsConst.

◆ ndim()

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

Get the output dimensionality.

Definition at line 119 of file BaseEngine.h.

References itsNDim.

◆ setValueType()

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

Let a derived class set its value type.

By default is does nothing.

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

◆ shape()

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

Get the output shape.

Definition at line 115 of file BaseEngine.h.

References itsShape.

◆ stripMeasType()

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::PositionEngine, casacore::EpochEngine, and casacore::EarthMagneticEngine.

◆ unit()

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

◆ itsExprNode

TableExprNode casacore::BaseEngine::itsExprNode
protected

Definition at line 154 of file BaseEngine.h.

◆ itsInUnit

Unit casacore::BaseEngine::itsInUnit
protected

Definition at line 152 of file BaseEngine.h.

Referenced by inUnit().

◆ itsIsConst

Bool casacore::BaseEngine::itsIsConst
protected

Definition at line 149 of file BaseEngine.h.

Referenced by isConstant().

◆ itsNDim

Int casacore::BaseEngine::itsNDim
protected

Definition at line 151 of file BaseEngine.h.

Referenced by ndim().

◆ itsOutUnit

Unit casacore::BaseEngine::itsOutUnit
protected

Definition at line 153 of file BaseEngine.h.

Referenced by unit().

◆ itsShape

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: