casacore
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
casacore::MeasEngine< M > Class Template Referenceabstract

More...

#include <MeasEngine.h>

Public Member Functions

 MeasEngine ()
 
virtual ~MeasEngine ()
 
M::Types refType () const
 Get the reference type. More...
 
Bool handleMeasType (const TENShPtr &operand, Bool doThrow)
 Handle a doppler reference type. More...
 
Record makeAttributes (typename M::Types refType, Int valueType=1) const
 Make the expression result attributes. More...
 
- 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. 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

void handleMeasArray (const TENShPtr &operand)
 Handle the operand representing an array of Meas values. More...
 
void handleConstant (const TENShPtr &operand)
 Handle a constant Meas value. More...
 
virtual void handleValues (TableExprNode &operand, const TableExprId &id, Array< M > &positions)=0
 Let a derive class handle the values. More...
 
- Protected Member Functions inherited from casacore::BaseEngine
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

Array< M > itsConstants
 
M::Types itsRefType
 
ScalarMeasColumn< M > itsMeasScaCol
 
ArrayMeasColumn< M > itsMeasArrCol
 
- Protected Attributes inherited from casacore::BaseEngine
Bool itsIsConst
 
IPosition itsShape
 
Int itsNDim
 
Unit itsInUnit
 
Unit itsOutUnit
 
TableExprNode itsExprNode
 

Detailed Description

template<typename M>
class casacore::MeasEngine< M >

Templated 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 92 of file MeasEngine.h.

Constructor & Destructor Documentation

◆ MeasEngine()

template<typename M >
casacore::MeasEngine< M >::MeasEngine ( )
inline

Definition at line 95 of file MeasEngine.h.

◆ ~MeasEngine()

template<typename M >
virtual casacore::MeasEngine< M >::~MeasEngine ( )
virtual

Member Function Documentation

◆ handleConstant()

template<typename M >
void casacore::MeasEngine< M >::handleConstant ( const TENShPtr operand)
protected

Handle a constant Meas value.

◆ handleMeasArray()

template<typename M >
void casacore::MeasEngine< M >::handleMeasArray ( const TENShPtr operand)
protected

Handle the operand representing an array of Meas values.

◆ handleMeasType()

template<typename M >
Bool casacore::MeasEngine< M >::handleMeasType ( const TENShPtr operand,
Bool  doThrow 
)

Handle a doppler reference type.

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

◆ handleValues()

template<typename M >
virtual void casacore::MeasEngine< M >::handleValues ( TableExprNode operand,
const TableExprId id,
Array< M > &  positions 
)
protectedpure virtual

◆ makeAttributes()

template<typename M >
Record casacore::MeasEngine< M >::makeAttributes ( typename M::Types  refType,
Int  valueType = 1 
) const

Make the expression result attributes.

◆ refType()

template<typename M >
M::Types casacore::MeasEngine< M >::refType ( ) const
inline

Get the reference type.

Definition at line 102 of file MeasEngine.h.

References casacore::MeasEngine< M >::itsRefType.

Member Data Documentation

◆ itsConstants

template<typename M >
Array<M> casacore::MeasEngine< M >::itsConstants
protected

Definition at line 128 of file MeasEngine.h.

◆ itsMeasArrCol

template<typename M >
ArrayMeasColumn<M> casacore::MeasEngine< M >::itsMeasArrCol
protected

Definition at line 131 of file MeasEngine.h.

◆ itsMeasScaCol

template<typename M >
ScalarMeasColumn<M> casacore::MeasEngine< M >::itsMeasScaCol
protected

Definition at line 130 of file MeasEngine.h.

◆ itsRefType

template<typename M >
M::Types casacore::MeasEngine< M >::itsRefType
protected

Definition at line 129 of file MeasEngine.h.

Referenced by casacore::MeasEngine< M >::refType().


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