casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DopplerUDF.h
Go to the documentation of this file.
1 //# DopplerUDF.h: TaQL UDFs for Doppler 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_DOPPLERUDF_H
29 #define MEAS_DOPPLERUDF_H
30 
31 //# Includes
32 #include <casacore/casa/aips.h>
35 
36 namespace casacore {
37 
38 // <summary>
39 // TaQL UDFs for Doppler conversions.
40 // </summary>
41 
42 // <use visibility=export>
43 
44 // <reviewed reviewer="" date="" tests="tMeas.cc">
45 // </reviewed>
46 
47 // <prerequisite>
48 //# Classes you should understand before using this one.
49 // <li> UDFBase
50 // </prerequisite>
51 
52 // <synopsis>
53 // DopplerUDF defines UDFs (user defined functions) that can be used in TaQL
54 // to convert Measures for dopplers.
55 // Special functions exist to convert to hourangle and azimuth/elevation.
56 // In this way such derived values appear to be ordinary TaQL functions.
57 //
58 // A function is called like:
59 // <srcblock>
60 // meas.dir (toref, dir, time, pos)
61 // meas.dir (toref, dir, time, pos)
62 // For example,
63 // meas.dir ('B1950', [2rad,1rad])
64 // meas.dir ('B1950', [[2rad,1rad], 'J2000'])
65 // meas.dir ('APP', 'MOON', TIME, [[5d12m, 52deg, 11m], 'WGS84'])
66 // meas.dir ('APP', 'MOON', TIME, POSITION)
67 // Or
68 // meas.dir (toref, fromref, dir, pos, time)
69 // </srcblock>
70 // <ul>
71 // <li>
72 // <src>toref</src> is a single constant string.
73 // <li>
74 // <src>dir</src> can have various value types. A single numeric array is
75 // a series of RA,DEC in J2000. If given as a set, the last argument of the
76 // set can be the reference types of the values in the set. The values can
77 // be strings (indicating planetary objects) or value pairs giving lon,lat.
78 // The default reference type is J2000.
79 // </ul>
80 // All functions have data type double and no unit.
81 // </synopsis>
82 
83 // <motivation>
84 // It makes it possible to handle measures in TaQL.
85 // </motivation>
86 
87  class DopplerUDF: public UDFBase
88  {
89  public:
90  // Create for the given function type.
91  explicit DopplerUDF();
92 
93  // Function to create an object.
94  static UDFBase* makeDOPPLER (const String&);
95 
96  // Setup the object.
97  virtual void setup (const Table&, const TaQLStyle&);
98 
99  // Handle the value arguments as doppler or radial velocity.
100  // Optionally frequency is also allowed, in which case a rest frequency
101  // must also be given.
102  // It returns a pointer to the engine representing the given value.
103  BaseEngine* handleValueArgs (vector<TENShPtr>& args, uInt& argnr,
104  Bool allowFreq);
105 
106  // Get the value.
107  virtual Double getDouble (const TableExprId& id);
108  virtual MArray<Double> getArrayDouble (const TableExprId& id);
109 
110  private:
111  //# Data members.
114  };
115 
116 } //end namespace
117 
118 #endif
Main interface class to a read/write table.
Definition: Table.h:153
TaQL UDFs for Doppler conversions.
Definition: DopplerUDF.h:87
virtual MArray< Double > getArrayDouble(const TableExprId &id)
static UDFBase * makeDOPPLER(const String &)
Function to create an object.
Abstract base class for a user-defined TaQL function.
Definition: UDFBase.h:236
virtual void setup(const Table &, const TaQLStyle &)
Setup the object.
BaseEngine * handleValueArgs(vector< TENShPtr > &args, uInt &argnr, Bool allowFreq)
Handle the value arguments as doppler or radial velocity.
DopplerUDF()
Create for the given function type.
double Double
Definition: aipstype.h:55
Class with static members defining the TaQL style.
Definition: TaQLStyle.h:64
virtual Double getDouble(const TableExprId &id)
Get the value.
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
Types
Types of known MDopplers Warning: The order defines the order in the translation matrix FromTo in th...
Definition: MDoppler.h:149
Abstract base class for the TaQL UDF conversion engines.
Definition: BaseEngine.h:91
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:223
DopplerEngine itsEngine
Definition: DopplerUDF.h:112
MDoppler::Types itsRefType
Definition: DopplerUDF.h:113
unsigned int uInt
Definition: aipstype.h:51
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42