casacore
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: aips2-request@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//# $Id$
27
28#ifndef MEAS_EARTHMAGNETICUDF_H
29#define MEAS_EARTHMAGNETICUDF_H
30
31//# Includes
32#include <casacore/casa/aips.h>
33#include <casacore/meas/MeasUDF/EarthMagneticEngine.h>
34#include<casacore/meas/MeasUDF/EpochEngine.h>
35#include<casacore/meas/MeasUDF/PositionEngine.h>
36#include<casacore/meas/MeasUDF/DirectionEngine.h>
37#include <casacore/tables/TaQL/UDFBase.h>
38
39namespace casacore {
40
41// <summary>
42// TaQL UDFs for EarthMagnetic conversions.
43// </summary>
44
45// <use visibility=export>
46
47// <reviewed reviewer="" date="" tests="tMeas.cc">
48// </reviewed>
49
50// <prerequisite>
51//# Classes you should understand before using this one.
52// <li> UDFBase
53// </prerequisite>
54
55// <synopsis>
56// EarthMagneticUDF defines UDFs (user defined functions) that can be used
57// in TaQL to convert Measures for earthMagnetics.
58// Special functions exist to convert to hourangle and azimuth/elevation.
59// In this way such derived values appear to be ordinary TaQL functions.
60//
61// A function is called like:
62// <srcblock>
63// meas.em (toref, em, time, pos)
64// meas.em (toref, em, time, pos)
65// For example,
66// meas.em ('J2000', 'IGRF', TIME, [[5d12m, 52deg, 11m], 'WGS84'])
67// </srcblock>
68// <ul>
69// <li>
70// <src>toref</src> is a single constant string giving the
71// EarthMagnetic reference type. It is not possible to use IGRF for
72// the 'toref' type.
73// <li>
74// <src>em</src> is a value array followed by the reference type.
75// Type IGRF is the IGRF, for which no value array should be given.
76// </ul>
77// All functions have data type double and unit Tesla.
78// </synopsis>
79
80// <motivation>
81// It makes it possible to handle measures in TaQL.
82// </motivation>
83
85 {
86 public:
87 // Define the possible function types.
90
91 // Create for the given function type.
93
94 // Function to create an object.
95 static UDFBase* makeEMXYZ (const String&);
96 static UDFBase* makeEMANG (const String&);
97 static UDFBase* makeEMLEN (const String&);
98 static UDFBase* makeIGRFXYZ (const String&);
99 static UDFBase* makeIGRFANG (const String&);
100 static UDFBase* makeIGRFLEN (const String&);
101 static UDFBase* makeIGRFLOS (const String&);
102 static UDFBase* makeIGRFLONG (const String&);
103
104 // Setup the object.
105 virtual void setup (const Table&, const TaQLStyle&);
106
107 // Get the value.
108 virtual Double getDouble (const TableExprId& id);
110
111 private:
112 //# Data members.
120 };
121
122} //end namespace
123
124#endif
static UDFBase * makeEMXYZ(const String &)
Function to create an object.
DirectionEngine itsDirectionEngine
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:225
this file contains all the compiler specific defines
Definition: mainpage.dox:28
int Int
Definition: aipstype.h:50
double Double
Definition: aipstype.h:55