casacore
Public Member Functions | Private Member Functions | Private Attributes | List of all members
casacore::FrequencyEngine Class Reference

More...

#include <FrequencyEngine.h>

Public Member Functions

 FrequencyEngine ()
 
virtual ~FrequencyEngine ()
 
Array< DoublegetArrayDouble (const TableExprId &id, int type)
 Get the values. More...
 
Array< MFrequencygetFrequencies (const TableExprId &id)
 Get the frequencies. More...
 
void handleFrequency (std::vector< TENShPtr > &args, uInt &argnr)
 Handle the argument(s) giving the input frequencies and reference type. More...
 
void setConverter (MFrequency::Types toType)
 Set the MeasConvert object. More...
 
void setDopplerEngine (DopplerEngine &engine)
 Set the possible doppler engine. More...
 
void setRadVelEngine (RadialVelocityEngine &engine)
 Set the possible radial velocity engine. More...
 
void setDirectionEngine (DirectionEngine &engine)
 Set the possible direction engine. More...
 
void setEpochEngine (EpochEngine &engine)
 Set the possible epoch engine. More...
 
void setPositionEngine (PositionEngine &engine)
 Set the possible position engine. More...
 
- Public Member Functions inherited from casacore::MeasEngine< MFrequency >
 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...
 

Private Member Functions

virtual void handleValues (TableExprNode &operand, const TableExprId &id, Array< MFrequency > &frequencies)
 Let a derive class handle the values. More...
 

Private Attributes

MeasFrame itsFrame
 
MeasFrame itsRVFrame
 
MFrequency::Convert itsConverter
 
EpochEngineitsEpochEngine
 
PositionEngineitsPositionEngine
 
DirectionEngineitsDirectionEngine
 
DopplerEngineitsDopplerEngine
 
RadialVelocityEngineitsRadVelEngine
 

Additional Inherited Members

- Protected Member Functions inherited from casacore::MeasEngine< MFrequency >
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...
 
- 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 inherited from casacore::MeasEngine< MFrequency >
Array< MFrequencyitsConstants
 
M::Types itsRefType
 
ScalarMeasColumn< MFrequencyitsMeasScaCol
 
ArrayMeasColumn< MFrequencyitsMeasArrCol
 
- Protected Attributes inherited from casacore::BaseEngine
Bool itsIsConst
 
IPosition itsShape
 
Int itsNDim
 
Unit itsInUnit
 
Unit itsOutUnit
 
TableExprNode itsExprNode
 

Detailed Description

Engine for TaQL UDF Frequency conversions

Intended use:

Public interface

Review Status

Test programs:
tMeas

Prerequisite

Synopsis

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

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

meas.freq ('TOPO', 1GHz, 'LSRK', 'CasA', date(),
[1e6m,1e6m,1e6m], 'WGS84')
TableExprNode date(const TableExprNode &node)
Definition: ExprNode.h:1511

which converts the frequency from LSRK to TOPO.

All such functions return data with type double and unit Hz.

Frequencies can be given like: [f1,f2,...], fromRef where fromRef is the reference type.

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

Motivation

It makes it possible to handle measures in TaQL.

Definition at line 99 of file FrequencyEngine.h.

Constructor & Destructor Documentation

◆ FrequencyEngine()

casacore::FrequencyEngine::FrequencyEngine ( )

◆ ~FrequencyEngine()

virtual casacore::FrequencyEngine::~FrequencyEngine ( )
virtual

Member Function Documentation

◆ getArrayDouble()

Array<Double> casacore::FrequencyEngine::getArrayDouble ( const TableExprId id,
int  type 
)

Get the values.

◆ getFrequencies()

Array<MFrequency> casacore::FrequencyEngine::getFrequencies ( const TableExprId id)

Get the frequencies.

◆ handleFrequency()

void casacore::FrequencyEngine::handleFrequency ( std::vector< TENShPtr > &  args,
uInt argnr 
)

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

The frequency can be a column in a table.

◆ handleValues()

virtual void casacore::FrequencyEngine::handleValues ( TableExprNode operand,
const TableExprId id,
Array< MFrequency > &  positions 
)
privatevirtual

Let a derive class handle the values.

Implements casacore::MeasEngine< MFrequency >.

◆ setConverter()

void casacore::FrequencyEngine::setConverter ( MFrequency::Types  toType)

Set the MeasConvert object.

◆ setDirectionEngine()

void casacore::FrequencyEngine::setDirectionEngine ( DirectionEngine engine)

Set the possible direction engine.

It can be done only once.

◆ setDopplerEngine()

void casacore::FrequencyEngine::setDopplerEngine ( DopplerEngine engine)

Set the possible doppler engine.

It can be done only once.

◆ setEpochEngine()

void casacore::FrequencyEngine::setEpochEngine ( EpochEngine engine)

Set the possible epoch engine.

It can be done only once.

◆ setPositionEngine()

void casacore::FrequencyEngine::setPositionEngine ( PositionEngine engine)

Set the possible position engine.

It can be done only once.

◆ setRadVelEngine()

void casacore::FrequencyEngine::setRadVelEngine ( RadialVelocityEngine engine)

Set the possible radial velocity engine.

It can be done only once.

Member Data Documentation

◆ itsConverter

MFrequency::Convert casacore::FrequencyEngine::itsConverter
private

Definition at line 148 of file FrequencyEngine.h.

◆ itsDirectionEngine

DirectionEngine* casacore::FrequencyEngine::itsDirectionEngine
private

Definition at line 151 of file FrequencyEngine.h.

◆ itsDopplerEngine

DopplerEngine* casacore::FrequencyEngine::itsDopplerEngine
private

Definition at line 152 of file FrequencyEngine.h.

◆ itsEpochEngine

EpochEngine* casacore::FrequencyEngine::itsEpochEngine
private

Definition at line 149 of file FrequencyEngine.h.

◆ itsFrame

MeasFrame casacore::FrequencyEngine::itsFrame
private

Definition at line 146 of file FrequencyEngine.h.

◆ itsPositionEngine

PositionEngine* casacore::FrequencyEngine::itsPositionEngine
private

Definition at line 150 of file FrequencyEngine.h.

◆ itsRadVelEngine

RadialVelocityEngine* casacore::FrequencyEngine::itsRadVelEngine
private

Definition at line 153 of file FrequencyEngine.h.

◆ itsRVFrame

MeasFrame casacore::FrequencyEngine::itsRVFrame
private

Definition at line 147 of file FrequencyEngine.h.


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