casacore
Loading...
Searching...
No Matches
DirectionUDF.h
Go to the documentation of this file.
1//# DirectionUDF.h: TaQL UDFs for Direction 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_DIRECTIONUDF_H
27#define MEAS_DIRECTIONUDF_H
28
29//# Includes
30#include <casacore/casa/aips.h>
31#include <casacore/meas/MeasUDF/DirectionEngine.h>
32#include <casacore/meas/MeasUDF/EpochEngine.h>
33#include <casacore/meas/MeasUDF/PositionEngine.h>
34#include <casacore/tables/TaQL/UDFBase.h>
35
36namespace casacore {
37
38// <summary>
39// TaQL UDFs for Direction 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// DirectionUDF defines UDFs (user defined functions) that can be used in TaQL
54// to convert Measures for directions.
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 unit radian.
81// </synopsis>
82
83// <motivation>
84// It makes it possible to handle measures in TaQL.
85// </motivation>
86
87 class DirectionUDF: public UDFBase
88 {
89 public:
90 // Define the possible function types.
93
94 // Create for the given function type.
95 // The Bools tell if rise/set times have to be calculated.
96 explicit DirectionUDF (FuncType, Bool riseSet=False);
97
98 // Function to create an object.
99 static UDFBase* makeDIR (const String&);
100 static UDFBase* makeDIRCOS (const String&);
101 static UDFBase* makeHADEC (const String&);
102 static UDFBase* makeAZEL (const String&);
103 static UDFBase* makeAPP (const String&);
104 static UDFBase* makeJ2000 (const String&);
105 static UDFBase* makeB1950 (const String&);
106 static UDFBase* makeECL (const String&);
107 static UDFBase* makeGAL (const String&);
108 static UDFBase* makeSGAL (const String&);
109 static UDFBase* makeITRF (const String&);
110 static UDFBase* makeRISESET (const String&);
111
112 // Setup the object.
113 virtual void setup (const Table&, const TaQLStyle&);
114
115 // Get the value.
116 virtual Double getDouble (const TableExprId& id);
119
120 private:
121 //# Data members.
127 Bool itsRiseSet; //# True = calculate rise/set time
128 };
129
130} //end namespace
131
132#endif
static UDFBase * makeGAL(const String &)
static UDFBase * makeITRF(const String &)
static UDFBase * makeB1950(const String &)
PositionEngine itsPositionEngine
MDirection::Types itsRefType
static UDFBase * makeJ2000(const String &)
static UDFBase * makeAPP(const String &)
static UDFBase * makeAZEL(const String &)
virtual void setup(const Table &, const TaQLStyle &)
Setup the object.
static UDFBase * makeDIRCOS(const String &)
DirectionUDF(FuncType, Bool riseSet=False)
Create for the given function type.
virtual MArray< Double > getArrayDouble(const TableExprId &id)
static UDFBase * makeSGAL(const String &)
static UDFBase * makeDIR(const String &)
Function to create an object.
DirectionEngine itsEngine
virtual MArray< MVTime > getArrayDate(const TableExprId &id)
static UDFBase * makeECL(const String &)
static UDFBase * makeRISESET(const String &)
FuncType
Define the possible function types.
virtual Double getDouble(const TableExprId &id)
Get the value.
static UDFBase * makeHADEC(const String &)
Types
Types of known MDirections Warning: The order defines the order in the translation matrix FromTo in ...
Definition MDirection.h:185
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
const Bool False
Definition aipstype.h:42
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40
double Double
Definition aipstype.h:53