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

More...

`#include <EarthMagneticUDF.h>`

## Public Types

enum | FuncType { EMXYZ , EMANG , EMLEN , IGRFXYZ , IGRFANG , IGRFLEN , IGRFLOS , IGRFLONG }
| Define the possible function types. More...
Public Types inherited from casacore::UDFBase
typedef UDFBase * | MakeUDFObject(const String &functionName)
| The signature of a global or static member function creating an object of the UDF.

## Public Member Functions

| EarthMagneticUDF (FuncType)
| Create for the given function type.
virtual void | setup (const Table &, const TaQLStyle &)
| Setup the object.
virtual Double | getDouble (const TableExprId &id)
| Get the value.
virtual MArray< Double > | getArrayDouble (const TableExprId &id)
Public Member Functions inherited from casacore::UDFBase
| UDFBase ()
| Only default constructor is needed.
virtual | ~UDFBase ()
| Destructor.
virtual Bool | getBool (const TableExprId &id)
| Evaluate the function and return the result.
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< Bool > | getArrayBool (const TableExprId &id)
virtual MArray< Int64 > | getArrayInt (const TableExprId &id)
virtual MArray< DComplex > | getArrayDComplex (const TableExprId &id)
virtual MArray< String > | getArrayString (const TableExprId &id)
virtual MArray< MVTime > | getArrayDate (const TableExprId &id)
const String & | getUnit () const
| Get the unit.
const Record & | getAttributes () const
| Get the attributes.
virtual void | flattenTree (std::vector< TableExprNodeRep * > &)
| Flatten the node tree by adding the node and its children to the vector.
void | init (const std::vector< TENShPtr > &arg, const TableExprInfo &tableInfo, const TaQLStyle &)
| Initialize the function object.
TableExprNodeRep::NodeDataType | dataType () const
| Get the data type.
Int | ndim () const
| Get the dimensionality of the results.
const IPosition & | shape () const
| Get the result shape if the same for all results.
Bool | isConstant () const
| Tell if the UDF gives a constant result.
Bool | isAggregate () const
| Tell if the UDF is an aggregate function.
void | disableApplySelection ()
| Do not apply the selection.
void | applySelection (const Vector< rownr_t > &rownrs)
| If needed, let the UDF re-create column objects for a selection of rows.

## Static Public Member Functions

static UDFBase * | makeEMXYZ (const String &)
| Function to create an object.
static UDFBase * | makeEMANG (const String &)
static UDFBase * | makeEMLEN (const String &)
static UDFBase * | makeIGRFXYZ (const String &)
static UDFBase * | makeIGRFANG (const String &)
static UDFBase * | makeIGRFLEN (const String &)
static UDFBase * | makeIGRFLOS (const String &)
static UDFBase * | makeIGRFLONG (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).
static UDFBase * | createUDF (const String &name, const TaQLStyle &style)
| Create a UDF object (thread-safe).

## Private Attributes

EarthMagneticEngine | itsEngine
DirectionEngine | itsDirectionEngine
EpochEngine | itsEpochEngine
PositionEngine | itsPositionEngine
FuncType | itsType
Int | itsValueType
MEarthMagnetic::Types | itsRefType

## Additional Inherited Members

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

## Detailed Description

TaQL UDFs for EarthMagnetic conversions.

### Intended use:

Public interface

### Review Status

Test programs:
  tMeas

### Prerequisite

- UDFBase

### Synopsis

EarthMagneticUDF defines UDFs (user defined functions) that can be used in TaQL to convert Measures for earthMagnetics. Special functions exist to convert to hourangle and azimuth/elevation. In this way such derived values appear to be ordinary TaQL functions.

A function is called like:

meas.em (toref, em, time, pos)
meas.em (toref, em, time, pos)
For example,
meas.em ('J2000', 'IGRF', TIME, [[5d12m, 52deg, 11m], 'WGS84'])
casacore::time
TableExprNode time(const TableExprNode &node)
Definition ExprNode.h:1584

- toref is a single constant string giving the EarthMagnetic reference type. It is not possible to use IGRF for the 'toref' type.
- em is a value array followed by the reference type. Type IGRF is the IGRF, for which no value array should be given.

