casacore
Loading...
Searching...
No Matches
EpochUDF.h
Go to the documentation of this file.
1// # EpochUDF.h: TaQL UDFs for Epoch conversions
2// # Copyright (C) 2011
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_EPOCHUDF_H
27#define MEAS_EPOCHUDF_H
28
29// # Includes
30#include <casacore/casa/aips.h>
31#include <casacore/meas/MeasUDF/EpochEngine.h>
32#include <casacore/meas/MeasUDF/PositionEngine.h>
33#include <casacore/tables/TaQL/UDFBase.h>
34
35namespace casacore {
36
37// <summary>
38// TaQL UDFs for Epoch conversions.
39// </summary>
40
41// <use visibility=export>
42
43// <reviewed reviewer="" date="" tests="tMeas.cc">
44// </reviewed>
45
46// <prerequisite>
47// # Classes you should understand before using this one.
48// <li> UDFBase
49// </prerequisite>
50
51// <synopsis>
52// EpochUDF defines UDFs (user defined functions) that can be used in TaQL
53// to convert Measures for epochs.
54// Special functions exist to convert to local sidereal time.
55// In this way such derived values appear to be ordinary TaQL functions.
56//
57// A function is called like:
58// <srcblock>
59// meas.epoch (toref, epoch, fromref, pos, posref)
60// For example,
61// meas.dir ('APP', 'MOON', POSITION, TIME)
62// </srcblock>
63// <ul>
64// <li>
65// <src>toref</src> is a single constant string.
66// <li>
67// <src>dir</src> can have various value types. A single numeric array is
68// a series of RA,DEC in J2000. If given as a set, the last argument of the
69// set can be the reference types of the values in the set. The values can
70// be strings (indicating planetary objects) or value pairs giving lon,lat.
71// The default reference type is J2000.
72// </ul>
73// All functions have data type double and unit radian.
74// </synopsis>
75
76// <motivation>
77// It makes it possible to handle measures in TaQL.
78// </motivation>
79
80class EpochUDF : public UDFBase {
81 public:
82 // Define the possible function types.
83 enum FuncType { EPOCH, LAST };
84
85 explicit EpochUDF(FuncType);
86
87 // Function to create an object.
88 static UDFBase* makeEPOCH(const String&);
89 static UDFBase* makeLAST(const String&);
90
91 // Setup the object.
92 virtual void setup(const Table&, const TaQLStyle&);
93
94 // Get the value.
95 virtual Double getDouble(const TableExprId& id);
97
98 private:
99 // # Data members.
104 Bool itsSidFrac; // T = use fraction for sidereal times
105};
106
107} // namespace casacore
108
109#endif
FuncType
Define the possible function types.
Definition EpochUDF.h:83
static UDFBase * makeLAST(const String &)
static UDFBase * makeEPOCH(const String &)
Function to create an object.
EpochEngine itsEngine
Definition EpochUDF.h:100
virtual MArray< Double > getArrayDouble(const TableExprId &id)
PositionEngine itsPositionEngine
Definition EpochUDF.h:101
virtual Double getDouble(const TableExprId &id)
Get the value.
virtual void setup(const Table &, const TaQLStyle &)
Setup the object.
MEpoch::Types itsRefType
Definition EpochUDF.h:103
Types
Types of known MEpochs Caution: The order defines the order in the translation matrix in the MCEpoch...
Definition MEpoch.h:116
String: the storage and methods of handling collections of characters.
Definition String.h:355
UDFBase()
Only default constructor is needed.
For temporary backward namespace compatibility, use casa as alias for casacore.
Definition mainpage.dox:28
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40
double Double
Definition aipstype.h:53