casacore
Loading...
Searching...
No Matches
RadialVelocityEngine.h
Go to the documentation of this file.
1//# RadialVelocityEngine.h: Engine for TaQL UDF 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: 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_RADIALVELOCITYENGINE_H
27#define MEAS_RADIALVELOCITYENGINE_H
28
29//# Includes
30#include <casacore/casa/aips.h>
31#include <casacore/meas/MeasUDF/MeasEngine.h>
32#include <casacore/measures/Measures/MRadialVelocity.h>
33#include <casacore/measures/Measures/MCRadialVelocity.h>
34#include <casacore/measures/Measures/MeasConvert.h>
35
36namespace casacore {
37
38 //# Forward declarations
39 class DopplerEngine;
40 class DirectionEngine;
41 class EpochEngine;
42 class PositionEngine;
43
44
45 // <summary>
46 // Engine for TaQL UDF RadialVelocity conversions
47 // </summary>
48
49 // <use visibility=export>
50
51 // <reviewed reviewer="" date="" tests="tMeas.cc">
52 // </reviewed>
53
54 // <prerequisite>
55 //# Classes you should understand before using this one.
56 // <li> EngineBase
57 // </prerequisite>
58
59 // <synopsis>
60 // RadialVelocityEngine defines Engines (user defined functions) that can be used
61 // in TaQL to convert Measures for radial velocities.
62 // In this way such derived values appear to be ordinary TaQL functions.
63 //
64 // RadialVelocity conversions require a MeasFrame containing sky direction,
65 // epoch and position on earth.
66 // In TaQL these functions can be called like:
67 // <srcblock>
68 // meas.rv ('TOPO', 1 'm/s', 'LSRK', 'CasA', date(),
69 // [1e6m,1e6m,1e6m], 'WGS84')
70 // </srcblock>
71 // which converts the radial velocity from LSRK to TOPO.
72 // <ul>
73 // <li>
74 // <src>toref</src> is a single constant string.
75 // <li>
76 // <src>pos</src> can have various value types. A single numeric array is
77 // a series of RA,DEC in J2000. If given as a set, the last argument of the
78 // set can be the reference types of the values in the set. The values can
79 // be strings (indicating planetary objects) or value pairs giving lon,lat.
80 // The default reference type is J2000.
81 // </ul>
82 // All such functions return data with type double and unit Hz.
83 //
84 // Radial velocities can be given like:
85 // [v1,v2,...], fromRef
86 // where fromRef is the reference type.
87 //
88 // A radial velocity can also be a table column which usually knows its type.
89 // It can also be an expression (e.g. RADIALVELOCITY[0,]) which also knows the type.
90 // </synopsis>
91
92 // <motivation>
93 // It makes it possible to handle measures in TaQL.
94 // </motivation>
95
96 class RadialVelocityEngine: public MeasEngine<MRadialVelocity>
97 {
98 public:
100
101 // Get the values.
103
104 // Get the radial velocities.
106
107 // Handle the argument(s) giving the input radial velocities and reference type.
108 // The radial velocity can be a column in a table.
109 // If 'proper' is True, it is tested if a proper radial velocity is given
110 // (with proper unit and/or type). If not. False is returned.
111 // If 'proper' is False, the value is always considered as radial velocity.
112 void handleRadialVelocity (std::vector<TENShPtr>& args,
113 uInt& argnr);
114
115 // Set the MeasConvert object.
117
118 // Set the possible doppler engine.
119 // It can be done only once.
121
122 // Set the possible direction engine.
123 // It can be done only once.
125
126 // Set the possible epoch engine.
127 // It can be done only once.
129
130 // Set the possible position engine.
131 // It can be done only once.
133
134 private:
135 virtual void handleValues (TableExprNode& operand,
136 const TableExprId& id,
137 Array<MRadialVelocity>& radialVelocities);
138
139 //# Data members.
140 MeasFrame itsFrame; //# frame used by converter
146 };
147
148} //end namespace
149
150#endif
Types
Types of known MRadialVelocity Warning: The order defines the order in the translation matrix FromTo...
void setConverter(MRadialVelocity::Types toType)
Set the MeasConvert object.
Array< Double > getArrayDouble(const TableExprId &id)
Get the values.
MRadialVelocity::Convert itsConverter
void handleRadialVelocity(std::vector< TENShPtr > &args, uInt &argnr)
Handle the argument(s) giving the input radial velocities and reference type.
void setDopplerEngine(DopplerEngine &engine)
Set the possible doppler engine.
void setPositionEngine(PositionEngine &engine)
Set the possible position engine.
void setEpochEngine(EpochEngine &engine)
Set the possible epoch engine.
Array< MRadialVelocity > getRadialVelocities(const TableExprId &id)
Get the radial velocities.
void setDirectionEngine(DirectionEngine &engine)
Set the possible direction engine.
virtual void handleValues(TableExprNode &operand, const TableExprId &id, Array< MRadialVelocity > &radialVelocities)
Let a derive class handle the values.
this file contains all the compiler specific defines
Definition mainpage.dox:28
unsigned int uInt
Definition aipstype.h:49