casa
5.7.0-16
|
Engine for TaQL UDF Doppler conversions. 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. More... | |
Array< Double > | getArrayDouble (const TableExprId &id) |
Get the values. More... | |
Array< MDoppler > | getDopplers (const TableExprId &id) |
Get the dopplers. More... | |
void | handleDoppler (std::vector< TENShPtr > &args, uInt &argnr, Bool allowRadVel, Bool allowFreq) |
Handle the argument(s) giving the input dopplers and reference type. More... | |
void | setConverter (MDoppler::Types toType) |
Set the MeasConvert object. More... | |
Public Member Functions inherited from casacore::MeasEngine< MDoppler > | |
MeasEngine () | |
virtual | ~MeasEngine () |
MDoppler::Types | refType () const |
Get the reference type. More... | |
Bool | handleMeasType (const TENShPtr &operand, Bool doThrow) |
Handle a doppler reference type. More... | |
Record | makeAttributes (typename MDoppler::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 IPosition & | shape () const |
Get the output shape. More... | |
Int | ndim () const |
Get the output dimensionality. More... | |
const Unit & | unit () const |
Get the unit of the function's result. More... | |
const Unit & | inUnit () const |
Get the unit of the expression. More... | |
Bool | isConstant () const |
Tell if the expression is constant. More... | |
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. More... | |
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. 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< 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 |
Engine for TaQL UDF Doppler conversions.
Public interface
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:
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.
It makes it possible to handle measures in TaQL.
Definition at line 98 of file DopplerEngine.h.
Enumerator | |
---|---|
DOPPLER | |
FREQ | |
RADVEL |
Definition at line 101 of file DopplerEngine.h.
|
inline |
Definition at line 103 of file DopplerEngine.h.
|
virtual |
Array<Double> casacore::DopplerEngine::getArrayDouble | ( | const TableExprId & | id | ) |
Get the values.
Array<MDoppler> casacore::DopplerEngine::getDopplers | ( | const TableExprId & | id | ) |
Get the dopplers.
|
private |
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.
|
private |
Handle a possible rest frequency.
False is returned if it appears to be no rest frequency.
|
privatevirtual |
Handle the values.
Implements casacore::MeasEngine< MDoppler >.
void casacore::DopplerEngine::setConverter | ( | MDoppler::Types | toType | ) |
Set the MeasConvert object.
|
private |
Definition at line 144 of file DopplerEngine.h.
|
private |
Definition at line 141 of file DopplerEngine.h.
|
private |
Definition at line 143 of file DopplerEngine.h.
|
private |
Definition at line 142 of file DopplerEngine.h.
|
private |
Definition at line 145 of file DopplerEngine.h.
|
private |
Definition at line 140 of file DopplerEngine.h.