casacore
Loading...
Searching...
No Matches
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: 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 MEASURES_MEASMATH_H
27#define MEASURES_MEASMATH_H
28
29// # Includes
30#include <casacore/casa/aips.h>
31#include <casacore/casa/Quanta/Euler.h>
32#include <casacore/casa/Quanta/RotMatrix.h>
33#include <casacore/casa/Quanta/MVPosition.h>
34#include <casacore/casa/Quanta/MVDirection.h>
35#include <casacore/measures/Measures/MeasFrame.h>
36
37namespace casacore { // # NAMESPACE CASACORE - BEGIN
38
39// # Forward Declarations
40class Measure;
41class MRBase;
42class Precession;
43class Nutation;
44class SolarPos;
45class Aberration;
46
47// # Typedefs
48
49// <summary> Measure conversion aid routines </summary>
50
51// <use visibility=local>
52
53// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="tMeasure" demos="">
54// </reviewed>
55
56// <prerequisite>
57// <li> <linkto class=Measure>MeasConvert</linkto> class
58// <li> <linkto class=MConvertBase>overall conversion</linkto> class
59// </prerequisite>
60//
61// <etymology>
62// Measure and Mathematics
63// </etymology>
64//
65// <synopsis>
66// The conversion of measures like MDirection, MPosition etc have many
67// conversion routines in common. This class combines all of these
68// conversions, including data caches for re-use.
69//
70// The class is always created by the default constructor. For each operation
71// (like e.g. Precession application), it has three function:
72// <ul>
73// <li> create(): create an instance of the data necessary to convert
74// <li> apply(): apply the conversion (in the sense of from standard to
75// perturbed (e.g. from J2000 to TOPO))
76// <li> deapply(): in the reverse direction of apply
77// </ul>
78// </synopsis>
79//
80// <example>
81// See <linkto class=MCDirection>MCDirection</linkto> source for how to use
82// the class.
83// </example>
84//
85// <motivation> To re-use code for a specific measure conversion, and to ease
86// the caching administration for each individual conversion.
87// </motivation>
88//
89// <todo asof="1998/09/30">
90// <li> Nothing I know of
91// </todo>
92
93class MeasMath {
94 public:
95 // # Constructors
96 // Default constructor
98
99 // # Destructor
101
102 // # Member functions
103 // Initialise the frame to be used. The apply direction uses the
104 // inref if present; the deapply the outref if present, otherwise the
105 // other one.
106 void initFrame(MRBase &outref, MRBase &inref);
107
108 // Functions to create a particular conversion instance; to apply
109 // or deapply the instance.
110 // <group>
111 // Precession for J2000 (IAU definition) and in coordinates
112 // <group>
116 // </group>
117 // Precession for B1950 and in coordinates
118 // <group>
122 // </group>
123 // Nutation for J2000 (IAU standard) and in coordinates
124 // <group>
128 // </group>
129 // Nutation for B1950 and in coordinates
130 // <group>
134 // </group>
135 // Precession and Nutation for J2000 or B1950 and in coordinates
136 // <group>
143 // </group>
144 // Aberration for J2000 (IAU definition) and B1950 and in coordinates
145 // <group>
152 // </group>
153 // Solar bending for J2000 (IAU definition) and in coordinates.
154 // False if dependent on frame direction rather than input one.
155 // <group>
159 // </group>
160 // Various conversions
161 // <group>
174 void applyETerms(MVPosition &in, Bool doin = True, Double epo = 2000.0);
175 void deapplyETerms(MVPosition &in, Bool doin = True, Double epo = 2000.0);
195 void applyAPPtoTOPO(MVPosition &in, const Double len, Bool doin = True);
196 void deapplyAPPtoTOPO(MVPosition &in, const Double len, Bool doin = True);
197 // </group>
198 // </group>
199
200 // Transfer some information
201 // <group>
202 void getAPP(MVPosition &out);
205 // </group>
206
207 private:
208 // # Enum
209 // Types of frame information groups
211 // Types of frame information
234
235 // # Typedefs
236 // To get frame group
237 typedef const Measure *(MeasFrame::*FRFCT)() const;
238 // To get frame info
239 // <group>
240 typedef Bool (MeasFrame::*FRDINFO)(Double &) const;
241 typedef Bool (MeasFrame::*FRMVDINFO)(MVDirection &) const;
242 // </group>
243
244 // # Cached Data
245 // Data cached for fast calculations and workspace
246 // <group>
247 // Frame information
248 // <group>
256 // </group>
257 // Conversion information
258 // <group>
263 // </group>
264 // Workspace
265 // <group>
272 // </group>
273 // Aipsrc definition for B1950 epoch (in years)
274 static inline std::once_flag initialize_once_flag;
275 static inline uInt b1950_reg_p;
276
277 // </group>
278
279 // # Constructors
280 // Copy constructor (not implemented)
281 MeasMath(const MeasMath &other);
282 // Assignment (not implemented)
284
285 static void initializeB1950();
286
287 // # Member functions
288 // Get proper frame information
290
291 // Get information from the frame
292 // <thrown>
293 // <li> AipsError if information not available; or False return if
294 // <em>ret=True</em>
295 // </thrown>
296 // <group>
298 // </group>
299
300 // Make a shift of coordinate into a rotation and apply it when doin is
301 // False. Else apply a shift.
302 // Given are the longitude and latitude codes of the direction to be used,
303 // and the shift to be applied in that system to the in coordinate.
304 void rotateShift(MVPosition &in, const MVPosition &shft, const FrameInfo lng, const FrameInfo lat,
305 Bool doin);
306};
307
308} // namespace casacore
309
310#endif
MVPosition MVPOS1
Definition MeasMath.h:267
void applyPrecNutatB1950(MVPosition &in, Bool doin=True)
const Measure *(MeasFrame::* FRFCT)() const
To get frame group.
Definition MeasMath.h:237
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:260
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:255
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:212
void applyPrecNutat(MVPosition &in)
void deapplyHADECtoAZELGEO(MVPosition &in)
MVPosition MVPOS3
Definition MeasMath.h:267
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:271
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:241
void createNutationB1950()
Nutation for B1950 and in coordinates.
void deapplyGALtoB1950(MVPosition &in)
MeasMath & operator=(const MeasMath &other)
Assignment (not implemented).
SolarPos * SOLPOSIAU
Conversion information.
Definition MeasMath.h:259
void deapplyTOPOtoHADEC(MVPosition &in, Bool doin=True)
Bool(MeasFrame::* FRDINFO)(Double &) const
To get frame info.
Definition MeasMath.h:240
static uInt b1950_reg_p
Definition MeasMath.h:275
void applyGALtoB1950(MVPosition &in)
void createPrecessionB1950()
Precession for B1950 and in coordinates.
static void initializeB1950()
MVPosition MVPOS4
Definition MeasMath.h:267
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:254
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:249
void deapplyICRStoJ2000(MVPosition &in)
void deapplyPrecession(MVPosition &in)
Bool infoOK_p[N_FrameInfo]
Definition MeasMath.h:269
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:252
MeasMath(const MeasMath &other)
Copy constructor (not implemented).
void applyNutation(MVPosition &in)
RotMatrix ROTMAT1
Workspace.
Definition MeasMath.h:266
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:210
void applyMECLIPtoJMEAN(MVPosition &in)
void deapplyHADECtoAZEL(MVPosition &in)
void applyHADECtoAZELGEO(MVPosition &in)
void deapplyECLIPtoJ2000(MVPosition &in)
Nutation * NUTATB1950
Definition MeasMath.h:261
void deapplyJ2000toB1950_VLA(MVPosition &in, Bool doin=True)
Nutation * NUTATIAU
Definition MeasMath.h:261
void initFrame(MRBase &outref, MRBase &inref)
Initialise the frame to be used.
Double info_p[N_FrameDInfo]
Definition MeasMath.h:270
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.
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.
static std::once_flag initialize_once_flag
Aipsrc definition for B1950 epoch (in years).
Definition MeasMath.h:274
void applyAberration(MVPosition &in, Bool doin=True)
void applyAZELtoAZELSW(MVPosition &in)
Aberration * ABERIAU
Definition MeasMath.h:260
void deapplyGALtoJ2000(MVPosition &in)
void getB1950(MVPosition &out)
Precession * PRECESB1950
Definition MeasMath.h:262
MVPosition MVPOS2
Definition MeasMath.h:267
void createSolarPos()
Solar bending for J2000 (IAU definition) and in coordinates.
MeasFrame * outFrame_p
Definition MeasMath.h:253
void getJ2000(MVPosition &out)
Bool frameOK_p[N_FrameType]
Definition MeasMath.h:251
Precession * PRECESIAU
Definition MeasMath.h:262
For temporary backward namespace compatibility, use casa as alias for casacore.
Definition mainpage.dox:28
const Bool False
Definition aipstype.h:42
unsigned int uInt
Definition aipstype.h:49
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40
const Bool True
Definition aipstype.h:41
double Double
Definition aipstype.h:53