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 
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.
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
casacore::EarthMagneticUDF::makeEMXYZ
static UDFBase * makeEMXYZ(const String &)
Function to create an object.
casacore::EarthMagneticEngine
Engine for TaQL UDF EarthMagnetic conversions.
Definition: EarthMagneticEngine.h:144
casacore::EarthMagneticUDF::IGRFLONG
@ IGRFLONG
Definition: EarthMagneticUDF.h:89
casacore::EarthMagneticUDF::setup
virtual void setup(const Table &, const TaQLStyle &)
Setup the object.
casacore::EarthMagneticUDF::getDouble
virtual Double getDouble(const TableExprId &id)
Get the value.
casacore::EarthMagneticUDF::itsPositionEngine
PositionEngine itsPositionEngine
Definition: EarthMagneticUDF.h:116
casacore::EarthMagneticUDF::itsEngine
EarthMagneticEngine itsEngine
Definition: EarthMagneticUDF.h:113
casacore::EarthMagneticUDF::IGRFLOS
@ IGRFLOS
Definition: EarthMagneticUDF.h:89
casacore::EarthMagneticUDF::makeEMLEN
static UDFBase * makeEMLEN(const String &)
casacore::EarthMagneticUDF::EMXYZ
@ EMXYZ
Definition: EarthMagneticUDF.h:88
casacore::EarthMagneticUDF::EarthMagneticUDF
EarthMagneticUDF(FuncType)
Create for the given function type.
casacore::PositionEngine
Engine for TaQL UDF Position conversions.
Definition: PositionEngine.h:127
casacore::EarthMagneticUDF::IGRFXYZ
@ IGRFXYZ
Definition: EarthMagneticUDF.h:88
casacore::UDFBase
Abstract base class for a user-defined TaQL function.
Definition: UDFBase.h:237
casacore::EarthMagneticUDF::IGRFANG
@ IGRFANG
Definition: EarthMagneticUDF.h:88
casacore::DirectionEngine
Engine for TaQL UDF Direction conversions.
Definition: DirectionEngine.h:142
casacore::MEarthMagnetic::Types
Types
Types of known MEarthMagnetics Tip: The order defines the order in the translation matrix FromTo in ...
Definition: MEarthMagnetic.h:133
casacore::EarthMagneticUDF::getArrayDouble
virtual MArray< Double > getArrayDouble(const TableExprId &id)
casacore::Table
Main interface class to a read/write table.
Definition: Table.h:154
casacore::EarthMagneticUDF
TaQL UDFs for EarthMagnetic conversions.
Definition: EarthMagneticUDF.h:85
casacore::Double
double Double
Definition: aipstype.h:55
casacore::EarthMagneticUDF::FuncType
FuncType
Define the possible function types.
Definition: EarthMagneticUDF.h:88
casacore::EarthMagneticUDF::itsType
FuncType itsType
Definition: EarthMagneticUDF.h:117
casacore::EarthMagneticUDF::itsRefType
MEarthMagnetic::Types itsRefType
Definition: EarthMagneticUDF.h:119
casacore::Int
int Int
Definition: aipstype.h:50
casacore
this file contains all the compiler specific defines
Definition: mainpage.dox:28
casacore::TableExprId
The identification of a TaQL selection subject.
Definition: TableExprId.h:98
casacore::EarthMagneticUDF::makeIGRFLEN
static UDFBase * makeIGRFLEN(const String &)
casacore::EarthMagneticUDF::EMANG
@ EMANG
Definition: EarthMagneticUDF.h:88
casacore::EarthMagneticUDF::itsValueType
Int itsValueType
Definition: EarthMagneticUDF.h:118
casacore::TaQLStyle
Class with static members defining the TaQL style.
Definition: TaQLStyle.h:65
casacore::EarthMagneticUDF::itsEpochEngine
EpochEngine itsEpochEngine
Definition: EarthMagneticUDF.h:115
casacore::EarthMagneticUDF::IGRFLEN
@ IGRFLEN
Definition: EarthMagneticUDF.h:88
casacore::String
String: the storage and methods of handling collections of characters.
Definition: String.h:223
casacore::EarthMagneticUDF::makeIGRFLOS
static UDFBase * makeIGRFLOS(const String &)
casacore::EarthMagneticUDF::makeEMANG
static UDFBase * makeEMANG(const String &)
casacore::EarthMagneticUDF::makeIGRFLONG
static UDFBase * makeIGRFLONG(const String &)
casacore::EarthMagneticUDF::makeIGRFANG
static UDFBase * makeIGRFANG(const String &)
casacore::MArray< Double >
casacore::EarthMagneticUDF::makeIGRFXYZ
static UDFBase * makeIGRFXYZ(const String &)
casacore::EarthMagneticUDF::EMLEN
@ EMLEN
Definition: EarthMagneticUDF.h:88
casacore::EpochEngine
Engine for TaQL UDF Epoch conversions.
Definition: EpochEngine.h:91
casacore::EarthMagneticUDF::itsDirectionEngine
DirectionEngine itsDirectionEngine
Definition: EarthMagneticUDF.h:114