casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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>
38 
39 namespace 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 
84  class EarthMagneticUDF: public UDFBase
85  {
86  public:
87  // Define the possible function types.
90 
91  // Create for the given function type.
92  explicit EarthMagneticUDF (FuncType);
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);
109  virtual MArray<Double> getArrayDouble (const TableExprId& id);
110 
111  private:
112  //# Data members.
120  };
121 
122 } //end namespace
123 
124 #endif
int Int
Definition: aipstype.h:50
MEarthMagnetic::Types itsRefType
virtual MArray< Double > getArrayDouble(const TableExprId &id)
Main interface class to a read/write table.
Definition: Table.h:153
static UDFBase * makeIGRFLEN(const String &)
Engine for TaQL UDF EarthMagnetic conversions.
Engine for TaQL UDF Position conversions.
Abstract base class for a user-defined TaQL function.
Definition: UDFBase.h:236
static UDFBase * makeIGRFLONG(const String &)
static UDFBase * makeIGRFXYZ(const String &)
static UDFBase * makeIGRFLOS(const String &)
static UDFBase * makeEMANG(const String &)
static UDFBase * makeEMLEN(const String &)
virtual void setup(const Table &, const TaQLStyle &)
Setup the object.
double Double
Definition: aipstype.h:55
DirectionEngine itsDirectionEngine
Class with static members defining the TaQL style.
Definition: TaQLStyle.h:64
Engine for TaQL UDF Epoch conversions.
Definition: EpochEngine.h:90
EarthMagneticUDF(FuncType)
Create for the given function type.
Engine for TaQL UDF Direction conversions.
static UDFBase * makeIGRFANG(const String &)
virtual Double getDouble(const TableExprId &id)
Get the value.
static UDFBase * makeEMXYZ(const String &)
Function to create an object.
EarthMagneticEngine itsEngine
The identification of a TaQL selection subject.
Definition: TableExprId.h:97
String: the storage and methods of handling collections of characters.
Definition: String.h:223
Types
Types of known MEarthMagnetics Tip: The order defines the order in the translation matrix FromTo in ...
FuncType
Define the possible function types.
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42
TaQL UDFs for EarthMagnetic conversions.