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