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