casacore
|
#include <EarthMagneticEngine.h>
Public Member Functions | |
EarthMagneticEngine () | |
virtual | ~EarthMagneticEngine () |
Int | valueType () const |
Get the value type. More... | |
Array< Double > | getArrayDouble (const TableExprId &id) |
Get the values. More... | |
void | handleEarthMagnetic (std::vector< TENShPtr > &args, uInt &argnr) |
Handle the argument(s) giving the input earthMagnetics or direction and reference type. More... | |
void | handleHeight (TENShPtr &operand) |
Handle the heights argument. More... | |
void | setEpochEngine (EpochEngine &engine) |
Set the MeasConvert object. More... | |
void | setPositionEngine (PositionEngine &engine) |
Set the possible position engine. More... | |
void | setDirectionEngine (DirectionEngine &engine) |
Set the possible direction engine. More... | |
void | set (MEarthMagnetic::Types toRefType, Int toValueType, Bool asLOS, Bool asLong, Bool useModel) |
Set the types of the result. More... | |
Public Member Functions inherited from casacore::MeasEngine< MEarthMagnetic > | |
MeasEngine () | |
virtual | ~MeasEngine () |
M::Types | refType () const |
Get the reference type. More... | |
Bool | handleMeasType (const TENShPtr &operand, Bool doThrow) |
Handle a doppler reference type. More... | |
Record | makeAttributes (typename M::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 | |
virtual String | stripMeasType (const String &type) |
Strip a possible suffix from 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... | |
MEarthMagnetic | makeEarthMagnetic (const Quantity &qh, const Quantity &q1, const Quantity &q2) const |
Make an MEarthMagnetic from xyz or length,angles. More... | |
void | handleScalars (const TENShPtr &e1, const TENShPtr &e2, const TENShPtr &e3) |
virtual void | handleValues (TableExprNode &operand, const TableExprId &id, Array< MEarthMagnetic > &earthMagnetics) |
Let a derive class handle the values. More... | |
Array< MEarthMagnetic > | getEarthMagnetics (const TableExprId &id) |
Array< Double > | getHeights (const TableExprId &id) |
void | copyEM (const MVEarthMagnetic &em, double *&outPtr) |
void | copyLLEM (EarthMagneticMachine &emm, double *&outPtr) |
Additional Inherited Members | |
Protected Member Functions inherited from casacore::MeasEngine< MEarthMagnetic > | |
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< MEarthMagnetic > | |
Array< MEarthMagnetic > | itsConstants |
M::Types | itsRefType |
ScalarMeasColumn< MEarthMagnetic > | itsMeasScaCol |
ArrayMeasColumn< MEarthMagnetic > | itsMeasArrCol |
Protected Attributes inherited from casacore::BaseEngine | |
Bool | itsIsConst |
IPosition | itsShape |
Int | itsNDim |
Unit | itsInUnit |
Unit | itsOutUnit |
TableExprNode | itsExprNode |
Engine for TaQL UDF EarthMagnetic conversions
Public interface
EarthMagneticEngine defines Engines (user defined functions) that can be used in TaQL to convert EarthMagnetic values from one frame to another or to calculate them from the IGRF model. In this way such derived values appear to be ordinary TaQL functions.
In TaQL these functions can be called like:
The first one converts the given EarthMagnetic values to the 'toref' frame for all epoch and positions (their Cartesian product). The second one calculates the IGRF model values in the 'toref' frame for all heights, directions, epochs and positions. The 3rd and 4th return the model value along the line-of-sight cq. as longitude for all heights, directions, epochs and positions. The first two function names can be followed by XYZ, ANGLES or LENGTH to return the values according to the suffix.
toref
is a single constant string. If not given, it defaults to ITRF. Note that 'toref' can also be given for function IGRFLOS and IGRFLONG, but is neglected. emvalues
gives the EarthMagnetic values to be converted. They can be given in various forms. EMVAL[0,]
. Often this is a TableMeasures column which is recognized as such, also its source reference frame. If such a column is used in a expression, it will not be recognized as a TableMeasures column and its reference frame should be given. heights
is one or more real values giving the heights above the earth at which the model has to be calculated. Default unit is m. directions
defines the directions in which the model has to be calculated. They can be given in all forms as described in class DirectionEngine. epochs
can be given as shown in class EpochEngine. positions
can be given as shown in class PositionEngine. All functions return data with type double and unit nT. Unit rad is returned for functions with the ANGLES suffix.
The result of a conversion is an array with shape [1|2|3,em,epoch,pos]. The model calculations result has shape [1|2|3,h,dir,epoch,pos] The last 3 or 4 elements are the shapes of these arguments. They are omitted if all of them have length 1.
It makes it possible to handle measures in TaQL.
Definition at line 143 of file EarthMagneticEngine.h.
casacore::EarthMagneticEngine::EarthMagneticEngine | ( | ) |
|
virtual |
|
private |
|
private |
|
privatevirtual |
Let a derived class derive its attributes.
The default implementation does nothing.
Reimplemented from casacore::BaseEngine.
Array<Double> casacore::EarthMagneticEngine::getArrayDouble | ( | const TableExprId & | id | ) |
Get the values.
|
private |
|
private |
void casacore::EarthMagneticEngine::handleEarthMagnetic | ( | std::vector< TENShPtr > & | args, |
uInt & | argnr | ||
) |
Handle the argument(s) giving the input earthMagnetics or direction and reference type.
The earthMagnetic can be a column in a table. Note that direction (or height) can only be given for reftype IGRF.
void casacore::EarthMagneticEngine::handleHeight | ( | TENShPtr & | operand | ) |
Handle the heights argument.
|
private |
|
privatevirtual |
Let a derive class handle the values.
Implements casacore::MeasEngine< MEarthMagnetic >.
|
private |
Make an MEarthMagnetic from xyz or length,angles.
void casacore::EarthMagneticEngine::set | ( | MEarthMagnetic::Types | toRefType, |
Int | toValueType, | ||
Bool | asLOS, | ||
Bool | asLong, | ||
Bool | useModel | ||
) |
Set the types of the result.
void casacore::EarthMagneticEngine::setDirectionEngine | ( | DirectionEngine & | engine | ) |
Set the possible direction engine.
It can be done only once.
void casacore::EarthMagneticEngine::setEpochEngine | ( | EpochEngine & | engine | ) |
Set the MeasConvert object.
Set the possible epoch engine. It can be done only once.
void casacore::EarthMagneticEngine::setPositionEngine | ( | PositionEngine & | engine | ) |
Set the possible position engine.
It can be done only once.
|
privatevirtual |
Let a derived class set its value type.
By default is does nothing.
Reimplemented from casacore::BaseEngine.
Strip a possible suffix from the reference type.
Reimplemented from casacore::BaseEngine.
|
inline |
Get the value type.
It also gives the nr of output values per position. 0=default, 1=length (in tesla), 2=angles (in radians)
Definition at line 152 of file EarthMagneticEngine.h.
References itsValueType.
|
private |
Definition at line 211 of file EarthMagneticEngine.h.
|
private |
Definition at line 210 of file EarthMagneticEngine.h.
|
private |
Definition at line 206 of file EarthMagneticEngine.h.
|
private |
Definition at line 213 of file EarthMagneticEngine.h.
|
private |
Definition at line 216 of file EarthMagneticEngine.h.
|
private |
Definition at line 214 of file EarthMagneticEngine.h.
|
private |
Definition at line 204 of file EarthMagneticEngine.h.
|
private |
Definition at line 205 of file EarthMagneticEngine.h.
|
private |
Definition at line 215 of file EarthMagneticEngine.h.
|
private |
Definition at line 209 of file EarthMagneticEngine.h.
|
private |
Definition at line 212 of file EarthMagneticEngine.h.
|
private |
Definition at line 207 of file EarthMagneticEngine.h.
Referenced by valueType().