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 #include <casacore/casa/OS/Mutex.h>
40 
41 namespace casacore { //# NAMESPACE CASACORE - BEGIN
42 
43 //# Forward Declarations
44 class MCRadialVelocity;
45 class MDoppler;
46 class MVPosition;
47 class MVDirection;
48 class Aberration;
49 class String;
50 
51 //# Typedefs
52 
53 // <summary> MRadialVelocity conversion routines </summary>
54 
55 // <use visibility=local>
56 
57 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="tMeasure" 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 RadialVelocity
68 // </etymology>
69 //
70 // <synopsis>
71 // Contains state machinery and cashing for actual conversions
72 //
73 // <example>
74 // Get the Doppler shift for an oberved HI RadialVelocity of 100 km/s
75 // <srcblock>
76 // #include <casacore/measures/Measures.h>
77 // #include <casacore/measures/Measures/MRadialVelocity.h>
78 // #include <casacore/measures/Measures/MDoppler.h>
79 // cout << "Redshift for 100 km/s: " <<
80 // MDoppler::Convert( MRadialVelocity( Quantity(100., "km/s"),
81 // MRadialVelocity::TOPO).toDoppler(QC::HI),
82 // MDoppler::Z)() << endl;
83 // </srcblock>
84 // </example>
85 //
86 // <motivation>
87 // </motivation>
88 //
89 // <todo asof="2003/03/03">
90 // </todo>
91 
92 class MCRadialVelocity : public MCBase {
93 
94 public:
95  //# Friends
96  // Conversion of data
97  friend class MeasConvert<MRadialVelocity>;
98 
99  //# Constructors
100  // Default constructor
102 
103  //# Destructor
105 
106  //# Member functions
107  // Show the state of the conversion engine (mainly for debugging purposes)
108  static String showState();
109 
110 private:
111  //# Enumerations
112  // The list of actual routines provided.
113  // <note role=warning> Each <src>AA_BB</src> in the list points to routine
114  // that can be used in the FromTo list in the getConvert routine.
115  // In addition the type to which each is converted should be in the
116  // ToRef array, again in the proper order. </note>
117  enum Routes {
133 
134  //# Typedefs
135 
136  //# Operators
137 
138  //# General Member Functions
139 
140  //# Enumerations
141 
142  //# Cached Data
147 
148  //# State machine data
149  // Transition list
150  static uInt ToRef_p[N_Routes][3];
151  // Transition matrix
153  // Object to ensure safe multi-threaded lazy single initialization
155 
156  //# Constructors
157  // Copy constructor (not implemented)
159  // Assignment (not implemented)
161 
162  //# Member functions
163  // Create conversion function pointer
164  virtual void getConvert(MConvertBase &mc,
165  const MRBase &inref,
166  const MRBase &outref);
167 
168  // Create help structures for Measure conversion routines
169  virtual void initConvert(uInt which, MConvertBase &mc);
170 
171  // Delete the pointers used in the MeasConvert help structure cache
172  virtual void clearConvert();
173 
174  // Routine to convert RadialVelocity from one reference frame to another
175  virtual void doConvert(MeasValue &in,
176  MRBase &inref,
177  MRBase &outref,
178  const MConvertBase &mc);
179  // Conversion routine to cater for inheritance question
181  MRBase &inref,
182  MRBase &outref,
183  const MConvertBase &mc);
184 
185 private:
186  // Fill the global state. Called using theirInitOnce.
187  static void doFillState();
188 };
189 
190 
191 } //# NAMESPACE CASACORE - END
192 
193 #endif
casacore::MCRadialVelocity
Definition: MCRadialVelocity.h:92
casacore::MVRadialVelocity
Definition: MVRadialVelocity.h:94
casacore::MCRadialVelocity::clearConvert
virtual void clearConvert()
Delete the pointers used in the MeasConvert help structure cache.
casacore::MCRadialVelocity::BARY_CMB
@ BARY_CMB
Definition: MCRadialVelocity.h:130
casacore::MCRadialVelocity::doConvert
virtual void doConvert(MeasValue &in, MRBase &inref, MRBase &outref, const MConvertBase &mc)
Routine to convert RadialVelocity from one reference frame to another.
casacore::MCRadialVelocity::BARY_LSRK
@ BARY_LSRK
Definition: MCRadialVelocity.h:127
casacore::MRadialVelocity
Definition: MRadialVelocity.h:137
casacore::MCRadialVelocity::doFillState
static void doFillState()
Fill the global state.
casacore::MVDirection
Definition: MVDirection.h:106
casacore::MCRadialVelocity::GALACTO_LSRD
@ GALACTO_LSRD
Definition: MCRadialVelocity.h:125
casacore::MCRadialVelocity::BARY_LSRD
@ BARY_LSRD
Definition: MCRadialVelocity.h:119
casacore::MeasValue
Definition: MeasValue.h:107
casacore::MCRadialVelocity::N_Routes
@ N_Routes
Definition: MCRadialVelocity.h:132
casacore::MCBase
Definition: MCBase.h:119
casacore::MCRadialVelocity::showState
static String showState()
Show the state of the conversion engine (mainly for debugging purposes)
casacore::MCRadialVelocity::MCRadialVelocity
MCRadialVelocity(const MCRadialVelocity &other)
Copy constructor (not implemented)
casacore::MCRadialVelocity::MCRadialVelocity
MCRadialVelocity()
Default constructor.
casacore::MRBase
Definition: MRBase.h:103
casacore::MCRadialVelocity::~MCRadialVelocity
~MCRadialVelocity()
casacore::MCRadialVelocity::GEO_BARY
@ GEO_BARY
Definition: MCRadialVelocity.h:122
casacore::MCRadialVelocity::initConvert
virtual void initConvert(uInt which, MConvertBase &mc)
Create help structures for Measure conversion routines.
casacore::MCRadialVelocity::GEO_TOPO
@ GEO_TOPO
Definition: MCRadialVelocity.h:121
casacore::MCRadialVelocity::ToRef_p
static uInt ToRef_p[N_Routes][3]
Transition list.
Definition: MCRadialVelocity.h:150
casacore::uInt
unsigned int uInt
Definition: aipstype.h:51
casacore::MCRadialVelocity::theirInitOnce
static CallOnce0 theirInitOnce
Object to ensure safe multi-threaded lazy single initialization.
Definition: MCRadialVelocity.h:154
casacore::MCRadialVelocity::TOPO_GEO
@ TOPO_GEO
Definition: MCRadialVelocity.h:123
casacore::MeasConvert
Definition: MeasConvert.h:143
casacore::MCRadialVelocity::BARY_GEO
@ BARY_GEO
Definition: MCRadialVelocity.h:120
casacore
this file contains all the compiler specific defines
Definition: mainpage.dox:28
casacore::MCRadialVelocity::LSRD_BARY
@ LSRD_BARY
Definition: MCRadialVelocity.h:118
casacore::MCRadialVelocity::doConvert
void doConvert(MVRadialVelocity &in, MRBase &inref, MRBase &outref, const MConvertBase &mc)
Conversion routine to cater for inheritance question.
casacore::MCRadialVelocity::ABERTO
Aberration * ABERTO
Definition: MCRadialVelocity.h:146
casacore::MCRadialVelocity::BARY_LGROUP
@ BARY_LGROUP
Definition: MCRadialVelocity.h:128
casacore::MCRadialVelocity::operator=
MCRadialVelocity & operator=(const MCRadialVelocity &other)
Assignment (not implemented)
casacore::MCRadialVelocity::CMB_BARY
@ CMB_BARY
Definition: MCRadialVelocity.h:131
casacore::MCRadialVelocity::MVPOS1
MVPosition * MVPOS1
Definition: MCRadialVelocity.h:143
casacore::MCRadialVelocity::LSRD_GALACTO
@ LSRD_GALACTO
Definition: MCRadialVelocity.h:124
casacore::MVPosition
Definition: MVPosition.h:113
casacore::MCRadialVelocity::LSRK_BARY
@ LSRK_BARY
Definition: MCRadialVelocity.h:126
casacore::MCRadialVelocity::MVDIR1
MVDirection * MVDIR1
Definition: MCRadialVelocity.h:144
casacore::MDoppler
Definition: MDoppler.h:134
casacore::String
String: the storage and methods of handling collections of characters.
Definition: String.h:223
casacore::MCRadialVelocity::FromTo_p
static uInt FromTo_p[MRadialVelocity::N_Types][MRadialVelocity::N_Types]
Transition matrix.
Definition: MCRadialVelocity.h:152
casacore::MCRadialVelocity::LGROUP_BARY
@ LGROUP_BARY
Definition: MCRadialVelocity.h:129
casacore::Aberration
Definition: Aberration.h:110
casacore::MRadialVelocity::N_Types
@ N_Types
Definition: MRadialVelocity.h:161
casacore::CallOnce0
Wrapper around std::call_once.
Definition: Mutex.h:215
casacore::MCRadialVelocity::ABERFROM
Aberration * ABERFROM
Definition: MCRadialVelocity.h:145
casacore::MConvertBase
Definition: MConvertBase.h:147
casacore::MCBase::Routes
Routes
Each derived class should have a list of routines to be called:
Definition: MCBase.h:134
casacore::MCRadialVelocity::getConvert
virtual void getConvert(MConvertBase &mc, const MRBase &inref, const MRBase &outref)
Create conversion function pointer.