casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
casacore::DopplerEngine Class Reference

Engine for TaQL UDF Doppler conversions. More...

#include <DopplerEngine.h>

Inheritance diagram for casacore::DopplerEngine:
casacore::MeasEngine< MDoppler > casacore::BaseEngine

Public Types

enum  Type {
  DOPPLER,
  FREQ,
  RADVEL
}
 

Public Member Functions

 DopplerEngine ()
 
virtual ~DopplerEngine ()
 
Bool handleRestFreq (const TENShPtr &)
 Handle a possible rest frequency. More...
 
Array< DoublegetArrayDouble (const TableExprId &id)
 Get the values. More...
 
Array< MDopplergetDopplers (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 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

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< MVFrequencygetRestFreqs (const TableExprId &id)
 

Private Attributes

Type itsType
 
MDoppler::Convert itsConverter
 
std::shared_ptr
< RadialVelocityEngine
itsRadVelEngine
 
std::shared_ptr< FrequencyEngineitsFreqEngine
 
Array< MVFrequencyitsConstRestFreqs
 
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< MDoppleritsConstants
 
MDoppler::Types itsRefType
 
ScalarMeasColumn< MDoppleritsMeasScaCol
 
ArrayMeasColumn< MDoppleritsMeasArrCol
 
- 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

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')

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

Member Enumeration Documentation

Enumerator
DOPPLER 
FREQ 
RADVEL 

Definition at line 101 of file DopplerEngine.h.

Constructor & Destructor Documentation

casacore::DopplerEngine::DopplerEngine ( )
inline

Definition at line 103 of file DopplerEngine.h.

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

Member Function Documentation

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

Get the values.

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

Get the dopplers.

Array<MVFrequency> casacore::DopplerEngine::getRestFreqs ( const TableExprId id)
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.

void casacore::DopplerEngine::handleLine ( const TENShPtr operand)
private
Bool casacore::DopplerEngine::handleRestFreq ( const TENShPtr )

Handle a possible rest frequency.

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

void casacore::DopplerEngine::handleRestFreq ( vector< TENShPtr > &  args,
uInt argnr 
)
private
virtual void casacore::DopplerEngine::handleValues ( TableExprNode operand,
const TableExprId id,
Array< MDoppler > &  dopplers 
)
privatevirtual

Handle the values.

Implements casacore::MeasEngine< MDoppler >.

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

Set the MeasConvert object.

Member Data Documentation

Array<MVFrequency> casacore::DopplerEngine::itsConstRestFreqs
private

Definition at line 144 of file DopplerEngine.h.

MDoppler::Convert casacore::DopplerEngine::itsConverter
private

Definition at line 141 of file DopplerEngine.h.

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

Definition at line 143 of file DopplerEngine.h.

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

Definition at line 142 of file DopplerEngine.h.

TENShPtr casacore::DopplerEngine::itsRestFreqNode
private

Definition at line 145 of file DopplerEngine.h.

Type casacore::DopplerEngine::itsType
private

Definition at line 140 of file DopplerEngine.h.


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