casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MCuvw.h
Go to the documentation of this file.
1 //# MCuvw.h: Muvw conversion routines
2 //# Copyright (C) 1998-2000,2002,2004,2007
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_MCUVW_H
30 #define MEASURES_MCUVW_H
31 
32 //# Includes
33 #include <casacore/casa/aips.h>
41 #include <casacore/casa/OS/Mutex.h>
42 
43 namespace casacore { //# NAMESPACE CASACORE - BEGIN
44 
45 //# Forward Declarations
46 class MCuvw;
47 class String;
48 template <class T> class Vector;
49 
50 //# Typedefs
51 
52 // <summary> Muvw conversion routines </summary>
53 
54 // <use visibility=local>
55 
56 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="tMuvw" demos="">
57 // </reviewed>
58 
59 // <prerequisite>
60 // <li> <linkto class=Measure>Measure</linkto> class
61 // <li> <linkto class=MCBase>MCBase</linkto> base class
62 // <li> <linkto class=MConvertBase>overall conversion</linkto> class
63 // </prerequisite>
64 //
65 // <etymology>
66 // Measure, Convert and uvw
67 // </etymology>
68 //
69 // <synopsis>
70 // Contains state machinery and caching for actual conversions
71 // </synopsis>
72 //
73 // <example>
74 // See <linkto module=Measures>Measures</linkto> module description for
75 // conversion examples.
76 // </example>
77 //
78 // <motivation>
79 // </motivation>
80 //
81 // <todo asof="1998/04/21">
82 // <li> Cater for EW baselines
83 // </todo>
84 
85 class MCuvw : public MCBase {
86 
87 public:
88 
89  //# Friends
90  // Conversion of data
91  friend class MeasConvert<Muvw>;
92 
93  //# Constructors
94  // Default constructor
95  MCuvw();
96 
97  //# Destructor
98  ~MCuvw();
99 
100  //# Member functions
101  // Show the state of the conversion engine (mainly for debugging purposes)
102  static String showState();
103 
104 private:
105  //# Enumerations
106  // The list of actual routines provided.
107  // <note role=warning> Each <src>AA_BB</src> in the list points to routine
108  // that can be used in the FromTo list in the getConvert routine.
109  // In addition the type to which each is converted should be in the
110  // ToRef array, again in the proper order. </note>
111  enum Routes {
161  };
162 
163  //# Typedefs
164 
165  //# Operators
166 
167  //# General Member Functions
168 
169  //# Enumerations
170 
171  //# Cached Data
172  // Calculation class
174  // Belonging direction
176 
177  //# State machine data
178  // Transition list
179  static uInt ToRef_p[N_Routes][3];
180  // Transition matrix
182  // Object to ensure safe multi-threaded lazy single initialization
184 
185  //# Constructors
186  // Copy constructor (not implemented)
187  MCuvw(const MCuvw &other);
188  // Assignment (not implemented)
189  MCuvw &operator=(const MCuvw &other);
190 
191  //# Member functions
192 
193  // Create conversion function pointer
194  virtual void getConvert(MConvertBase &mc,
195  const MRBase &inref,
196  const MRBase &outref);
197 
198  // Create help structures for Measure conversion routines
199  virtual void initConvert(uInt which, MConvertBase &mc);
200 
201  // Delete the pointers used in the MeasConvert help structure cache
202  virtual void clearConvert();
203 
204  // Routines to convert uvws from one reference frame to another
205  virtual void doConvert(MeasValue &in,
206  MRBase &inref,
207  MRBase &outref,
208  const MConvertBase &mc);
209  // Conversion routine to cater for inheritance question
210  void doConvert(MVuvw &in,
211  MRBase &inref,
212  MRBase &outref,
213  const MConvertBase &mc);
214  // Get the correct belonging direction from the frame
215  // <group>
216  void getAPP();
217  void getJ2000();
218  void getB1950();
219  // </group>
220  // Rotate from direction to pole
221  void toPole(MVPosition &in);
222  // Rotate from pole to direction
223  void fromPole(MVPosition &in);
224 
225 private:
226  // Fill the global state. Called using theirInitOnce.
227  static void doFillState();
228 };
229 
230 
231 } //# NAMESPACE CASACORE - END
232 
233 #endif
234 
Wrapper around std::call_once.
Definition: Mutex.h:214
static String showState()
Show the state of the conversion engine (mainly for debugging purposes)
virtual void initConvert(uInt which, MConvertBase &mc)
Create help structures for Measure conversion routines.
Conversion of Measures.
Definition: MDirection.h:43
std::vector< double > Vector
Definition: ds9context.h:24
static CallOnce0 theirInitOnce
Object to ensure safe multi-threaded lazy single initialization.
Definition: MCuvw.h:183
Base for Reference frame for physical measures.
Definition: MRBase.h:103
Muvw conversion routines.
Definition: MCuvw.h:85
Base for specific measure conversions.
Definition: MCBase.h:119
virtual void clearConvert()
Delete the pointers used in the MeasConvert help structure cache.
void toPole(MVPosition &in)
Rotate from direction to pole.
A Measure: uvw on Earth.
Definition: Muvw.h:115
Measure conversion aid routines.
Definition: MeasMath.h:96
MVDirection MVDIR1
Belonging direction.
Definition: MCuvw.h:175
virtual void doConvert(MeasValue &in, MRBase &inref, MRBase &outref, const MConvertBase &mc)
Routines to convert uvws from one reference frame to another.
MeasMath measMath
Calculation class.
Definition: MCuvw.h:173
MCuvw & operator=(const MCuvw &other)
Assignment (not implemented)
static void doFillState()
Fill the global state.
Base class for values in a Measure.
Definition: MeasValue.h:107
void fromPole(MVPosition &in)
Rotate from pole to direction.
A 3D vector in space.
Definition: MVPosition.h:113
A 3D vector on Earth.
Definition: MVuvw.h:110
Routes
The list of actual routines provided.
Definition: MCuvw.h:111
static uInt FromTo_p[Muvw::N_Types][Muvw::N_Types]
Transition matrix.
Definition: MCuvw.h:181
String: the storage and methods of handling collections of characters.
Definition: String.h:223
static uInt ToRef_p[N_Routes][3]
Transition list.
Definition: MCuvw.h:179
Vector of three direction cosines.
Definition: MVDirection.h:106
MCuvw()
Default constructor.
void getAPP()
Get the correct belonging direction from the frame.
virtual void getConvert(MConvertBase &mc, const MRBase &inref, const MRBase &outref)
Create conversion function pointer.
unsigned int uInt
Definition: aipstype.h:51
Conversion of Measures Base.
Definition: MConvertBase.h:147
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42