casacore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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: 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_POSITIONUDF_H
29 #define MEAS_POSITIONUDF_H
30 
31 //# Includes
32 #include <casacore/casa/aips.h>
36 
37 namespace casacore {
38 
39 // <summary>
40 // TaQL UDFs for Position 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 // PositionUDF defines UDFs (user defined functions) that can be used in TaQL
55 // to convert Measures for positions.
56 // In this way such derived values appear to be ordinary TaQL functions.
57 //
58 // A function is called like:
59 // <srcblock>
60 // meas.pos (toref, pos)
61 // For example,
62 // meas.dir ('ITRF', [1rad,1rad], 'WGS84')
63 // </srcblock>
64 // <ul>
65 // <li>
66 // <src>toref</src> is a single constant string.
67 // <li>
68 // <src>pos</src> can have various value types. A single numeric array is
69 // a series of RA,DEC in J2000. If given as a set, the last argument of the
70 // set can be the reference types of the values in the set. The values can
71 // be strings (indicating planetary objects) or value pairs giving lon,lat.
72 // The default reference type is J2000.
73 // </ul>
74 // All functions have data type double and unit radian.
75 // </synopsis>
76 
77 // <motivation>
78 // It makes it possible to handle measures in TaQL.
79 // </motivation>
80 
81  class PositionUDF: public UDFBase
82  {
83  public:
84  // Define the possible function types.
87 
88  explicit PositionUDF (FuncType);
89 
90  // Function to create an object.
91  static UDFBase* makePOS (const String&);
92  static UDFBase* makeITRFXYZ (const String&);
93  static UDFBase* makeITRFLLH (const String&);
94  static UDFBase* makeITRFLL (const String&);
95  static UDFBase* makeITRFH (const String&);
96  static UDFBase* makeWGSXYZ (const String&);
97  static UDFBase* makeWGSLLH (const String&);
98  static UDFBase* makeWGSLL (const String&);
99  static UDFBase* makeWGSH (const String&);
100 
101  // Setup the object.
102  virtual void setup (const Table&, const TaQLStyle&);
103 
104  // Get the value.
105  virtual Double getDouble (const TableExprId& id);
106  virtual MArray<Double> getArrayDouble (const TableExprId& id);
107 
108  private:
109  //# Data members.
114  };
115 
116 } //end namespace
117 
118 #endif
int Int
Definition: aipstype.h:50
Main interface class to a read/write table.
Definition: Table.h:157
PositionEngine itsEngine
Definition: PositionUDF.h:110
virtual MArray< Double > getArrayDouble(const TableExprId &id)
Engine for TaQL UDF Position conversions.
Abstract base class for a user-defined TaQL function.
Definition: UDFBase.h:235
static UDFBase * makeWGSH(const String &)
static UDFBase * makePOS(const String &)
Function to create an object.
static UDFBase * makeITRFLL(const String &)
static UDFBase * makeWGSLLH(const String &)
static UDFBase * makeITRFH(const String &)
static UDFBase * makeWGSXYZ(const String &)
static UDFBase * makeWGSLL(const String &)
double Double
Definition: aipstype.h:55
TaQL UDFs for Position conversions.
Definition: PositionUDF.h:81
Class with static members defining the TaQL style.
Definition: TaQLStyle.h:64
static UDFBase * makeITRFLLH(const String &)
FuncType
Define the possible function types.
Definition: PositionUDF.h:85
Types
Types of known MPositions Warning: The order defines the order in the translation matrix FromTo in t...
Definition: MPosition.h:94
The identification of a TaQL selection subject.
Definition: TableExprId.h:97
String: the storage and methods of handling collections of characters.
Definition: String.h:225
static UDFBase * makeITRFXYZ(const String &)
virtual void setup(const Table &, const TaQLStyle &)
Setup the object.
virtual Double getDouble(const TableExprId &id)
Get the value.
MPosition::Types itsRefType
Definition: PositionUDF.h:112