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

More...

`#include <DopplerEngine.h>`

## Public Types

enum | Type { DOPPLER , FREQ , RADVEL }

## Public Member Functions

| DopplerEngine ()
virtual | ~DopplerEngine ()
Bool | handleRestFreq (const TENShPtr &)
| Handle a possible rest frequency.
Array< Double > | getArrayDouble (const TableExprId &id)
| Get the values.
Array< MDoppler > | getDopplers (const TableExprId &id)
| Get the dopplers.
void | handleDoppler (std::vector< TENShPtr > &args, uInt &argnr, Bool allowRadVel, Bool allowFreq)
| Handle the argument(s) giving the input dopplers and reference type.
void | setConverter (MDoppler::Types toType)
| Set the MeasConvert object.
Public Member Functions inherited from casacore::MeasEngine< MDoppler >
| MeasEngine ()
virtual | ~MeasEngine ()
MDoppler::Types | refType () const
| Get the reference type.
Bool | handleMeasType (const TENShPtr &operand, Bool doThrow)
| Handle a doppler reference type.
Record | makeAttributes (typename MDoppler::Types refType, Int valueType=1) const
| Make the expression result attributes.
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.
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.

## Private Member Functions

void | handleRestFreq (vector< TENShPtr > &args, uInt &argnr)
void | handleLine (const TENShPtr &operand)
virtual void | handleValues (TableExprNode &operand, const TableExprId &id, Array< MDoppler > &dopplers)
| Handle the values.
Array< MVFrequency > | getRestFreqs (const TableExprId &id)

## Private Attributes

Type | itsType
MDoppler::Convert | itsConverter
std::shared_ptr< RadialVelocityEngine > | itsRadVelEngine
std::shared_ptr< FrequencyEngine > | itsFreqEngine
Array< MVFrequency > | itsConstRestFreqs
TENShPtr | itsRestFreqNode

## Additional Inherited Members

Protected Member Functions inherited from casacore::MeasEngine< MDoppler >
void | handleMeasArray (const TENShPtr &operand)
| Handle the operand representing an array of Meas values.
void | handleConstant (const TENShPtr &operand)
| Handle a constant Meas value.
Protected Member Functions inherited from casacore::BaseEngine
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 inherited from casacore::MeasEngine< MDoppler >
Array< MDoppler > | itsConstants
MDoppler::Types | itsRefType
ScalarMeasColumn< MDoppler > | itsMeasScaCol
ArrayMeasColumn< MDoppler > | itsMeasArrCol
Protected Attributes inherited from casacore::BaseEngine
Bool | itsIsConst
IPosition | itsShape
Int | itsNDim
Unit | itsInUnit
Unit | itsOutUnit
TableExprNode | itsExprNode

## Detailed Description

Engine for TaQL UDF Doppler conversions

### 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 96 of file DopplerEngine.h.

## Member Enumeration Documentation

## Type

enum casacore::DopplerEngine::Type

Enumerator
DOPPLER |
FREQ |
RADVEL |

Definition at line 99 of file DopplerEngine.h.

## Constructor & Destructor Documentation

## DopplerEngine()

casacore::DopplerEngine::DopplerEngine | ( |  | ) |

inline

Definition at line 101 of file DopplerEngine.h.

## ~DopplerEngine()

virtual casacore::DopplerEngine::~DopplerEngine | ( |  | ) |

virtual

## Member Function Documentation

## getArrayDouble()

Array< Double > casacore::DopplerEngine::getArrayDouble | ( | const TableExprId & | id | ) |

Get the values.

## getDopplers()

Array< MDoppler > casacore::DopplerEngine::getDopplers | ( | const TableExprId & | id | ) |

Get the dopplers.

## getRestFreqs()

Array< MVFrequency > casacore::DopplerEngine::getRestFreqs | ( | const TableExprId & | id | ) |

private

## handleDoppler()

void casacore::DopplerEngine::handleDoppler | ( | std::vector< TENShPtr > & | args,
|  | uInt & | argnr,
|  | Bool | allowRadVel,
|  | Bool | allowFreq )

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

The doppler can be a column in a table. If 'proper' is True, it is tested if a proper doppler is given (with proper type). If not. False is returned. The 'allow' arguments tell if the doppler can be specified by means of a radial velocity or freq/restfreq.

## handleLine()

void casacore::DopplerEngine::handleLine | ( | const TENShPtr & | operand | ) |

private

## handleRestFreq() [1/2]

Bool casacore::DopplerEngine::handleRestFreq | ( | const TENShPtr & |  | ) |

Handle a possible rest frequency.

False is returned if it appears to be no rest frequency.

## handleRestFreq() [2/2]

void casacore::DopplerEngine::handleRestFreq | ( | vector< TENShPtr > & | args,
|  | uInt & | argnr )

private

## handleValues()

virtual void casacore::DopplerEngine::handleValues | ( | TableExprNode & | operand,
|  | const TableExprId & | id,
|  | Array< MDoppler > & | dopplers )

private virtual

Handle the values.

Implements casacore::MeasEngine< MDoppler >.

## setConverter()

void casacore::DopplerEngine::setConverter | ( | MDoppler::Types | toType | ) |

Set the MeasConvert object.

## Member Data Documentation

## itsConstRestFreqs

Array<MVFrequency> casacore::DopplerEngine::itsConstRestFreqs

private

Definition at line 142 of file DopplerEngine.h.

## itsConverter

MDoppler::Convert casacore::DopplerEngine::itsConverter

private

Definition at line 139 of file DopplerEngine.h.

## itsFreqEngine

std::shared_ptr<FrequencyEngine > casacore::DopplerEngine::itsFreqEngine

private

Definition at line 141 of file DopplerEngine.h.

## itsRadVelEngine

std::shared_ptr<RadialVelocityEngine> casacore::DopplerEngine::itsRadVelEngine

private

Definition at line 140 of file DopplerEngine.h.

## itsRestFreqNode

TENShPtr casacore::DopplerEngine::itsRestFreqNode

private

Definition at line 143 of file DopplerEngine.h.

## itsType

Type casacore::DopplerEngine::itsType

private

Definition at line 138 of file DopplerEngine.h.

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

- meas/MeasUDF/DopplerEngine.h