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