casacore
MCEarthMagnetic.h
Go to the documentation of this file.
1 //# MCEarthMagnetic.h: MEarthMagnetic conversion routines
2 //# Copyright (C) 1998,1999,2000,2002,2004
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_MCEARTHMAGNETIC_H
30 #define MEASURES_MCEARTHMAGNETIC_H
31 
32 //# Includes
33 #include <casacore/casa/aips.h>
34 #include <casacore/measures/Measures/MEarthMagnetic.h>
35 #include <casacore/measures/Measures/MeasBase.h>
36 #include <casacore/measures/Measures/MeasRef.h>
37 #include <casacore/measures/Measures/MCBase.h>
38 #include <casacore/measures/Measures/MConvertBase.h>
39 #include <casacore/measures/Measures/MeasMath.h>
40 #include <casacore/casa/OS/Mutex.h>
41 
42 namespace casacore { //# NAMESPACE CASACORE - BEGIN
43 
44 //# Forward Declarations
45 class MCEarthMagnetic;
46 class MVPosition;
47 class EarthField;
48 class String;
49 template <class T> class Vector;
50 
51 //# Typedefs
52 
53 // <summary> MEarthMagnetic conversion routines </summary>
54 
55 // <use visibility=local>
56 
57 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="tMEarthMagnetic" demos="">
58 // </reviewed>
59 
60 // <prerequisite>
61 // <li> <linkto class=Measure>Measure</linkto> class
62 // <li> <linkto class=MCBase>MCBase</linkto> base class
63 // <li> <linkto class=MConvertBase>overall conversion</linkto> class
64 // </prerequisite>
65 //
66 // <etymology>
67 // Measure, Convert and EarthMagnetic
68 // </etymology>
69 //
70 // <synopsis>
71 // Contains state machinery and caching for actual conversions
72 // </synopsis>
73 //
74 // <example>
75 // See <linkto module=Measures>Measures</linkto> module description for
76 // conversion examples.
77 // </example>
78 //
79 // <motivation>
80 // </motivation>
81 //
82 // <todo asof="1998/04/21">
83 // <li> Use MCDirection routines directly
84 // </todo>
85 
86 class MCEarthMagnetic : public MCBase {
87 
88 public:
89 
90  //# Friends
91  // Conversion of data
92  friend class MeasConvert<MEarthMagnetic>;
93 
94  //# Constructors
95  // Default constructor
97 
98  //# Destructor
100 
101  //# Member functions
102  // Show the state of the conversion engine (mainly for debugging purposes)
103  static String showState();
104 
105 private:
106  //# Enumerations
107  // The list of actual routines provided.
108  // <note role=warning> Each <src>AA_BB</src> in the list points to routine
109  // that can be used in the FromTo list in the getConvert routine.
110  // In addition the type to which each is converted should be in the
111  // ToRef array, again in the proper order. </note>
112  enum Routes {
158  // General for Models
161  // Individual models. Order should be the same as in MEarthMagnetic.h
162  R_IGRF
163  };
164 
165  //# Typedefs
166 
167  //# Operators
168 
169  //# General Member Functions
170 
171  //# Enumerations
172 
173  //# Cached Data
177 
178  //# State machine data
179  // Transition list
180  static uInt ToRef_p[N_Routes][3];
181  // Transition matrix
183  // Object to ensure safe multi-threaded lazy single initialization
185 
186  //# Constructors
187  // Copy constructor (not implemented)
189  // Assignment (not implemented)
191 
192  //# Member functions
193 
194  // Create conversion function pointer
195  virtual void getConvert(MConvertBase &mc,
196  const MRBase &inref,
197  const MRBase &outref);
198 
199  // Create help structures for Measure conversion routines
200  virtual void initConvert(uInt which, MConvertBase &mc);
201 
202  // Delete the pointers used in the MeasConvert help structure cache
203  virtual void clearConvert();
204 
205  // Routines to convert EarthMagnetics from one reference frame to another
206  virtual void doConvert(MeasValue &in,
207  MRBase &inref,
208  MRBase &outref,
209  const MConvertBase &mc);
210  // Conversion routine to cater for inheritance question
212  MRBase &inref,
213  MRBase &outref,
214  const MConvertBase &mc);
215 
216 private:
217  // Fill the global state. Called using theirInitOnce.
218  static void doFillState();
219 };
220 
221 
222 } //# NAMESPACE CASACORE - END
223 
224 #endif
225 
casacore::MeasMath
Measure conversion aid routines.
Definition: MeasMath.h:96
casacore::MCEarthMagnetic::JTRUE_JMEAN
@ JTRUE_JMEAN
Definition: MCEarthMagnetic.h:125
casacore::MCEarthMagnetic::TOPO_HADEC
@ TOPO_HADEC
Definition: MCEarthMagnetic.h:153
casacore::MCEarthMagnetic::B1950_APP
@ B1950_APP
Definition: MCEarthMagnetic.h:129
casacore::MCEarthMagnetic::GAL_SUPERGAL
@ GAL_SUPERGAL
Definition: MCEarthMagnetic.h:149
casacore::MCEarthMagnetic::AZEL_AZELSW
@ AZEL_AZELSW
Definition: MCEarthMagnetic.h:137
casacore::MCEarthMagnetic::N_Routes
@ N_Routes
Definition: MCEarthMagnetic.h:157
casacore::MCEarthMagnetic::showState
static String showState()
Show the state of the conversion engine (mainly for debugging purposes)
casacore::MCEarthMagnetic::operator=
MCEarthMagnetic & operator=(const MCEarthMagnetic &other)
Assignment (not implemented)
casacore::MCEarthMagnetic::APP_JNAT
@ APP_JNAT
Definition: MCEarthMagnetic.h:141
casacore::MCEarthMagnetic::AZELGEO_HADEC
@ AZELGEO_HADEC
Definition: MCEarthMagnetic.h:135
casacore::MCEarthMagnetic::J2000_B1950
@ J2000_B1950
Definition: MCEarthMagnetic.h:117
casacore::MCEarthMagnetic::R_MODEL0
@ R_MODEL0
General for Models.
Definition: MCEarthMagnetic.h:159
casacore::MeasValue
Base class for values in a Measure.
Definition: MeasValue.h:107
casacore::MCEarthMagnetic::J2000_ICRS
@ J2000_ICRS
Definition: MCEarthMagnetic.h:156
casacore::MCEarthMagnetic
MEarthMagnetic conversion routines
Definition: MCEarthMagnetic.h:86
casacore::MCEarthMagnetic::B1950_J2000
@ B1950_J2000
Definition: MCEarthMagnetic.h:118
casacore::MCEarthMagnetic::AZEL_HADEC
@ AZEL_HADEC
Definition: MCEarthMagnetic.h:134
casacore::MCBase
Base for specific measure conversions.
Definition: MCBase.h:119
casacore::MCEarthMagnetic::~MCEarthMagnetic
~MCEarthMagnetic()
casacore::MCEarthMagnetic::J2000_JMEAN
@ J2000_JMEAN
Definition: MCEarthMagnetic.h:119
casacore::MCEarthMagnetic::HADEC_TOPO
@ HADEC_TOPO
Definition: MCEarthMagnetic.h:136
casacore::MCEarthMagnetic::B1950_GAL
@ B1950_GAL
Definition: MCEarthMagnetic.h:116
casacore::MCEarthMagnetic::ECLIP_J2000
@ ECLIP_J2000
Definition: MCEarthMagnetic.h:144
casacore::MRBase
Base for Reference frame for physical measures.
Definition: MRBase.h:103
casacore::MCEarthMagnetic::J2000_ECLIP
@ J2000_ECLIP
Definition: MCEarthMagnetic.h:143
casacore::MCEarthMagnetic::HADEC_ITRF
@ HADEC_ITRF
Definition: MCEarthMagnetic.h:152
casacore::MCEarthMagnetic::TECLIP_JTRUE
@ TECLIP_JTRUE
Definition: MCEarthMagnetic.h:148
casacore::MCEarthMagnetic::getConvert
virtual void getConvert(MConvertBase &mc, const MRBase &inref, const MRBase &outref)
Create conversion function pointer.
casacore::MVEarthMagnetic
A 3D Earth magnetic field vector.
Definition: MVEarthMagnetic.h:109
casacore::MCEarthMagnetic::BMEAN_B1950
@ BMEAN_B1950
Definition: MCEarthMagnetic.h:123
casacore::MCEarthMagnetic::HADEC_AZELGEO
@ HADEC_AZELGEO
Definition: MCEarthMagnetic.h:133
casacore::MCEarthMagnetic::MECLIP_JMEAN
@ MECLIP_JMEAN
Definition: MCEarthMagnetic.h:146
casacore::uInt
unsigned int uInt
Definition: aipstype.h:51
casacore::MCEarthMagnetic::JNAT_J2000
@ JNAT_J2000
Definition: MCEarthMagnetic.h:128
casacore::MCEarthMagnetic::SUPERGAL_GAL
@ SUPERGAL_GAL
Definition: MCEarthMagnetic.h:150
casacore::MCEarthMagnetic::R_MODEL
@ R_MODEL
Definition: MCEarthMagnetic.h:160
casacore::MCEarthMagnetic::EFIELD
EarthField * EFIELD
Definition: MCEarthMagnetic.h:175
casacore::MCEarthMagnetic::ITRF_HADEC
@ ITRF_HADEC
Definition: MCEarthMagnetic.h:151
casacore::MCEarthMagnetic::AZELSW_AZEL
@ AZELSW_AZEL
Definition: MCEarthMagnetic.h:139
casacore::MCEarthMagnetic::J2000_GAL
@ J2000_GAL
Definition: MCEarthMagnetic.h:115
casacore::EarthField
EarthField class model calculations.
Definition: EarthField.h:130
casacore::MeasConvert
Conversion of Measures.
Definition: MBaseline.h:44
casacore::MCEarthMagnetic::ToRef_p
static uInt ToRef_p[N_Routes][3]
Transition list.
Definition: MCEarthMagnetic.h:180
casacore::MCEarthMagnetic::doFillState
static void doFillState()
Fill the global state.
casacore
this file contains all the compiler specific defines
Definition: mainpage.dox:28
casacore::MCEarthMagnetic::MCEarthMagnetic
MCEarthMagnetic(const MCEarthMagnetic &other)
Copy constructor (not implemented)
casacore::MCEarthMagnetic::B1950_BMEAN
@ B1950_BMEAN
Definition: MCEarthMagnetic.h:120
casacore::MCEarthMagnetic::initConvert
virtual void initConvert(uInt which, MConvertBase &mc)
Create help structures for Measure conversion routines.
casacore::MCEarthMagnetic::JTRUE_TECLIP
@ JTRUE_TECLIP
Definition: MCEarthMagnetic.h:147
casacore::MCEarthMagnetic::APP_TOPO
@ APP_TOPO
Definition: MCEarthMagnetic.h:131
casacore::MCEarthMagnetic::JMEAN_J2000
@ JMEAN_J2000
Definition: MCEarthMagnetic.h:121
casacore::MCEarthMagnetic::AZELGEO_AZELSWGEO
@ AZELGEO_AZELSWGEO
Definition: MCEarthMagnetic.h:138
casacore::MCEarthMagnetic::GAL_B1950
@ GAL_B1950
Definition: MCEarthMagnetic.h:114
casacore::MCEarthMagnetic::measMath
MeasMath measMath
Definition: MCEarthMagnetic.h:176
casacore::MCEarthMagnetic::BTRUE_BMEAN
@ BTRUE_BMEAN
Definition: MCEarthMagnetic.h:126
casacore::MCEarthMagnetic::GAL_J2000
@ GAL_J2000
Definition: MCEarthMagnetic.h:113
casacore::MCEarthMagnetic::FromTo_p
static uInt FromTo_p[MEarthMagnetic::N_Types][MEarthMagnetic::N_Types]
Transition matrix.
Definition: MCEarthMagnetic.h:182
casacore::MCEarthMagnetic::TOPO_APP
@ TOPO_APP
Definition: MCEarthMagnetic.h:154
casacore::MCEarthMagnetic::HADEC_AZEL
@ HADEC_AZEL
Definition: MCEarthMagnetic.h:132
casacore::MVPosition
A 3D vector in space.
Definition: MVPosition.h:113
casacore::MCEarthMagnetic::clearConvert
virtual void clearConvert()
Delete the pointers used in the MeasConvert help structure cache.
casacore::String
String: the storage and methods of handling collections of characters.
Definition: String.h:223
casacore::MCEarthMagnetic::APP_B1950
@ APP_B1950
Definition: MCEarthMagnetic.h:130
casacore::MCEarthMagnetic::MCEarthMagnetic
MCEarthMagnetic()
Default constructor.
casacore::MEarthMagnetic::N_Types
@ N_Types
Definition: MEarthMagnetic.h:155
casacore::MCEarthMagnetic::JMEAN_MECLIP
@ JMEAN_MECLIP
Definition: MCEarthMagnetic.h:145
casacore::MCEarthMagnetic::MVPOS1
MVPosition * MVPOS1
Definition: MCEarthMagnetic.h:174
casacore::MCEarthMagnetic::R_IGRF
@ R_IGRF
Individual models.
Definition: MCEarthMagnetic.h:162
casacore::Vector
A 1-D Specialization of the Array class.
Definition: ArrayIO.h:45
casacore::MCEarthMagnetic::ICRS_J2000
@ ICRS_J2000
Definition: MCEarthMagnetic.h:155
casacore::MCEarthMagnetic::AZELSWGEO_AZELGEO
@ AZELSWGEO_AZELGEO
Definition: MCEarthMagnetic.h:140
casacore::MCEarthMagnetic::J2000_JNAT
@ J2000_JNAT
Definition: MCEarthMagnetic.h:127
casacore::MCEarthMagnetic::JMEAN_JTRUE
@ JMEAN_JTRUE
Definition: MCEarthMagnetic.h:122
casacore::CallOnce0
Wrapper around std::call_once.
Definition: Mutex.h:215
casacore::MCEarthMagnetic::doConvert
virtual void doConvert(MeasValue &in, MRBase &inref, MRBase &outref, const MConvertBase &mc)
Routines to convert EarthMagnetics from one reference frame to another.
casacore::MCEarthMagnetic::theirInitOnce
static CallOnce0 theirInitOnce
Object to ensure safe multi-threaded lazy single initialization.
Definition: MCEarthMagnetic.h:184
casacore::MCEarthMagnetic::doConvert
void doConvert(MVEarthMagnetic &in, MRBase &inref, MRBase &outref, const MConvertBase &mc)
Conversion routine to cater for inheritance question.
casacore::MCEarthMagnetic::BMEAN_BTRUE
@ BMEAN_BTRUE
Definition: MCEarthMagnetic.h:124
casacore::MConvertBase
Conversion of Measures Base.
Definition: MConvertBase.h:147
casacore::MEarthMagnetic
A Measure: Magnetic field on Earth.
Definition: MEarthMagnetic.h:118
casacore::MCBase::Routes
Routes
Each derived class should have a list of routines to be called:
Definition: MCBase.h:134
casacore::MCEarthMagnetic::JNAT_APP
@ JNAT_APP
Definition: MCEarthMagnetic.h:142