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

Engine for TaQL UDF Position conversions. More...

#include <PositionEngine.h>

Inheritance diagram for casacore::PositionEngine:
casacore::MeasEngine< MPosition > casacore::BaseEngine

Public Member Functions

 PositionEngine ()
 
virtual ~PositionEngine ()
 
Int valueType () const
 Get the value type. More...
 
Array< DoublegetArrayDouble (const TableExprId &id, MPosition::Types toRefType, Int toValueType)
 Get the values. More...
 
Array< MPositiongetPositions (const TableExprId &id)
 Get the positions. More...
 
void handlePosition (Int toValueType, const std::vector< TENShPtr > &args, uInt &argnr)
 Handle the argument(s) giving the input positions and reference type. More...
 
- Public Member Functions inherited from casacore::MeasEngine< MPosition >
 MeasEngine ()
 
virtual ~MeasEngine ()
 
MPosition::Types refType () const
 Get the reference type. More...
 
Bool handleMeasType (const TENShPtr &operand, Bool doThrow)
 Handle a doppler reference type. More...
 
Record makeAttributes (typename MPosition::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 String stripMeasType (const String &type)
 Let a derived class strip part of the reference type. More...
 
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...
 
MPosition makePosition (const Quantity &qh, const Quantity &q1, const Quantity &q2) const
 Make an MPosition from xyz or height,angles. More...
 
void handleScalars (const TENShPtr &e1, const TENShPtr &e2, const TENShPtr &e3, Int nval)
 
void handleObservatory (const TENShPtr &operand)
 
void handlePosArray (const TENShPtr &angles, const TENShPtr &height)
 
virtual void handleValues (TableExprNode &operand, const TableExprId &id, Array< MPosition > &positions)
 Let a derive class handle the values. More...
 

Private Attributes

Int itsValueType
 

Additional Inherited Members

- Protected Member Functions inherited from casacore::MeasEngine< MPosition >
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 Attributes inherited from casacore::MeasEngine< MPosition >
Array< MPositionitsConstants
 
MPosition::Types itsRefType
 
ScalarMeasColumn< MPositionitsMeasScaCol
 
ArrayMeasColumn< MPositionitsMeasArrCol
 
- Protected Attributes inherited from casacore::BaseEngine
Bool itsIsConst
 
IPosition itsShape
 
Int itsNDim
 
Unit itsInUnit
 
Unit itsOutUnit
 
TableExprNode itsExprNode
 

Detailed Description

Engine for TaQL UDF Position conversions.

Intended use:

Public interface

Review Status

Test programs:
tMeas

Prerequisite

Synopsis

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

In TaQL these functions can be called like:

meas.pos (toref, pos)
meas.wgs (pos)
meas.itrfxyz (pos)
For example,
meas.pos ('ITRF', [1e6m,1e6m,1e6m], 'WGS84')

The result of the function is an array with shape [2|3,pos] if lon,lat(,h) or x,y,z is returned and shape [pos] if height is returned. The last element is the shape of the position argument. It is omitted if it has length 1. In such a case getting the height results in a scalar.

Example

// Get the WGS84 lon,lat of WSRT (in degrees).
meas.wgsll ('WSRT') deg
// Get the ITRF x,y,z of WSRT and VLA.
meas.itrfxyz (['WSRT', 'VLA'])

Motivation

It makes it possible to handle measures in TaQL.

Definition at line 126 of file PositionEngine.h.

Constructor & Destructor Documentation

casacore::PositionEngine::PositionEngine ( )
virtual casacore::PositionEngine::~PositionEngine ( )
virtual

Member Function Documentation

virtual void casacore::PositionEngine::deriveAttr ( const Unit unit,
Int  nval 
)
privatevirtual

Let a derived class derive its attributes.

The default implementation does nothing.

Reimplemented from casacore::BaseEngine.

Array<Double> casacore::PositionEngine::getArrayDouble ( const TableExprId id,
MPosition::Types  toRefType,
Int  toValueType 
)

Get the values.

Array<MPosition> casacore::PositionEngine::getPositions ( const TableExprId id)

Get the positions.

void casacore::PositionEngine::handleObservatory ( const TENShPtr operand)
private
void casacore::PositionEngine::handlePosArray ( const TENShPtr angles,
const TENShPtr height 
)
private
void casacore::PositionEngine::handlePosition ( Int  toValueType,
const std::vector< TENShPtr > &  args,
uInt argnr 
)

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

The position can be a column in a table.

void casacore::PositionEngine::handleScalars ( const TENShPtr e1,
const TENShPtr e2,
const TENShPtr e3,
Int  nval 
)
private
virtual void casacore::PositionEngine::handleValues ( TableExprNode operand,
const TableExprId id,
Array< MPosition > &  positions 
)
privatevirtual

Let a derive class handle the values.

Implements casacore::MeasEngine< MPosition >.

MPosition casacore::PositionEngine::makePosition ( const Quantity qh,
const Quantity q1,
const Quantity q2 
) const
private

Make an MPosition from xyz or height,angles.

virtual void casacore::PositionEngine::setValueType ( Int  valueType)
privatevirtual

Let a derived class set its value type.

By default is does nothing.

Reimplemented from casacore::BaseEngine.

virtual String casacore::PositionEngine::stripMeasType ( const String type)
privatevirtual

Let a derived class strip part of the reference type.

The default implementation returns the full type string.

Reimplemented from casacore::BaseEngine.

Int casacore::PositionEngine::valueType ( ) const
inline

Get the value type.

It also gives the nr of output values per position. 0=default, 1=height, 2=angles, 3=xyz

Definition at line 135 of file PositionEngine.h.

References itsValueType.

Member Data Documentation

Int casacore::PositionEngine::itsValueType
private

Definition at line 173 of file PositionEngine.h.

Referenced by valueType().


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