casacore
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>
33 #include <casacore/meas/MeasUDF/RadialVelocityEngine.h>
34 #include <casacore/meas/MeasUDF/DopplerEngine.h>
35 #include <casacore/meas/MeasUDF/EpochEngine.h>
36 #include <casacore/meas/MeasUDF/PositionEngine.h>
37 #include <casacore/meas/MeasUDF/DirectionEngine.h>
38 #include <casacore/tables/TaQL/UDFBase.h>
39 #include <casacore/measures/Measures/MRadialVelocity.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);
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
casacore::DopplerEngine
Engine for TaQL UDF Doppler conversions.
Definition: DopplerEngine.h:99
casacore::RadialVelocityUDF::itsDopplerEngine
DopplerEngine itsDopplerEngine
Definition: RadialVelocityUDF.h:114
casacore::RadialVelocityUDF::itsEpochEngine
EpochEngine itsEpochEngine
Definition: RadialVelocityUDF.h:116
casacore::RadialVelocityUDF
TaQL UDFs for RadialVelocity conversions.
Definition: RadialVelocityUDF.h:93
casacore::PositionEngine
Engine for TaQL UDF Position conversions.
Definition: PositionEngine.h:127
casacore::RadialVelocityUDF::itsRefType
MRadialVelocity::Types itsRefType
Definition: RadialVelocityUDF.h:118
casacore::RadialVelocityUDF::itsDirectionEngine
DirectionEngine itsDirectionEngine
Definition: RadialVelocityUDF.h:115
casacore::UDFBase
Abstract base class for a user-defined TaQL function.
Definition: UDFBase.h:237
casacore::MRadialVelocity::Types
Types
Types of known MRadialVelocity Warning: The order defines the order in the translation matrix FromTo...
Definition: MRadialVelocity.h:152
casacore::RadialVelocityUDF::setup
virtual void setup(const Table &, const TaQLStyle &)
Setup the object.
casacore::DirectionEngine
Engine for TaQL UDF Direction conversions.
Definition: DirectionEngine.h:142
casacore::RadialVelocityUDF::getDouble
virtual Double getDouble(const TableExprId &id)
Get the value.
casacore::Table
Main interface class to a read/write table.
Definition: Table.h:154
casacore::Double
double Double
Definition: aipstype.h:55
casacore::uInt
unsigned int uInt
Definition: aipstype.h:51
casacore::RadialVelocityUDF::RadialVelocityUDF
RadialVelocityUDF()
Create for the given function type.
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::RadialVelocityUDF::makeRADVEL
static UDFBase * makeRADVEL(const String &)
Function to create an object.
casacore::TaQLStyle
Class with static members defining the TaQL style.
Definition: TaQLStyle.h:65
casacore::RadialVelocityEngine
Engine for TaQL UDF RadialVelocity conversions.
Definition: RadialVelocityEngine.h:99
casacore::String
String: the storage and methods of handling collections of characters.
Definition: String.h:223
casacore::Bool
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
casacore::RadialVelocityUDF::itsPositionEngine
PositionEngine itsPositionEngine
Definition: RadialVelocityUDF.h:117
casacore::RadialVelocityUDF::itsEngine
RadialVelocityEngine itsEngine
Definition: RadialVelocityUDF.h:113
casacore::RadialVelocityUDF::tryDoppler
Bool tryDoppler(uInt &argnr)
Try if the value is given as Doppler.
casacore::RadialVelocityUDF::getArrayDouble
virtual MArray< Double > getArrayDouble(const TableExprId &id)
casacore::MArray< Double >
casacore::EpochEngine
Engine for TaQL UDF Epoch conversions.
Definition: EpochEngine.h:91