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 
173  //# Constructors
174  // <note role=tip> In the following constructors and other functions, all
175  // <em>MeasRef</em> can be replaced with simple <src>Measure::TYPE</src>
176  // where no offsets or frames are needed in the reference. </note>
177  // Default constructor; generates the ITRF centre
178  Muvw();
179  // Create from data and reference
180  // <group>
181  Muvw(const MVuvw &dt);
182  Muvw(const MVuvw &dt, const Muvw::Ref &rf);
183  Muvw(const MVuvw &dt, Muvw::Types rf);
184  Muvw(const Measure *dt);
185  Muvw(const MeasValue *dt);
186  // </group>
187  // Copy constructor and assign
188  // <group>
189  Muvw(const Muvw &);
190  Muvw &operator=(const Muvw &);
191  // </group>
192 
193  //# Destructor
194  virtual ~Muvw();
195 
196  //# Operators
197 
198  //# General Member Functions
199  // Tell me your type
200  // <group>
201  virtual const String &tellMe() const;
202  static const String &showMe();
203  static void assure(const Measure &in);
204  // </group>
205  // Translate reference code. The uInt version has a check for valid codes
206  // (i.e. it is a safe cast).
207  // <thrown>
208  // <li> AipsError in the uInt interface if illegal code given
209  // </thrown>
210  // <group>
212  static const String &showType(Muvw::Types tp);
213  static const String &showType(uInt tp);
214  // </group>
215  // Translate string to reference code
216  // <group>
217  static Bool getType(Muvw::Types &tp, const String &in);
218  Bool giveMe(Muvw::Ref &mr, const String &in);
219  // </group>
220  // Set the offset in the reference (False if non-matching Measure)
221  virtual Bool setOffset(const Measure &in);
222  // Set the reference type to the specified String. False if illegal
223  // string, reference set to DEFAULT.
224  virtual Bool setRefString(const String &in);
225  // Get the default reference type
226  virtual const String &getDefaultType() const;
227  // Get a list of all known reference codes. nall returns the number in list,
228  // nextra the number of specials (like planets) that should be at
229  // end of list). typ returns the list of corresponding types.
230  // <group>
231  virtual const String* allTypes(Int &nall, Int &nextra,
232  const uInt *&typ) const;
233  static const String* allMyTypes(Int &nall, Int &nextra,
234  const uInt *&typ);
235  // </group>
236  // Check if all internal tables of types (both enum and String) are
237  // complete and correct. This function is called automatically if and when
238  // necessary.
239  // <thrown>
240  // <li> AipsError if a (programming) error in the types.
241  // </thrown>
242  // <group>
243  virtual void checkTypes() const;
244  static void checkMyTypes();
245  // </group>
246  // Get the correct Muvw type from a given direction type (or v.v.)
247  // <group>
250  // </group>
251  // Get the reference type (for records, including codes like R_)
252  virtual String getRefString() const;
253 
254  // Get Measure data
255  // <group>
256  Quantum<Vector<Double> > get(const Unit &inunit) const;
258  Quantum<Vector<Double> > getAngle(const Unit &inunit) const;
259  // </group>
260 
261  // Make copy
262  // <group>
263  virtual Measure *clone() const;
264  // </group>
265 
266  private:
267  //# Enumerations
268 
269  //# Data
270 
271  //# Member functions
272 
273 };
274 
275 
276 } //# NAMESPACE CASACORE - END
277 
278 #endif
Types
Types of known MDirections Warning: The order defines the order in the translation matrix FromTo in ...
Definition: MDirection.h:188
Types
Each derived class should have a Types enumeration, specifying the recognised frame types.
Definition: Measure.h:254
Muvw(const MVuvw &dt, const Muvw::Ref &rf)
Muvw(const Measure *dt)
MeasConvert< Muvw > Convert
MeasConvert use (i.e.
Definition: Muvw.h:168
static void checkMyTypes()
static const String & showMe()
ArrayMeasColumn< Muvw > ArrayColumn
Definition: Muvw.h:171
virtual const String & getDefaultType() const
Get the default reference type.
Muvw(const Muvw &)
Copy constructor and assign.
virtual String getRefString() const
Get the reference type (for records, including codes like R_)
virtual const String & tellMe() const
Tell me your type.
static Muvw::Types castType(uInt tp)
Translate reference code.
virtual void checkTypes() const
Check if all internal tables of types (both enum and String) are complete and correct.
virtual Bool setOffset(const Measure &in)
Set the offset in the reference (False if non-matching Measure)
MeasRef< Muvw > Ref
Measure reference (i.e.
Definition: Muvw.h:166
Quantum< Vector< Double > > get(const Unit &inunit) const
Get Measure data.
Types
Types of known Muvws Warning: The order defines the order in the translation matrix FromTo in the ge...
Definition: Muvw.h:130
@ DEFAULT
Defaults.
Definition: Muvw.h:155
@ AZELNE
Synonyms.
Definition: Muvw.h:157
MCuvw MCType
Measure conversion routines for this class (i.e.
Definition: Muvw.h:164
Muvw()
Tip: In the following constructors and other functions, all MeasRef can be replaced with simple Measu...
ScalarMeasColumn< Muvw > ScalarColumn
Measure table Columns (e.g., Muvw::ScalarColumn)
Definition: Muvw.h:170
Quantum< Vector< Double > > getAngle(const Unit &inunit) const
static const String & showType(Muvw::Types tp)
virtual Measure * clone() const
Make copy.
Quantum< Vector< Double > > getAngle() const
static const String & showType(uInt tp)
virtual Bool setRefString(const String &in)
Set the reference type to the specified String.
Muvw(const MeasValue *dt)
static void assure(const Measure &in)
Muvw(const MVuvw &dt)
Create from data and reference.
static Bool getType(Muvw::Types &tp, const String &in)
Translate string to reference code.
static const String * allMyTypes(Int &nall, Int &nextra, const uInt *&typ)
Muvw(const MVuvw &dt, Muvw::Types rf)
Bool giveMe(Muvw::Ref &mr, const String &in)
virtual const String * allTypes(Int &nall, Int &nextra, const uInt *&typ) const
Get a list of all known reference codes.
Muvw & operator=(const Muvw &)
virtual ~Muvw()
MVuvw MVType
Measure value container for this class (i.e.
Definition: Muvw.h:162
static Muvw::Types fromDirType(const MDirection::Types in)
Get the correct Muvw type from a given direction type (or v.v.)
static MDirection::Types toDirType(const Muvw::Types in)
String: the storage and methods of handling collections of characters.
Definition: String.h:225
this file contains all the compiler specific defines
Definition: mainpage.dox:28
unsigned int uInt
Definition: aipstype.h:51
int Int
Definition: aipstype.h:50
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42