casacore
Loading...
Searching...
No Matches
PositionUDF.h
Go to the documentation of this file.
1// # PositionUDF.h: TaQL UDFs for Position conversions
2// # Copyright (C) 2011
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_POSITIONUDF_H
27#define MEAS_POSITIONUDF_H
28
29// # Includes
30#include <casacore/casa/aips.h>
31#include <casacore/meas/MeasUDF/PositionEngine.h>
32#include <casacore/tables/TaQL/UDFBase.h>
33#include <casacore/measures/Measures/MPosition.h>
34
35namespace casacore {
36
37// <summary>
38// TaQL UDFs for Position conversions.
39// </summary>
40
41// <use visibility=export>
42
43// <reviewed reviewer="" date="" tests="tMeas.cc">
44// </reviewed>
45
46// <prerequisite>
47// # Classes you should understand before using this one.
48// <li> UDFBase
49// </prerequisite>
50
51// <synopsis>
52// PositionUDF defines UDFs (user defined functions) that can be used in TaQL
53// to convert Measures for positions.
54// In this way such derived values appear to be ordinary TaQL functions.
55//
56// A function is called like:
57// <srcblock>
58// meas.pos (toref, pos)
59// For example,
60// meas.dir ('ITRF', [1rad,1rad], 'WGS84')
61// </srcblock>
62// <ul>
63// <li>
64// <src>toref</src> is a single constant string.
65// <li>
66// <src>pos</src> can have various value types. A single numeric array is
67// a series of RA,DEC in J2000. If given as a set, the last argument of the
68// set can be the reference types of the values in the set. The values can
69// be strings (indicating planetary objects) or value pairs giving lon,lat.
70// The default reference type is J2000.
71// </ul>
72// All functions have data type double and unit radian.
73// </synopsis>
74
75// <motivation>
76// It makes it possible to handle measures in TaQL.
77// </motivation>
78
79class PositionUDF : public UDFBase {
80 public:
81 // Define the possible function types.
83
85
86 // Function to create an object.
87 static UDFBase* makePOS(const String&);
88 static UDFBase* makeITRFXYZ(const String&);
89 static UDFBase* makeITRFLLH(const String&);
90 static UDFBase* makeITRFLL(const String&);
91 static UDFBase* makeITRFH(const String&);
92 static UDFBase* makeWGSXYZ(const String&);
93 static UDFBase* makeWGSLLH(const String&);
94 static UDFBase* makeWGSLL(const String&);
95 static UDFBase* makeWGSH(const String&);
96
97 // Setup the object.
98 virtual void setup(const Table&, const TaQLStyle&);
99
100 // Get the value.
101 virtual Double getDouble(const TableExprId& id);
103
104 private:
105 // # Data members.
110};
111
112} // namespace casacore
113
114#endif
Types
Types of known MPositions Warning: The order defines the order in the translation matrix FromTo in t...
Definition MPosition.h:93
virtual MArray< Double > getArrayDouble(const TableExprId &id)
virtual void setup(const Table &, const TaQLStyle &)
Setup the object.
PositionEngine itsEngine
static UDFBase * makeITRFH(const String &)
static UDFBase * makePOS(const String &)
Function to create an object.
static UDFBase * makeITRFLL(const String &)
MPosition::Types itsRefType
static UDFBase * makeWGSXYZ(const String &)
static UDFBase * makeWGSLLH(const String &)
FuncType
Define the possible function types.
Definition PositionUDF.h:82
static UDFBase * makeITRFLLH(const String &)
static UDFBase * makeITRFXYZ(const String &)
static UDFBase * makeWGSH(const String &)
static UDFBase * makeWGSLL(const String &)
virtual Double getDouble(const TableExprId &id)
Get the value.
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