casacore
MeasMath.h
Go to the documentation of this file.
1 //# MeasMath.h: Measure conversion aid routines
2 //# Copyright (C) 1998,2000,2002-2004,2007
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 //#
27 //# $Id$
28 
29 #ifndef MEASURES_MEASMATH_H
30 #define MEASURES_MEASMATH_H
31 
32 //# Includes
33 #include <casacore/casa/aips.h>
34 #include <casacore/casa/Quanta/Euler.h>
35 #include <casacore/casa/Quanta/RotMatrix.h>
36 #include <casacore/casa/Quanta/MVPosition.h>
37 #include <casacore/casa/Quanta/MVDirection.h>
38 #include <casacore/measures/Measures/MeasFrame.h>
39 
40 namespace casacore { //# NAMESPACE CASACORE - BEGIN
41 
42 //# Forward Declarations
43 class Measure;
44 class MRBase;
45 class Precession;
46 class Nutation;
47 class SolarPos;
48 class Aberration;
49 
50 //# Typedefs
51 
52 // <summary> Measure conversion aid routines </summary>
53 
54 // <use visibility=local>
55 
56 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="tMeasure" demos="">
57 // </reviewed>
58 
59 // <prerequisite>
60 // <li> <linkto class=Measure>MeasConvert</linkto> class
61 // <li> <linkto class=MConvertBase>overall conversion</linkto> class
62 // </prerequisite>
63 //
64 // <etymology>
65 // Measure and Mathematics
66 // </etymology>
67 //
68 // <synopsis>
69 // The conversion of measures like MDirection, MPosition etc have many
70 // conversion routines in common. This class combines all of these
71 // conversions, including data caches for re-use.
72 //
73 // The class is always created by the default constructor. For each operation
74 // (like e.g. Precession application), it has three function:
75 // <ul>
76 // <li> create(): create an instance of the data necessary to convert
77 // <li> apply(): apply the conversion (in the sense of from standard to
78 // perturbed (e.g. from J2000 to TOPO))
79 // <li> deapply(): in the reverse direction of apply
80 // </ul>
81 // </synopsis>
82 //
83 // <example>
84 // See <linkto class=MCDirection>MCDirection</linkto> source for how to use
85 // the class.
86 // </example>
87 //
88 // <motivation> To re-use code for a specific measure conversion, and to ease
89 // the caching administration for each individual conversion.
90 // </motivation>
91 //
92 // <todo asof="1998/09/30">
93 // <li> Nothing I know of
94 // </todo>
95 
96 class MeasMath {
97 
98 public:
99 
100  //# Constructors
101  // Default constructor
103 
104  //# Destructor
106 
107  //# Member functions
108  // Initialise the frame to be used. The apply direction uses the
109  // inref if present; the deapply the outref if present, otherwise the
110  // other one.
111  void initFrame(MRBase &outref, MRBase &inref);
112 
113  // Functions to create a particular conversion instance; to apply
114  // or deapply the instance.
115  // <group>
116  // Precession for J2000 (IAU definition) and in coordinates
117  // <group>
121  // </group>
122  // Precession for B1950 and in coordinates
123  // <group>
127  // </group>
128  // Nutation for J2000 (IAU standard) and in coordinates
129  // <group>
133  // </group>
134  // Nutation for B1950 and in coordinates
135  // <group>
139  // </group>
140  // Precession and Nutation for J2000 or B1950 and in coordinates
141  // <group>
148  // </group>
149  // Aberration for J2000 (IAU definition) and B1950 and in coordinates
150  // <group>
157  // </group>
158  // Solar bending for J2000 (IAU definition) and in coordinates.
159  // False if dependent on frame direction rather than input one.
160  // <group>
164  // </group>
165  // Various conversions
166  // <group>
173  void applyJ2000toB1950(MVPosition &in, Double epo, Bool doin);
179  void applyETerms(MVPosition &in, Bool doin=True, Double epo=2000.0);
180  void deapplyETerms(MVPosition &in, Bool doin=True, Double epo=2000.0);
200  void applyAPPtoTOPO(MVPosition &in, const Double len,
201  Bool doin=True);
202  void deapplyAPPtoTOPO(MVPosition &in, const Double len,
203  Bool doin=True);
204  // </group>
205  // </group>
206 
207  // Transfer some information
208  // <group>
209  void getAPP(MVPosition &out);
210  void getJ2000(MVPosition &out);
211  void getB1950(MVPosition &out);
212  // </group>
213 
214 private:
215  //# Enum
216  // Types of frame information groups
217  enum FrameType {
218  EPOCH = 0,
223  // Types of frame information
224  enum FrameInfo {
225  TDB = 0,
227  TT,
245 
246  //# Typedefs
247  // To get frame group
248  typedef const Measure* (MeasFrame::*FRFCT)() const;
249  // To get frame info
250  // <group>
251  typedef Bool (MeasFrame::*FRDINFO)(Double &) const;
252  typedef Bool (MeasFrame::*FRMVDINFO)(MVDirection &) const;
253  // </group>
254 
255  //# Cached Data
256  // Data cached for fast calculations and workspace
257  // <group>
258  // Frame information
259  // <group>
267  // </group>
268  // Conversion information
269  // <group>
274  // </group>
275  // Workspace
276  // <group>
283  // </group>
284  // Aipsrc definition for B1950 epoch (in years)
286 
287  // </group>
288 
289  //# Constructors
290  // Copy constructor (not implemented)
291  MeasMath(const MeasMath &other);
292  // Assignment (not implemented)
293  MeasMath &operator=(const MeasMath &other);
294 
295  //# Member functions
296  // Get proper frame information
298 
299  // Get information from the frame
300  // <thrown>
301  // <li> AipsError if information not available; or False return if
302  // <em>ret=True</em>
303  // </thrown>
304  // <group>
306  // </group>
307 
308  // Make a shift of coordinate into a rotation and apply it when doin is
309  // False. Else apply a shift.
310  // Given are the longitude and latitude codes of the direction to be used,
311  // and the shift to be applied in that system to the in coordinate.
312  void rotateShift(MVPosition &in, const MVPosition &shft,
313  const FrameInfo lng, const FrameInfo lat,
314  Bool doin);
315 };
316 
317 
318 } //# NAMESPACE CASACORE - END
319 
320 #endif
MVPosition MVPOS1
Definition: MeasMath.h:278
void applyPrecNutatB1950(MVPosition &in, Bool doin=True)
void applyNutationB1950(MVPosition &in)
void applyPolarMotion(MVPosition &in)
void createPrecNutat()
Precession and Nutation for J2000 or B1950 and in coordinates.
void applyHADECtoAZEL(MVPosition &in)
Aberration * ABERB1950
Definition: MeasMath.h:271
void deapplySolarPos(MVPosition &in, Bool doin=True)
void applyGALtoJ2000(MVPosition &in)
void deapplyMECLIPtoJMEAN(MVPosition &in)
void applySolarPos(MVPosition &in, Bool doin=True)
void deapplyNutationB1950(MVPosition &in)
MeasFrame * deapplyFrame_p[N_FrameType]
Definition: MeasMath.h:266
void deapplyAPPtoTOPO(MVPosition &in, const Double len, Bool doin=True)
void deapplyNutation(MVPosition &in)
void applyETerms(MVPosition &in, Bool doin=True, Double epo=2000.0)
void deapplyPrecNutat(MVPosition &in)
void deapplyPolarMotion(MVPosition &in)
MeasMath()
Default constructor.
FrameInfo
Types of frame information.
Definition: MeasMath.h:224
void applyPrecNutat(MVPosition &in)
void deapplyHADECtoAZELGEO(MVPosition &in)
MVPosition MVPOS3
Definition: MeasMath.h:278
void applyAberrationB1950(MVPosition &in, Bool doin=True)
void applyICRStoJ2000(MVPosition &in)
void applyPrecession(MVPosition &in)
void deapplyAberrationB1950(MVPosition &in, Bool doin=True)
MVDirection infomvd_p[N_FrameMVDInfo]
Definition: MeasMath.h:282
Bool getInfo(FrameInfo i, Bool ret=False)
Get information from the frame.
void deapplyTECLIPtoJTRUE(MVPosition &in)
void createAberration()
Aberration for J2000 (IAU definition) and B1950 and in coordinates.
void createPrecNutatB1950()
void deapplyPrecNutatB1950(MVPosition &in, Bool doin=True)
void createNutation()
Nutation for J2000 (IAU standard) and in coordinates.
Bool(MeasFrame::* FRMVDINFO)(MVDirection &) const
Definition: MeasMath.h:252
void createNutationB1950()
Nutation for B1950 and in coordinates.
void deapplyGALtoB1950(MVPosition &in)
SolarPos * SOLPOSIAU
Conversion information.
Definition: MeasMath.h:270
void deapplyTOPOtoHADEC(MVPosition &in, Bool doin=True)
Bool(MeasFrame::* FRDINFO)(Double &) const
To get frame info.
Definition: MeasMath.h:251
static uInt b1950_reg_p
Aipsrc definition for B1950 epoch (in years)
Definition: MeasMath.h:285
void applyGALtoB1950(MVPosition &in)
void createPrecessionB1950()
Precession for B1950 and in coordinates.
MVPosition MVPOS4
Definition: MeasMath.h:278
void applyAPPtoTOPO(MVPosition &in, const Double len, Bool doin=True)
void applyECLIPtoJ2000(MVPosition &in)
void deapplyJ2000toB1950(MVPosition &in, Bool doin=True)
MeasFrame * applyFrame_p[N_FrameType]
Definition: MeasMath.h:265
void applyJ2000toB1950_VLA(MVPosition &in, Bool doin=True)
void applyGALtoSUPERGAL(MVPosition &in)
Bool inOK_p
Data cached for fast calculations and workspace.
Definition: MeasMath.h:260
void deapplyICRStoJ2000(MVPosition &in)
void deapplyPrecession(MVPosition &in)
Bool infoOK_p[N_FrameInfo]
Definition: MeasMath.h:280
void createAberrationB1950()
void deapplyJ2000toB1950(MVPosition &in, Double epo, Bool doin)
void deapplyAberration(MVPosition &in, Bool doin=True)
void applyJ2000toB1950(MVPosition &in, Bool doin=True)
void applyPrecessionB1950(MVPosition &in)
MeasFrame * inFrame_p
Definition: MeasMath.h:263
MeasMath(const MeasMath &other)
Copy constructor (not implemented)
void applyNutation(MVPosition &in)
RotMatrix ROTMAT1
Workspace.
Definition: MeasMath.h:277
void applyJ2000toB1950(MVPosition &in, Double epo, Bool doin)
void rotateShift(MVPosition &in, const MVPosition &shft, const FrameInfo lng, const FrameInfo lat, Bool doin)
Make a shift of coordinate into a rotation and apply it when doin is False.
void deapplyGALtoSUPERGAL(MVPosition &in)
void deapplyETerms(MVPosition &in, Bool doin=True, Double epo=2000.0)
FrameType
Types of frame information groups.
Definition: MeasMath.h:217
void applyMECLIPtoJMEAN(MVPosition &in)
void deapplyHADECtoAZEL(MVPosition &in)
void applyHADECtoAZELGEO(MVPosition &in)
void deapplyECLIPtoJ2000(MVPosition &in)
MeasMath & operator=(const MeasMath &other)
Assignment (not implemented)
Nutation * NUTATB1950
Definition: MeasMath.h:272
void deapplyJ2000toB1950_VLA(MVPosition &in, Bool doin=True)
Nutation * NUTATIAU
Definition: MeasMath.h:272
void initFrame(MRBase &outref, MRBase &inref)
Initialise the frame to be used.
Double info_p[N_FrameDInfo]
Definition: MeasMath.h:281
void applyTECLIPtoJTRUE(MVPosition &in)
void deapplyHADECtoITRF(MVPosition &in)
void applyTOPOtoHADEC(MVPosition &in, Bool doin=True)
void getAPP(MVPosition &out)
Transfer some information.
void getFrame(FrameType i)
Get proper frame information.
const Measure *(MeasFrame::* FRFCT)() const
To get frame group.
Definition: MeasMath.h:248
void applyHADECtoITRF(MVPosition &in)
Various conversions.
void deapplyPrecessionB1950(MVPosition &in)
void createPrecession()
Functions to create a particular conversion instance; to apply or deapply the instance.
void applyAberration(MVPosition &in, Bool doin=True)
void applyAZELtoAZELSW(MVPosition &in)
Aberration * ABERIAU
Definition: MeasMath.h:271
void deapplyGALtoJ2000(MVPosition &in)
void getB1950(MVPosition &out)
Precession * PRECESB1950
Definition: MeasMath.h:273
MVPosition MVPOS2
Definition: MeasMath.h:278
void createSolarPos()
Solar bending for J2000 (IAU definition) and in coordinates.
MeasFrame * outFrame_p
Definition: MeasMath.h:264
void getJ2000(MVPosition &out)
Bool frameOK_p[N_FrameType]
Definition: MeasMath.h:262
Precession * PRECESIAU
Definition: MeasMath.h:273
this file contains all the compiler specific defines
Definition: mainpage.dox:28
const Bool False
Definition: aipstype.h:44
unsigned int uInt
Definition: aipstype.h:51
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
const Bool True
Definition: aipstype.h:43
double Double
Definition: aipstype.h:55