casacore
Muvw.h
Go to the documentation of this file.
1 //# Muvw.h: A Measure: uvw on Earth
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_MUVW_H
30 #define MEASURES_MUVW_H
31 
32 //# Includes
33 #include <casacore/casa/aips.h>
34 #include <casacore/measures/Measures/MeasBase.h>
35 #include <casacore/measures/Measures/MDirection.h>
36 #include <casacore/measures/Measures/MeasRef.h>
37 #include <casacore/casa/Quanta/MVuvw.h>
38 
39 namespace casacore { //# NAMESPACE CASACORE - BEGIN
40 
41 //# Forward Declarations
42 class Muvw;
43 class MCuvw;
44 class MDirection;
45 template <class M> class MeasConvert;
46 template <class M> class ArrayMeasColumn;
47 template <class M> class ScalarMeasColumn;
48 
49 //# Typedefs
50 
51 // <summary> A Measure: uvw on Earth </summary>
52 
53 // <use visibility=export>
54 
55 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="tMuvw" demos="">
56 // </reviewed>
57 
58 // <prerequisite>
59 // <li> <linkto class=Measure>Measure</linkto> class
60 // </prerequisite>
61 //
62 // <etymology>
63 // From Measure and uvw
64 // </etymology>
65 //
66 // <synopsis>
67 // Muvw is the derived Measure class for an interferometer uvw.
68 // uvws can be given in any of the direction types, or as ITRF, the
69 // IERS base.<br>
70 // Note that at the moment no correction for Earth tides (error <~ 0.05 mm/km
71 // EW uvw), plate motion (not relevant for telescopes on same plate) and
72 // relativistic effects are incorporated. B1950 has the same caveat as in
73 // <linkto class=MDirection>MDirection</linkto>.
74 // </synopsis>
75 //
76 // <example>
77 // <srcblock>
78 // // Specify an Epoch and a telescope position
79 // MEpoch tbm(Quantity(50927.92931, "d"));
80 // MPosition pos(MVPosition(-4750915.84032, 2792906.17778,
81 // -3200483.75028),
82 // MPosition::ITRF);
83 // // Use them in a frame
84 // MeasFrame mf(tbm, pos);
85 // // Specify an uvw (note that values here are in m)
86 // MVuvw mvb0(100 ,10, 0);
87 // cout << "uvw: " << mvb0 << endl;
88 // // Specify a reference (type and where and when) for the following uvw
89 // Muvw::Ref mbref0(Muvw::ITRF, mf);
90 // Muvw mb0(mvb0, mbref0);
91 // // Show the uvw
92 // cout << "uvw: " << mb0 << endl;
93 // cout << "uvw reference: " << mbref0 << endl;
94 // // Another reference
95 // Muvw::Ref mbref1(Muvw::J2000);
96 // cout << "uvw reference: " << mbref1 << endl;
97 // // Convert the uvw coordinates to the other reference and show it
98 // cout << "Test uvw conversion ..." << endl;
99 // Muvw::Convert bconv(mb0, mbref1);
100 // cout << "Converted " << mb0 << endl <<
101 // " to " << mbref1 << endl <<
102 // " as " << bconv() << endl;
103 // </srcblock>
104 // </example>
105 //
106 // <motivation>
107 // To be able to handle conversions between uvw coordinates with different
108 // reference directions.
109 // </motivation>
110 //
111 // <todo asof="2000/11/08">
112 // <li> EW baselines
113 // </todo>
114 
115 class Muvw : public MeasBase<MVuvw, MeasRef<Muvw> > {
116 
117 public:
118  //# Friends
119  // Conversion of data
120  friend class MeasConvert<Muvw>;
121 
122  //# Enumerations
123  // Types of known Muvws
124  // <note role=warning>
125  // The order defines the order in the translation matrix FromTo
126  // in the getConvert routine. Do not change the order without
127  // changing the array. Additions should be made before N_types, and
128  // an additional row and column should be coded in FromTo, and
129  // in showType().</note>
130  enum Types {
154  // Defaults
156  // Synonyms
159 
160  //# Typedefs
161  // Measure value container for this class (i.e. Muvw::MVType)
162  typedef MVuvw MVType;
163  // Measure conversion routines for this class (i.e. Muvw::MCType)
164  typedef MCuvw MCType;
165  // Measure reference (i.e. Muvw::Ref)
167  // MeasConvert use (i.e. Muvw::Convert)
169  // Measure table Columns (e.g., Muvw::ScalarColumn)
172  // Reference enum Types (included originally for gcc 2.95)
173  typedef WHATEVER_SUN_TYPEDEF(Muvw) Types Types;
174 
175  //# Constructors
176  // <note role=tip> In the following constructors and other functions, all
177  // <em>MeasRef</em> can be replaced with simple <src>Measure::TYPE</src>
178  // where no offsets or frames are needed in the reference. </note>
179  // Default constructor; generates the ITRF centre
180  Muvw();
181  // Create from data and reference
182  // <group>
183  Muvw(const MVuvw &dt);
184  Muvw(const MVuvw &dt, const Muvw::Ref &rf);
185  Muvw(const MVuvw &dt, Muvw::Types rf);
186  Muvw(const Measure *dt);
187  Muvw(const MeasValue *dt);
188  // </group>
189  // Copy constructor and assign
190  // <group>
191  Muvw(const Muvw &);
192  Muvw &operator=(const Muvw &);
193  // </group>
194 
195  //# Destructor
196  virtual ~Muvw();
197 
198  //# Operators
199 
200  //# General Member Functions
201  // Tell me your type
202  // <group>
203  virtual const String &tellMe() const;
204  static const String &showMe();
205  virtual uInt type() const;
206  static void assure(const Measure &in);
207  // </group>
208  // Translate reference code. The uInt version has a check for valid codes
209  // (i.e. it is a safe cast).
210  // <thrown>
211  // <li> AipsError in the uInt interface if illegal code given
212  // </thrown>
213  // <group>
214  static Muvw::Types castType(uInt tp);
215  static const String &showType(Muvw::Types tp);
216  static const String &showType(uInt tp);
217  // </group>
218  // Translate string to reference code
219  // <group>
220  static Bool getType(Muvw::Types &tp, const String &in);
221  Bool giveMe(Muvw::Ref &mr, const String &in);
222  // </group>
223  // Set the offset in the reference (False if non-matching Measure)
224  virtual Bool setOffset(const Measure &in);
225  // Set the reference type to the specified String. False if illegal
226  // string, reference set to DEFAULT.
227  virtual Bool setRefString(const String &in);
228  // Get the default reference type
229  virtual const String &getDefaultType() const;
230  // Get a list of all known reference codes. nall returns the number in list,
231  // nextra the number of specials (like planets) that should be at
232  // end of list). typ returns the list of corresponding types.
233  // <group>
234  virtual const String* allTypes(Int &nall, Int &nextra,
235  const uInt *&typ) const;
236  static const String* allMyTypes(Int &nall, Int &nextra,
237  const uInt *&typ);
238  // </group>
239  // Check if all internal tables of types (both enum and String) are
240  // complete and correct. This function is called automatically if and when
241  // necessary.
242  // <thrown>
243  // <li> AipsError if a (programming) error in the types.
244  // </thrown>
245  // <group>
246  virtual void checkTypes() const;
247  static void checkMyTypes();
248  // </group>
249  // Get the correct Muvw type from a given direction type (or v.v.)
250  // <group>
251  static Muvw::Types fromDirType(const MDirection::Types in);
252  static MDirection::Types toDirType(const Muvw::Types in);
253  // </group>
254  // Get the reference type (for records, including codes like R_)
255  virtual String getRefString() const;
256  // Get my type (as Register)
257  static uInt myType();
258 
259  // Get Measure data
260  // <group>
261  Quantum<Vector<Double> > get(const Unit &inunit) const;
262  Quantum<Vector<Double> > getAngle() const;
263  Quantum<Vector<Double> > getAngle(const Unit &inunit) const;
264  // </group>
265 
266  // Make copy
267  // <group>
268  virtual Measure *clone() const;
269  // </group>
270 
271  private:
272  //# Enumerations
273 
274  //# Data
275 
276  //# Member functions
277 
278 };
279 
280 
281 } //# NAMESPACE CASACORE - END
282 
283 #endif
static Muvw::Types castType(uInt tp)
Translate reference code.
A Measure: astronomical direction.
Definition: MDirection.h:174
A 1-D Specialization of the Array class.
Definition: ArrayIO.h:45
int Int
Definition: aipstype.h:50
Quantum< Vector< Double > > get(const Unit &inunit) const
Get Measure data.
Conversion of Measures.
Definition: MBaseline.h:44
virtual const String * allTypes(Int &nall, Int &nextra, const uInt *&typ) const
Get a list of all known reference codes.
virtual const String & getDefaultType() const
Get the default reference type.
Muvw conversion routines.
Definition: MCuvw.h:85
Bool giveMe(Muvw::Ref &mr, const String &in)
typedef WHATEVER_SUN_TYPEDEF(Muvw) Types Types
Reference enum Types (included originally for gcc 2.95)
virtual String getRefString() const
Get the reference type (for records, including codes like R_)
MeasConvert< Muvw > Convert
MeasConvert use (i.e.
Definition: Muvw.h:168
Physical quantities within reference frame.
Definition: Measure.h:235
MCuvw MCType
Measure conversion routines for this class (i.e.
Definition: Muvw.h:164
MeasRef< Muvw > Ref
Measure reference (i.e.
Definition: Muvw.h:166
Base class for all measures.
Definition: MeasBase.h:75
Read only access to table array Measure columns.
Definition: MBaseline.h:45
ScalarMeasColumn< Muvw > ScalarColumn
Measure table Columns (e.g., Muvw::ScalarColumn)
Definition: Muvw.h:170
virtual const String & tellMe() const
Tell me your type.
defines physical units
Definition: Unit.h:189
virtual Bool setOffset(const Measure &in)
Set the offset in the reference (False if non-matching Measure)
static const String * allMyTypes(Int &nall, Int &nextra, const uInt *&typ)
Base class for values in a Measure.
Definition: MeasValue.h:107
static Bool getType(Muvw::Types &tp, const String &in)
Translate string to reference code.
MVuvw MVType
Measure value container for this class (i.e.
Definition: Muvw.h:162
Synonyms.
Definition: Muvw.h:157
double Double
Definition: aipstype.h:55
virtual Measure * clone() const
Make copy.
static Muvw::Types fromDirType(const MDirection::Types in)
Get the correct Muvw type from a given direction type (or v.v.)
ArrayMeasColumn< Muvw > ArrayColumn
Definition: Muvw.h:171
static MDirection::Types toDirType(const Muvw::Types in)
virtual Bool setRefString(const String &in)
Set the reference type to the specified String.
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
static void assure(const Measure &in)
A 3D vector on Earth.
Definition: MVuvw.h:110
Quantities (i.e. dimensioned values)
Definition: MeasValue.h:40
virtual uInt type() const
Get the type (== Register() of derived Measure (faster than Strings) All should have: static uInt myT...
static const String & showType(Muvw::Types tp)
String: the storage and methods of handling collections of characters.
Definition: String.h:223
Read only access to table scalar Measure columns.
Definition: MBaseline.h:46
Quantum< Vector< Double > > getAngle() const
Defaults.
Definition: Muvw.h:155
virtual void checkTypes() const
Check if all internal tables of types (both enum and String) are complete and correct.
this file contains all the compiler specific defines
Definition: mainpage.dox:28
unsigned int uInt
Definition: aipstype.h:51