casacore
Loading...
Searching...
No Matches
EarthMagneticUDF.h
Go to the documentation of this file.
1// # EarthMagneticUDF.h: TaQL UDFs for EarthMagnetic conversions
2// # Copyright (C) 2016
3// # Associated Universities, Inc. Washington DC, USA.
4// #
5// # This library is free software; you can redistribute it and/or modify it
6// # under the terms of the GNU Library General Public License as published by
7// # the Free Software Foundation; either version 2 of the License, or (at your
8// # option) any later version.
9// #
10// # This library is distributed in the hope that it will be useful, but WITHOUT
11// # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12// # FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13// # License for more details.
14// #
15// # You should have received a copy of the GNU Library General Public License
16// # along with this library; if not, write to the Free Software Foundation,
17// # Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18// #
19// # Correspondence concerning AIPS++ should be addressed as follows:
20// # Internet email: casa-feedback@nrao.edu.
21// # Postal address: AIPS++ Project Office
22// # National Radio Astronomy Observatory
23// # 520 Edgemont Road
24// # Charlottesville, VA 22903-2475 USA
25
26#ifndef MEAS_EARTHMAGNETICUDF_H
27#define MEAS_EARTHMAGNETICUDF_H
28
29// # Includes
30#include <casacore/casa/aips.h>
31#include <casacore/meas/MeasUDF/EarthMagneticEngine.h>
32#include <casacore/meas/MeasUDF/EpochEngine.h>
33#include <casacore/meas/MeasUDF/PositionEngine.h>
34#include <casacore/meas/MeasUDF/DirectionEngine.h>
35#include <casacore/tables/TaQL/UDFBase.h>
36
37namespace casacore {
38
39// <summary>
40// TaQL UDFs for EarthMagnetic conversions.
41// </summary>
42
43// <use visibility=export>
44
45// <reviewed reviewer="" date="" tests="tMeas.cc">
46// </reviewed>
47
48// <prerequisite>
49// # Classes you should understand before using this one.
50// <li> UDFBase
51// </prerequisite>
52
53// <synopsis>
54// EarthMagneticUDF defines UDFs (user defined functions) that can be used
55// in TaQL to convert Measures for earthMagnetics.
56// Special functions exist to convert to hourangle and azimuth/elevation.
57// In this way such derived values appear to be ordinary TaQL functions.
58//
59// A function is called like:
60// <srcblock>
61// meas.em (toref, em, time, pos)
62// meas.em (toref, em, time, pos)
63// For example,
64// meas.em ('J2000', 'IGRF', TIME, [[5d12m, 52deg, 11m], 'WGS84'])
65// </srcblock>
66// <ul>
67// <li>
68// <src>toref</src> is a single constant string giving the
69// EarthMagnetic reference type. It is not possible to use IGRF for
70// the 'toref' type.
71// <li>
72// <src>em</src> is a value array followed by the reference type.
73// Type IGRF is the IGRF, for which no value array should be given.
74// </ul>
75// All functions have data type double and unit Tesla.
76// </synopsis>
77
78// <motivation>
79// It makes it possible to handle measures in TaQL.
80// </motivation>
81
82class EarthMagneticUDF : public UDFBase {
83 public:
84 // Define the possible function types.
86
87 // Create for the given function type.
89
90 // Function to create an object.
91 static UDFBase* makeEMXYZ(const String&);
92 static UDFBase* makeEMANG(const String&);
93 static UDFBase* makeEMLEN(const String&);
94 static UDFBase* makeIGRFXYZ(const String&);
95 static UDFBase* makeIGRFANG(const String&);
96 static UDFBase* makeIGRFLEN(const String&);
97 static UDFBase* makeIGRFLOS(const String&);
98 static UDFBase* makeIGRFLONG(const String&);
99
100 // Setup the object.
101 virtual void setup(const Table&, const TaQLStyle&);
102
103 // Get the value.
104 virtual Double getDouble(const TableExprId& id);
106
107 private:
108 // # Data members.
116};
117
118} // namespace casacore
119
120#endif
static UDFBase * makeEMXYZ(const String &)
Function to create an object.
EarthMagneticEngine itsEngine
static UDFBase * makeEMANG(const String &)
static UDFBase * makeIGRFLONG(const String &)
static UDFBase * makeIGRFANG(const String &)
FuncType
Define the possible function types.
static UDFBase * makeIGRFLOS(const String &)
EarthMagneticUDF(FuncType)
Create for the given function type.
static UDFBase * makeIGRFXYZ(const String &)
virtual void setup(const Table &, const TaQLStyle &)
Setup the object.
MEarthMagnetic::Types itsRefType
virtual MArray< Double > getArrayDouble(const TableExprId &id)
virtual Double getDouble(const TableExprId &id)
Get the value.
static UDFBase * makeIGRFLEN(const String &)
static UDFBase * makeEMLEN(const String &)
Types
Types of known MEarthMagnetics Tip: The order defines the order in the translation matrix FromTo in ...
String: the storage and methods of handling collections of characters.
Definition String.h:355
UDFBase()
Only default constructor is needed.
For temporary backward namespace compatibility, use casa as alias for casacore.
Definition mainpage.dox:28
int Int
Definition aipstype.h:48
double Double
Definition aipstype.h:53