casacore
MCRadialVelocity.h
Go to the documentation of this file.
1 //# MCRadialVelocity.h: MRadialVelocity conversion routines
2 //# Copyright (C) 1995,1996,1997,1998,1999,2000,2002,2003
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_MCRADIALVELOCITY_H
30 #define MEASURES_MCRADIALVELOCITY_H
31 
32 //# Includes
33 #include <casacore/casa/aips.h>
34 #include <casacore/measures/Measures/MeasBase.h>
35 #include <casacore/measures/Measures/MeasRef.h>
36 #include <casacore/measures/Measures/MCBase.h>
37 #include <casacore/measures/Measures/MConvertBase.h>
38 #include <casacore/measures/Measures/MRadialVelocity.h>
39 
40 #include <mutex>
41 
42 namespace casacore { //# NAMESPACE CASACORE - BEGIN
43 
44 //# Forward Declarations
45 class MCRadialVelocity;
46 class MDoppler;
47 class MVPosition;
48 class MVDirection;
49 class Aberration;
50 class String;
51 
52 //# Typedefs
53 
54 // <summary> MRadialVelocity conversion routines </summary>
55 
56 // <use visibility=local>
57 
58 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="tMeasure" demos="">
59 // </reviewed>
60 
61 // <prerequisite>
62 // <li> <linkto class=Measure>Measure</linkto> class
63 // <li> <linkto class=MCBase>MCBase</linkto> base class
64 // <li> <linkto class=MConvertBase>overall conversion</linkto> class
65 // </prerequisite>
66 //
67 // <etymology>
68 // Measure, Convert and RadialVelocity
69 // </etymology>
70 //
71 // <synopsis>
72 // Contains state machinery and cashing for actual conversions
73 //
74 // <example>
75 // Get the Doppler shift for an oberved HI RadialVelocity of 100 km/s
76 // <srcblock>
77 // #include <casacore/measures/Measures.h>
78 // #include <casacore/measures/Measures/MRadialVelocity.h>
79 // #include <casacore/measures/Measures/MDoppler.h>
80 // cout << "Redshift for 100 km/s: " <<
81 // MDoppler::Convert( MRadialVelocity( Quantity(100., "km/s"),
82 // MRadialVelocity::TOPO).toDoppler(QC::HI),
83 // MDoppler::Z)() << endl;
84 // </srcblock>
85 // </example>
86 //
87 // <motivation>
88 // </motivation>
89 //
90 // <todo asof="2003/03/03">
91 // </todo>
92 
93 class MCRadialVelocity : public MCBase {
94 
95 public:
96  //# Friends
97  // Conversion of data
98  friend class MeasConvert<MRadialVelocity>;
99 
100  //# Constructors
101  // Default constructor
103 
104  //# Destructor
106 
107  //# Member functions
108  // Show the state of the conversion engine (mainly for debugging purposes)
109  static String showState();
110 
111 private:
112  //# Enumerations
113  // The list of actual routines provided.
114  // <note role=warning> Each <src>AA_BB</src> in the list points to routine
115  // that can be used in the FromTo list in the getConvert routine.
116  // In addition the type to which each is converted should be in the
117  // ToRef array, again in the proper order. </note>
118  enum Routes {
134 
135  //# Typedefs
136 
137  //# Operators
138 
139  //# General Member Functions
140 
141  //# Enumerations
142 
143  //# Cached Data
148 
149  //# State machine data
150  // Transition list
151  static uInt ToRef_p[N_Routes][3];
152  // Transition matrix
154  // Object to ensure safe multi-threaded lazy single initialization
155  static std::once_flag theirInitOnceFlag;
156 
157  //# Constructors
158  // Copy constructor (not implemented)
160  // Assignment (not implemented)
162 
163  //# Member functions
164  // Create conversion function pointer
165  virtual void getConvert(MConvertBase &mc,
166  const MRBase &inref,
167  const MRBase &outref);
168 
169  // Create help structures for Measure conversion routines
170  virtual void initConvert(uInt which, MConvertBase &mc);
171 
172  // Delete the pointers used in the MeasConvert help structure cache
173  virtual void clearConvert();
174 
175  // Routine to convert RadialVelocity from one reference frame to another
176  virtual void doConvert(MeasValue &in,
177  MRBase &inref,
178  MRBase &outref,
179  const MConvertBase &mc);
180  // Conversion routine to cater for inheritance question
182  MRBase &inref,
183  MRBase &outref,
184  const MConvertBase &mc);
185 
186 private:
187  // Fill the global state. Called using theirInitOnce.
188  static void doFillState();
189 };
190 
191 
192 } //# NAMESPACE CASACORE - END
193 
194 #endif
Routes
Each derived class should have a list of routines to be called:
Definition: MCBase.h:134
static uInt FromTo_p[MRadialVelocity::N_Types][MRadialVelocity::N_Types]
Transition matrix.
virtual void getConvert(MConvertBase &mc, const MRBase &inref, const MRBase &outref)
Create conversion function pointer.
virtual void initConvert(uInt which, MConvertBase &mc)
Create help structures for Measure conversion routines.
static uInt ToRef_p[N_Routes][3]
Transition list.
static void doFillState()
Fill the global state.
MCRadialVelocity()
Default constructor.
virtual void doConvert(MeasValue &in, MRBase &inref, MRBase &outref, const MConvertBase &mc)
Routine to convert RadialVelocity from one reference frame to another.
void doConvert(MVRadialVelocity &in, MRBase &inref, MRBase &outref, const MConvertBase &mc)
Conversion routine to cater for inheritance question.
static String showState()
Show the state of the conversion engine (mainly for debugging purposes)
static std::once_flag theirInitOnceFlag
Object to ensure safe multi-threaded lazy single initialization.
MCRadialVelocity & operator=(const MCRadialVelocity &other)
Assignment (not implemented)
virtual void clearConvert()
Delete the pointers used in the MeasConvert help structure cache.
MCRadialVelocity(const MCRadialVelocity &other)
Copy constructor (not implemented)
String: the storage and methods of handling collections of characters.
Definition: String.h:225
this file contains all the compiler specific defines
Definition: mainpage.dox:28
unsigned int uInt
Definition: aipstype.h:51