casacore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RadialVelocityUDF.h
Go to the documentation of this file.
1 //# RadialVelocityUDF.h: TaQL UDFs for RadialVelocity 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_RADIALVELOCITYUDF_H
29 #define MEAS_RADIALVELOCITYUDF_H
30 
31 //# Includes
32 #include <casacore/casa/aips.h>
40 
41 namespace casacore {
42 
43 // <summary>
44 // TaQL UDFs for RadialVelocity conversions.
45 // </summary>
46 
47 // <use visibility=export>
48 
49 // <reviewed reviewer="" date="" tests="tMeas.cc">
50 // </reviewed>
51 
52 // <prerequisite>
53 //# Classes you should understand before using this one.
54 // <li> UDFBase
55 // </prerequisite>
56 
57 // <synopsis>
58 // RadialVelocityUDF defines UDFs (user defined functions) that can be used in TaQL
59 // to convert Measures for radialVelocitys.
60 // Special functions exist to convert to hourangle and azimuth/elevation.
61 // In this way such derived values appear to be ordinary TaQL functions.
62 //
63 // A function is called like:
64 // <srcblock>
65 // meas.dir (toref, dir, time, pos)
66 // meas.dir (toref, dir, time, pos)
67 // For example,
68 // meas.dir ('B1950', [2rad,1rad])
69 // meas.dir ('B1950', [[2rad,1rad], 'J2000'])
70 // meas.dir ('APP', 'MOON', TIME, [[5d12m, 52deg, 11m], 'WGS84'])
71 // meas.dir ('APP', 'MOON', TIME, POSITION)
72 // Or
73 // meas.dir (toref, fromref, dir, pos, time)
74 // </srcblock>
75 // <ul>
76 // <li>
77 // <src>toref</src> is a single constant string.
78 // <li>
79 // <src>dir</src> can have various value types. A single numeric array is
80 // a series of RA,DEC in J2000. If given as a set, the last argument of the
81 // set can be the reference types of the values in the set. The values can
82 // be strings (indicating planetary objects) or value pairs giving lon,lat.
83 // The default reference type is J2000.
84 // </ul>
85 // All functions have data type double and unit radian.
86 // </synopsis>
87 
88 // <motivation>
89 // It makes it possible to handle measures in TaQL.
90 // </motivation>
91 
92  class RadialVelocityUDF: public UDFBase
93  {
94  public:
95  // Create for the given function type.
96  explicit RadialVelocityUDF();
97 
98  // Function to create an object.
99  static UDFBase* makeRADVEL (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  // Try if the value is given as Doppler. True is returned if so.
110  Bool tryDoppler (uInt& argnr);
111 
112  //# Data members.
119  };
120 
121 } //end namespace
122 
123 #endif
Main interface class to a read/write table.
Definition: Table.h:157
Engine for TaQL UDF RadialVelocity conversions.
virtual void setup(const Table &, const TaQLStyle &)
Setup the object.
virtual Double getDouble(const TableExprId &id)
Get the value.
Engine for TaQL UDF Position conversions.
Abstract base class for a user-defined TaQL function.
Definition: UDFBase.h:235
MRadialVelocity::Types itsRefType
RadialVelocityUDF()
Create for the given function type.
double Double
Definition: aipstype.h:55
Class with static members defining the TaQL style.
Definition: TaQLStyle.h:64
Engine for TaQL UDF Epoch conversions.
Definition: EpochEngine.h:90
Engine for TaQL UDF Direction conversions.
Types
Types of known MRadialVelocity Warning: The order defines the order in the translation matrix FromTo...
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
Bool tryDoppler(uInt &argnr)
Try if the value is given as Doppler.
TaQL UDFs for RadialVelocity conversions.
static UDFBase * makeRADVEL(const String &)
Function to create an object.
The identification of a TaQL selection subject.
Definition: TableExprId.h:97
Engine for TaQL UDF Doppler conversions.
Definition: DopplerEngine.h:98
String: the storage and methods of handling collections of characters.
Definition: String.h:225
virtual MArray< Double > getArrayDouble(const TableExprId &id)
unsigned int uInt
Definition: aipstype.h:51
RadialVelocityEngine itsEngine