All functions have data type double and unit Tesla.

### Motivation

It makes it possible to handle measures in TaQL.

Definition at line 82 of file EarthMagneticUDF.h.

## Member Enumeration Documentation

## FuncType

enum casacore::EarthMagneticUDF::FuncType

Define the possible function types.

Enumerator
EMXYZ |
EMANG |
EMLEN |
IGRFXYZ |
IGRFANG |
IGRFLEN |
IGRFLOS |
IGRFLONG |

Definition at line 86 of file EarthMagneticUDF.h.

## Constructor & Destructor Documentation

## EarthMagneticUDF()

casacore::EarthMagneticUDF::EarthMagneticUDF | ( | FuncType |  | ) |

explicit

Create for the given function type.

## Member Function Documentation

## getArrayDouble()

virtual MArray< Double > casacore::EarthMagneticUDF::getArrayDouble | ( | const TableExprId & | id | ) |

virtual

Reimplemented from casacore::UDFBase.

## getDouble()

virtual Double casacore::EarthMagneticUDF::getDouble | ( | const TableExprId & | id | ) |

virtual

Get the value.

Reimplemented from casacore::UDFBase.

## makeEMANG()

UDFBase * casacore::EarthMagneticUDF::makeEMANG | ( | const String & |  | ) |

static

References casacore::UDFBase::UDFBase().

## makeEMLEN()

UDFBase * casacore::EarthMagneticUDF::makeEMLEN | ( | const String & |  | ) |

static

References casacore::UDFBase::UDFBase().

## makeEMXYZ()

UDFBase * casacore::EarthMagneticUDF::makeEMXYZ | ( | const String & |  | ) |

static

Function to create an object.

References casacore::UDFBase::UDFBase().

## makeIGRFANG()

UDFBase * casacore::EarthMagneticUDF::makeIGRFANG | ( | const String & |  | ) |

static

References casacore::UDFBase::UDFBase().

## makeIGRFLEN()

UDFBase * casacore::EarthMagneticUDF::makeIGRFLEN | ( | const String & |  | ) |

static

References casacore::UDFBase::UDFBase().

## makeIGRFLONG()

UDFBase * casacore::EarthMagneticUDF::makeIGRFLONG | ( | const String & |  | ) |

static

References casacore::UDFBase::UDFBase().

## makeIGRFLOS()

UDFBase * casacore::EarthMagneticUDF::makeIGRFLOS | ( | const String & |  | ) |

static

References casacore::UDFBase::UDFBase().

## makeIGRFXYZ()

UDFBase * casacore::EarthMagneticUDF::makeIGRFXYZ | ( | const String & |  | ) |

static

References casacore::UDFBase::UDFBase().

## setup()

virtual void casacore::EarthMagneticUDF::setup | ( | const Table & | ,
|  | const TaQLStyle & | )

virtual

Setup the object.

Implements casacore::UDFBase.

## Member Data Documentation

## itsDirectionEngine

DirectionEngine casacore::EarthMagneticUDF::itsDirectionEngine

private

Definition at line 112 of file EarthMagneticUDF.h.

## itsEngine

EarthMagneticEngine casacore::EarthMagneticUDF::itsEngine

private

Definition at line 111 of file EarthMagneticUDF.h.

## itsEpochEngine

EpochEngine casacore::EarthMagneticUDF::itsEpochEngine

private

Definition at line 113 of file EarthMagneticUDF.h.

## itsPositionEngine

PositionEngine casacore::EarthMagneticUDF::itsPositionEngine

private

Definition at line 114 of file EarthMagneticUDF.h.

## itsRefType

MEarthMagnetic::Types casacore::EarthMagneticUDF::itsRefType

private

Definition at line 117 of file EarthMagneticUDF.h.

## itsType

FuncType casacore::EarthMagneticUDF::itsType

private

Definition at line 115 of file EarthMagneticUDF.h.

## itsValueType

Int casacore::EarthMagneticUDF::itsValueType

private

Definition at line 116 of file EarthMagneticUDF.h.

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

- meas/MeasUDF/EarthMagneticUDF.h