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
95public:
96
97 //# Constructors
98 // Default constructor
100
101 //# Destructor
103
104 //# Member functions
105 // Initialise the frame to be used. The apply direction uses the
106 // inref if present; the deapply the outref if present, otherwise the
107 // other one.
108 void initFrame(MRBase &outref, MRBase &inref);
109
110 // Functions to create a particular conversion instance; to apply
111 // or deapply the instance.
112 // <group>
113 // Precession for J2000 (IAU definition) and in coordinates
114 // <group>
118 // </group>
119 // Precession for B1950 and in coordinates
120 // <group>
124 // </group>
125 // Nutation for J2000 (IAU standard) and in coordinates
126 // <group>
130 // </group>
131 // Nutation for B1950 and in coordinates
132 // <group>
136 // </group>
137 // Precession and Nutation for J2000 or B1950 and in coordinates
138 // <group>
145 // </group>
146 // Aberration for J2000 (IAU definition) and B1950 and in coordinates
147 // <group>
154 // </group>
155 // Solar bending for J2000 (IAU definition) and in coordinates.
156 // False if dependent on frame direction rather than input one.
157 // <group>
161 // </group>
162 // Various conversions
163 // <group>
176 void applyETerms(MVPosition &in, Bool doin=True, Double epo=2000.0);
177 void deapplyETerms(MVPosition &in, Bool doin=True, Double epo=2000.0);
197 void applyAPPtoTOPO(MVPosition &in, const Double len,
198 Bool doin=True);
199 void deapplyAPPtoTOPO(MVPosition &in, const Double len,
200 Bool doin=True);
201 // </group>
202 // </group>
203
204 // Transfer some information
205 // <group>
206 void getAPP(MVPosition &out);
209 // </group>
210
211private:
212 //# Enum
213 // Types of frame information groups
220 // Types of frame information
242
243 //# Typedefs
244 // To get frame group
245 typedef const Measure* (MeasFrame::*FRFCT)() const;
246 // To get frame info
247 // <group>
248 typedef Bool (MeasFrame::*FRDINFO)(Double &) const;
249 typedef Bool (MeasFrame::*FRMVDINFO)(MVDirection &) const;
250 // </group>
251
252 //# Cached Data
253 // Data cached for fast calculations and workspace
254 // <group>
255 // Frame information
256 // <group>
264 // </group>
265 // Conversion information
266 // <group>
271 // </group>
272 // Workspace
273 // <group>
280 // </group>
281 // Aipsrc definition for B1950 epoch (in years)
283
284 // </group>
285
286 //# Constructors
287 // Copy constructor (not implemented)
288 MeasMath(const MeasMath &other);
289 // Assignment (not implemented)
291
292 //# Member functions
293 // Get proper frame information
295
296 // Get information from the frame
297 // <thrown>
298 // <li> AipsError if information not available; or False return if
299 // <em>ret=True</em>
300 // </thrown>
301 // <group>
303 // </group>
304
305 // Make a shift of coordinate into a rotation and apply it when doin is
306 // False. Else apply a shift.
307 // Given are the longitude and latitude codes of the direction to be used,
308 // and the shift to be applied in that system to the in coordinate.
309 void rotateShift(MVPosition &in, const MVPosition &shft,
310 const FrameInfo lng, const FrameInfo lat,
311 Bool doin);
312};
313
314
315} //# NAMESPACE CASACORE - END
316
317#endif
MVPosition MVPOS1
Definition MeasMath.h:275
void applyPrecNutatB1950(MVPosition &in, Bool doin=True)
const Measure *(MeasFrame::* FRFCT)() const
To get frame group.
Definition MeasMath.h:245
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:268
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:263
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:221
void applyPrecNutat(MVPosition &in)
void deapplyHADECtoAZELGEO(MVPosition &in)
MVPosition MVPOS3
Definition MeasMath.h:275
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:279
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:249
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:267
void deapplyTOPOtoHADEC(MVPosition &in, Bool doin=True)
Bool(MeasFrame::* FRDINFO)(Double &) const
To get frame info.
Definition MeasMath.h:248
static uInt b1950_reg_p
Aipsrc definition for B1950 epoch (in years)
Definition MeasMath.h:282
void applyGALtoB1950(MVPosition &in)
void createPrecessionB1950()
Precession for B1950 and in coordinates.
MVPosition MVPOS4
Definition MeasMath.h:275
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:262
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:257
void deapplyICRStoJ2000(MVPosition &in)
void deapplyPrecession(MVPosition &in)
Bool infoOK_p[N_FrameInfo]
Definition MeasMath.h:277
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:260
MeasMath(const MeasMath &other)
Copy constructor (not implemented)
void applyNutation(MVPosition &in)
RotMatrix ROTMAT1
Workspace.
Definition MeasMath.h:274
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:214
void applyMECLIPtoJMEAN(MVPosition &in)
void deapplyHADECtoAZEL(MVPosition &in)
void applyHADECtoAZELGEO(MVPosition &in)
void deapplyECLIPtoJ2000(MVPosition &in)
Nutation * NUTATB1950
Definition MeasMath.h:269
void deapplyJ2000toB1950_VLA(MVPosition &in, Bool doin=True)
Nutation * NUTATIAU
Definition MeasMath.h:269
void initFrame(MRBase &outref, MRBase &inref)
Initialise the frame to be used.
Double info_p[N_FrameDInfo]
Definition MeasMath.h:278
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.
void applyAberration(MVPosition &in, Bool doin=True)
void applyAZELtoAZELSW(MVPosition &in)
Aberration * ABERIAU
Definition MeasMath.h:268
void deapplyGALtoJ2000(MVPosition &in)
void getB1950(MVPosition &out)
Precession * PRECESB1950
Definition MeasMath.h:270
MVPosition MVPOS2
Definition MeasMath.h:275
void createSolarPos()
Solar bending for J2000 (IAU definition) and in coordinates.
MeasFrame * outFrame_p
Definition MeasMath.h:261
void getJ2000(MVPosition &out)
Bool frameOK_p[N_FrameType]
Definition MeasMath.h:259
Precession * PRECESIAU
Definition MeasMath.h:270
this file contains all the compiler specific defines
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