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
casacore::MeasMath::applyAberration
void applyAberration(MVPosition &in, Bool doin=True)
casacore::MeasMath::J2000LONG
@ J2000LONG
Definition: MeasMath.h:233
casacore::MeasMath::applyMECLIPtoJMEAN
void applyMECLIPtoJMEAN(MVPosition &in)
casacore::MeasMath
Definition: MeasMath.h:96
casacore::MeasMath::deapplyECLIPtoJ2000
void deapplyECLIPtoJ2000(MVPosition &in)
casacore::MeasMath::applyHADECtoAZEL
void applyHADECtoAZEL(MVPosition &in)
casacore::MeasMath::MeasMath
MeasMath()
Default constructor.
casacore::MeasMath::MVPOS4
MVPosition MVPOS4
Definition: MeasMath.h:278
casacore::MeasMath::MVPOS1
MVPosition MVPOS1
Definition: MeasMath.h:278
casacore::MeasMath::applyPrecession
void applyPrecession(MVPosition &in)
casacore::MeasMath::deapplyPrecNutatB1950
void deapplyPrecNutatB1950(MVPosition &in, Bool doin=True)
casacore::MeasMath::applyAPPtoTOPO
void applyAPPtoTOPO(MVPosition &in, const Double len, Bool doin=True)
casacore::MeasMath::deapplyPrecession
void deapplyPrecession(MVPosition &in)
casacore::MeasMath::deapplyAberration
void deapplyAberration(MVPosition &in, Bool doin=True)
casacore::MeasMath::inFrame_p
MeasFrame * inFrame_p
Definition: MeasMath.h:263
casacore::Nutation
Definition: Nutation.h:139
casacore::MeasMath::createPrecNutatB1950
void createPrecNutatB1950()
casacore::MeasMath::ROTMAT1
RotMatrix ROTMAT1
Workspace.
Definition: MeasMath.h:277
casacore::MeasMath::deapplyFrame_p
MeasFrame * deapplyFrame_p[N_FrameType]
Definition: MeasMath.h:266
casacore::Measure
Definition: Measure.h:235
casacore::MeasMath::deapplyMECLIPtoJMEAN
void deapplyMECLIPtoJMEAN(MVPosition &in)
casacore::MVDirection
Definition: MVDirection.h:106
casacore::MeasMath::deapplyGALtoSUPERGAL
void deapplyGALtoSUPERGAL(MVPosition &in)
casacore::MeasMath::B1950LONG
@ B1950LONG
Definition: MeasMath.h:235
casacore::MeasMath::applyECLIPtoJ2000
void applyECLIPtoJ2000(MVPosition &in)
casacore::MeasMath::lengthE
Double lengthE
Definition: MeasMath.h:279
casacore::MeasMath::deapplyHADECtoAZELGEO
void deapplyHADECtoAZELGEO(MVPosition &in)
casacore::MeasMath::inOK_p
Bool inOK_p
Data cached for fast calculations and workspace.
Definition: MeasMath.h:260
casacore::MeasMath::createPrecNutat
void createPrecNutat()
Precession and Nutation for J2000 or B1950 and in coordinates.
casacore::MeasMath::applyJ2000toB1950
void applyJ2000toB1950(MVPosition &in, Bool doin=True)
casacore::MeasMath::LONG
@ LONG
Definition: MeasMath.h:229
casacore::MeasMath::APPDIR
@ APPDIR
Definition: MeasMath.h:242
casacore::MeasMath::deapplyGALtoB1950
void deapplyGALtoB1950(MVPosition &in)
casacore::MeasMath::frameOK_p
Bool frameOK_p[N_FrameType]
Definition: MeasMath.h:262
casacore::SolarPos
Definition: SolarPos.h:111
casacore::MeasMath::createAberrationB1950
void createAberrationB1950()
casacore::MeasMath::applySolarPos
void applySolarPos(MVPosition &in, Bool doin=True)
casacore::MeasMath::outOK_p
Bool outOK_p
Definition: MeasMath.h:261
casacore::MeasMath::applyICRStoJ2000
void applyICRStoJ2000(MVPosition &in)
casacore::MeasMath::TT
@ TT
Definition: MeasMath.h:227
casacore::MeasMath::deapplyPolarMotion
void deapplyPolarMotion(MVPosition &in)
casacore::MeasMath::getFrame
void getFrame(FrameType i)
Get proper frame information.
casacore::MeasMath::MVPOS2
MVPosition MVPOS2
Definition: MeasMath.h:278
casacore::MeasMath::deapplyPrecessionB1950
void deapplyPrecessionB1950(MVPosition &in)
casacore::MeasMath::deapplyAPPtoTOPO
void deapplyAPPtoTOPO(MVPosition &in, const Double len, Bool doin=True)
casacore::MeasMath::g2
Double g2
Definition: MeasMath.h:279
casacore::MeasMath::FRDINFO
Bool(MeasFrame::* FRDINFO)(Double &) const
To get frame info.
Definition: MeasMath.h:251
casacore::MRBase
Definition: MRBase.h:103
casacore::MeasMath::EPOCH
@ EPOCH
Definition: MeasMath.h:218
casacore::MeasMath::createPrecessionB1950
void createPrecessionB1950()
Precession for B1950 and in coordinates.
casacore::MeasMath::MeasMath
MeasMath(const MeasMath &other)
Copy constructor (not implemented)
casacore::MeasMath::deapplyHADECtoITRF
void deapplyHADECtoITRF(MVPosition &in)
casacore::MeasMath::LATGEO
@ LATGEO
Definition: MeasMath.h:232
casacore::MeasMath::POSITION
@ POSITION
Definition: MeasMath.h:219
casacore::MeasMath::applyPrecNutatB1950
void applyPrecNutatB1950(MVPosition &in, Bool doin=True)
casacore::RotMatrix
Definition: RotMatrix.h:86
casacore::MeasFrame
Definition: MeasFrame.h:137
casacore::MeasMath::LASTR
@ LASTR
Definition: MeasMath.h:226
casacore::MeasMath::getAPP
void getAPP(MVPosition &out)
Transfer some information.
casacore::MeasMath::applyHADECtoAZELGEO
void applyHADECtoAZELGEO(MVPosition &in)
casacore::MeasMath::deapplyJ2000toB1950
void deapplyJ2000toB1950(MVPosition &in, Bool doin=True)
casacore::MeasMath::initFrame
void initFrame(MRBase &outref, MRBase &inref)
Initialise the frame to be used.
casacore::MeasMath::applyJ2000toB1950_VLA
void applyJ2000toB1950_VLA(MVPosition &in, Bool doin=True)
casacore::MeasMath::J2000DIR
@ J2000DIR
Definition: MeasMath.h:240
casacore::MeasMath::deapplyGALtoJ2000
void deapplyGALtoJ2000(MVPosition &in)
casacore::Double
double Double
Definition: aipstype.h:55
casacore::MeasMath::N_FrameInfo
@ N_FrameInfo
Definition: MeasMath.h:243
casacore::MeasMath::deapplySolarPos
void deapplySolarPos(MVPosition &in, Bool doin=True)
casacore::MeasMath::deapplyAberrationB1950
void deapplyAberrationB1950(MVPosition &in, Bool doin=True)
casacore::False
const Bool False
Definition: aipstype.h:44
casacore::MeasMath::applyPolarMotion
void applyPolarMotion(MVPosition &in)
casacore::uInt
unsigned int uInt
Definition: aipstype.h:51
casacore::MeasMath::FRFCT
const Measure *(MeasFrame::* FRFCT)() const
To get frame group.
Definition: MeasMath.h:248
casacore::MeasMath::NUTATIAU
Nutation * NUTATIAU
Definition: MeasMath.h:272
casacore::MeasMath::applyJ2000toB1950
void applyJ2000toB1950(MVPosition &in, Double epo, Bool doin)
casacore::MeasMath::createPrecession
void createPrecession()
Functions to create a particular conversion instance; to apply or deapply the instance.
casacore::MeasMath::ABERB1950
Aberration * ABERB1950
Definition: MeasMath.h:271
casacore::MeasMath::infomvd_p
MVDirection infomvd_p[N_FrameMVDInfo]
Definition: MeasMath.h:282
casacore::MeasMath::b1950_reg_p
static uInt b1950_reg_p
Aipsrc definition for B1950 epoch (in years)
Definition: MeasMath.h:285
casacore::MeasMath::N_FrameMVDInfo
@ N_FrameMVDInfo
Definition: MeasMath.h:244
casacore::MeasMath::outFrame_p
MeasFrame * outFrame_p
Definition: MeasMath.h:264
casacore::MeasMath::PRECESIAU
Precession * PRECESIAU
Definition: MeasMath.h:273
casacore::MeasMath::deapplyJ2000toB1950_VLA
void deapplyJ2000toB1950_VLA(MVPosition &in, Bool doin=True)
casacore::MeasMath::UT1
@ UT1
Definition: MeasMath.h:228
casacore::Precession
Definition: Precession.h:130
casacore::MeasMath::FrameType
FrameType
Types of frame information groups.
Definition: MeasMath.h:217
casacore::MeasMath::deapplyNutation
void deapplyNutation(MVPosition &in)
casacore::MeasMath::DIRECTION
@ DIRECTION
Definition: MeasMath.h:220
casacore::MeasMath::RADIUS
@ RADIUS
Definition: MeasMath.h:231
casacore
this file contains all the compiler specific defines
Definition: mainpage.dox:28
casacore::MeasMath::applyGALtoB1950
void applyGALtoB1950(MVPosition &in)
casacore::MeasMath::deapplyPrecNutat
void deapplyPrecNutat(MVPosition &in)
casacore::MeasMath::deapplyICRStoJ2000
void deapplyICRStoJ2000(MVPosition &in)
casacore::MeasMath::APPLAT
@ APPLAT
Definition: MeasMath.h:238
casacore::MeasMath::getB1950
void getB1950(MVPosition &out)
casacore::MeasMath::getInfo
Bool getInfo(FrameInfo i, Bool ret=False)
Get information from the frame.
casacore::True
const Bool True
Definition: aipstype.h:43
casacore::MeasMath::infoOK_p
Bool infoOK_p[N_FrameInfo]
Definition: MeasMath.h:280
casacore::MeasMath::LAT
@ LAT
Definition: MeasMath.h:230
casacore::MeasMath::operator=
MeasMath & operator=(const MeasMath &other)
Assignment (not implemented)
casacore::MeasMath::deapplyNutationB1950
void deapplyNutationB1950(MVPosition &in)
casacore::MeasMath::applyGALtoSUPERGAL
void applyGALtoSUPERGAL(MVPosition &in)
casacore::MeasMath::N_FrameDInfo
@ N_FrameDInfo
Definition: MeasMath.h:239
casacore::MeasMath::deapplyTECLIPtoJTRUE
void deapplyTECLIPtoJTRUE(MVPosition &in)
casacore::MeasMath::deapplyJ2000toB1950
void deapplyJ2000toB1950(MVPosition &in, Double epo, Bool doin)
casacore::MeasMath::FrameInfo
FrameInfo
Types of frame information.
Definition: MeasMath.h:224
casacore::MeasMath::rotateShift
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.
casacore::MeasMath::APPLONG
@ APPLONG
Definition: MeasMath.h:237
casacore::MeasMath::getJ2000
void getJ2000(MVPosition &out)
casacore::MeasMath::NUTATB1950
Nutation * NUTATB1950
Definition: MeasMath.h:272
casacore::MVPosition
Definition: MVPosition.h:113
casacore::MeasMath::J2000LAT
@ J2000LAT
Definition: MeasMath.h:234
casacore::MeasMath::applyNutationB1950
void applyNutationB1950(MVPosition &in)
casacore::MeasMath::applyTECLIPtoJTRUE
void applyTECLIPtoJTRUE(MVPosition &in)
casacore::MeasMath::applyETerms
void applyETerms(MVPosition &in, Bool doin=True, Double epo=2000.0)
casacore::MeasMath::createSolarPos
void createSolarPos()
Solar bending for J2000 (IAU definition) and in coordinates.
casacore::MeasMath::SOLPOSIAU
SolarPos * SOLPOSIAU
Conversion information.
Definition: MeasMath.h:270
casacore::Bool
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
casacore::MeasMath::g3
Double g3
Definition: MeasMath.h:279
casacore::MeasMath::createNutation
void createNutation()
Nutation for J2000 (IAU standard) and in coordinates.
casacore::MeasMath::applyHADECtoITRF
void applyHADECtoITRF(MVPosition &in)
Various conversions.
casacore::MeasMath::createNutationB1950
void createNutationB1950()
Nutation for B1950 and in coordinates.
casacore::MeasMath::PRECESB1950
Precession * PRECESB1950
Definition: MeasMath.h:273
casacore::MeasMath::deapplyETerms
void deapplyETerms(MVPosition &in, Bool doin=True, Double epo=2000.0)
casacore::MeasMath::TDB
@ TDB
Definition: MeasMath.h:225
casacore::MeasMath::applyTOPOtoHADEC
void applyTOPOtoHADEC(MVPosition &in, Bool doin=True)
casacore::MeasMath::~MeasMath
~MeasMath()
casacore::MeasMath::g1
Double g1
Definition: MeasMath.h:279
casacore::MeasMath::applyAZELtoAZELSW
void applyAZELtoAZELSW(MVPosition &in)
casacore::MeasMath::applyGALtoJ2000
void applyGALtoJ2000(MVPosition &in)
casacore::MeasMath::applyNutation
void applyNutation(MVPosition &in)
casacore::MeasMath::N_FrameType
@ N_FrameType
Definition: MeasMath.h:222
casacore::MeasMath::MVPOS3
MVPosition MVPOS3
Definition: MeasMath.h:278
casacore::MeasMath::applyFrame_p
MeasFrame * applyFrame_p[N_FrameType]
Definition: MeasMath.h:265
casacore::Aberration
Definition: Aberration.h:110
casacore::MeasMath::info_p
Double info_p[N_FrameDInfo]
Definition: MeasMath.h:281
casacore::MeasMath::VELOCITY
@ VELOCITY
Definition: MeasMath.h:221
casacore::MeasMath::createAberration
void createAberration()
Aberration for J2000 (IAU definition) and B1950 and in coordinates.
casacore::MeasMath::B1950DIR
@ B1950DIR
Definition: MeasMath.h:241
casacore::MeasMath::applyPrecessionB1950
void applyPrecessionB1950(MVPosition &in)
casacore::MeasMath::applyPrecNutat
void applyPrecNutat(MVPosition &in)
casacore::MeasMath::deapplyTOPOtoHADEC
void deapplyTOPOtoHADEC(MVPosition &in, Bool doin=True)
casacore::MeasMath::FRMVDINFO
Bool(MeasFrame::* FRMVDINFO)(MVDirection &) const
Definition: MeasMath.h:252
casacore::MeasMath::applyAberrationB1950
void applyAberrationB1950(MVPosition &in, Bool doin=True)
casacore::MeasMath::deapplyHADECtoAZEL
void deapplyHADECtoAZEL(MVPosition &in)
casacore::MeasMath::B1950LAT
@ B1950LAT
Definition: MeasMath.h:236
casacore::MeasMath::ABERIAU
Aberration * ABERIAU
Definition: MeasMath.h:271