casacore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
casacore::PositionUDF Class Reference

TaQL UDFs for Position conversions. More...

#include <PositionUDF.h>

Inheritance diagram for casacore::PositionUDF:
casacore::UDFBase

Public Types

enum  FuncType {
  POS,
  ITRFXYZ,
  ITRFLLH,
  ITRFLL,
  ITRFH,
  WGSXYZ,
  WGSLLH,
  WGSLL,
  WGSH
}
 Define the possible function types. More...
 
- Public Types inherited from casacore::UDFBase
typedef UDFBaseMakeUDFObject (const String &functionName)
 The signature of a global or static member function creating an object of the UDF. More...
 

Public Member Functions

 PositionUDF (FuncType)
 
virtual void setup (const Table &, const TaQLStyle &)
 Setup the object. More...
 
virtual Double getDouble (const TableExprId &id)
 Get the value. More...
 
virtual MArray< DoublegetArrayDouble (const TableExprId &id)
 
- Public Member Functions inherited from casacore::UDFBase
 UDFBase ()
 Only default constructor is needed. More...
 
virtual ~UDFBase ()
 Destructor. More...
 
virtual Bool getBool (const TableExprId &id)
 Evaluate the function and return the result. More...
 
virtual Int64 getInt (const TableExprId &id)
 
virtual DComplex getDComplex (const TableExprId &id)
 
virtual String getString (const TableExprId &id)
 
virtual TaqlRegex getRegex (const TableExprId &id)
 
virtual MVTime getDate (const TableExprId &id)
 
virtual MArray< BoolgetArrayBool (const TableExprId &id)
 
virtual MArray< Int64getArrayInt (const TableExprId &id)
 
virtual MArray< DComplex > getArrayDComplex (const TableExprId &id)
 
virtual MArray< StringgetArrayString (const TableExprId &id)
 
virtual MArray< MVTimegetArrayDate (const TableExprId &id)
 
const StringgetUnit () const
 Get the unit. More...
 
const RecordgetAttributes () const
 Get the attributes. More...
 
void getAggrNodes (vector< TableExprNodeRep * > &aggr)
 Get the nodes in the function operands representing an aggregate function. More...
 
void getColumnNodes (vector< TableExprNodeRep * > &cols)
 Get the nodes in the function operands representing a table column. More...
 
void init (const std::vector< TENShPtr > &arg, const Table &table, const TaQLStyle &)
 Initialize the function object. More...
 
TableExprNodeRep::NodeDataType dataType () const
 Get the data type. More...
 
Int ndim () const
 Get the dimensionality of the results. More...
 
const IPositionshape () const
 Get the result shape if the same for all results. More...
 
Bool isConstant () const
 Tell if the UDF gives a constant result. More...
 
Bool isAggregate () const
 Tell if the UDF is an aggregate function. More...
 
void disableApplySelection ()
 Do not apply the selection. More...
 
void applySelection (const Vector< rownr_t > &rownrs)
 If needed, let the UDF re-create column objects for a selection of rows. More...
 

Static Public Member Functions

static UDFBasemakePOS (const String &)
 Function to create an object. More...
 
static UDFBasemakeITRFXYZ (const String &)
 
static UDFBasemakeITRFLLH (const String &)
 
static UDFBasemakeITRFLL (const String &)
 
static UDFBasemakeITRFH (const String &)
 
static UDFBasemakeWGSXYZ (const String &)
 
static UDFBasemakeWGSLLH (const String &)
 
static UDFBasemakeWGSLL (const String &)
 
static UDFBasemakeWGSH (const String &)
 
- Static Public Member Functions inherited from casacore::UDFBase
static void registerUDF (const String &name, MakeUDFObject *func)
 Register the name and construction function of a UDF (thread-safe). More...
 
static UDFBasecreateUDF (const String &name, const TaQLStyle &style)
 Create a UDF object (thread-safe). More...
 

Private Attributes

PositionEngine itsEngine
 
FuncType itsType
 
MPosition::Types itsRefType
 
Int itsValueType
 

Additional Inherited Members

- Protected Member Functions inherited from casacore::UDFBase
std::vector< TENShPtr > & operands ()
 Get the operands. More...
 
void setDataType (TableExprNodeRep::NodeDataType)
 Set the data type. More...
 
void setNDim (Int ndim)
 Set the dimensionality of the results. More...
 
void setShape (const IPosition &shape)
 Set the shape of the results if it is fixed and known. More...
 
void setUnit (const String &unit)
 Set the unit of the result. More...
 
void setAttributes (const Record &attributes)
 Set the attributes of the result. More...
 
void setConstant (Bool isConstant)
 Define if the result is constant (e.g. More...
 
void setAggregate (Bool isAggregate)
 Define if the UDF is an aggregate function (usually used in GROUPBY). More...
 
virtual void recreateColumnObjects (const Vector< rownr_t > &rownrs)
 Let a derived class recreate its column objects in case a selection has to be applied. More...
 

Detailed Description

TaQL UDFs for Position conversions.

Intended use:

Public interface

Review Status

Test programs:
tMeas

Prerequisite

Synopsis

PositionUDF defines UDFs (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.

A function is called like:

meas.pos (toref, pos)
For example,
meas.dir ('ITRF', [1rad,1rad], 'WGS84')

All functions have data type double and unit radian.

Motivation

It makes it possible to handle measures in TaQL.

Definition at line 81 of file PositionUDF.h.

Member Enumeration Documentation

Define the possible function types.

Enumerator
POS 
ITRFXYZ 
ITRFLLH 
ITRFLL 
ITRFH 
WGSXYZ 
WGSLLH 
WGSLL 
WGSH 

Definition at line 85 of file PositionUDF.h.

Constructor & Destructor Documentation

casacore::PositionUDF::PositionUDF ( FuncType  )
explicit

Member Function Documentation

virtual MArray<Double> casacore::PositionUDF::getArrayDouble ( const TableExprId id)
virtual

Reimplemented from casacore::UDFBase.

virtual Double casacore::PositionUDF::getDouble ( const TableExprId id)
virtual

Get the value.

Reimplemented from casacore::UDFBase.

static UDFBase* casacore::PositionUDF::makeITRFH ( const String )
static
static UDFBase* casacore::PositionUDF::makeITRFLL ( const String )
static
static UDFBase* casacore::PositionUDF::makeITRFLLH ( const String )
static
static UDFBase* casacore::PositionUDF::makeITRFXYZ ( const String )
static
static UDFBase* casacore::PositionUDF::makePOS ( const String )
static

Function to create an object.

static UDFBase* casacore::PositionUDF::makeWGSH ( const String )
static
static UDFBase* casacore::PositionUDF::makeWGSLL ( const String )
static
static UDFBase* casacore::PositionUDF::makeWGSLLH ( const String )
static
static UDFBase* casacore::PositionUDF::makeWGSXYZ ( const String )
static
virtual void casacore::PositionUDF::setup ( const Table ,
const TaQLStyle  
)
virtual

Setup the object.

Implements casacore::UDFBase.

Member Data Documentation

PositionEngine casacore::PositionUDF::itsEngine
private

Definition at line 110 of file PositionUDF.h.

MPosition::Types casacore::PositionUDF::itsRefType
private

Definition at line 112 of file PositionUDF.h.

FuncType casacore::PositionUDF::itsType
private

Definition at line 111 of file PositionUDF.h.

Int casacore::PositionUDF::itsValueType
private

Definition at line 113 of file PositionUDF.h.


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