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