casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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>
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  virtual uInt type() const;
204  static void assure(const Measure &in);
205  // </group>
206  // Translate reference code. The uInt version has a check for valid codes
207  // (i.e. it is a safe cast).
208  // <thrown>
209  // <li> AipsError in the uInt interface if illegal code given
210  // </thrown>
211  // <group>
212  static Muvw::Types castType(uInt tp);
213  static const String &showType(Muvw::Types tp);
214  static const String &showType(uInt tp);
215  // </group>
216  // Translate string to reference code
217  // <group>
218  static Bool getType(Muvw::Types &tp, const String &in);
219  Bool giveMe(Muvw::Ref &mr, const String &in);
220  // </group>
221  // Set the offset in the reference (False if non-matching Measure)
222  virtual Bool setOffset(const Measure &in);
223  // Set the reference type to the specified String. False if illegal
224  // string, reference set to DEFAULT.
225  virtual Bool setRefString(const String &in);
226  // Get the default reference type
227  virtual const String &getDefaultType() const;
228  // Get a list of all known reference codes. nall returns the number in list,
229  // nextra the number of specials (like planets) that should be at
230  // end of list). typ returns the list of corresponding types.
231  // <group>
232  virtual const String* allTypes(Int &nall, Int &nextra,
233  const uInt *&typ) const;
234  static const String* allMyTypes(Int &nall, Int &nextra,
235  const uInt *&typ);
236  // </group>
237  // Check if all internal tables of types (both enum and String) are
238  // complete and correct. This function is called automatically if and when
239  // necessary.
240  // <thrown>
241  // <li> AipsError if a (programming) error in the types.
242  // </thrown>
243  // <group>
244  virtual void checkTypes() const;
245  static void checkMyTypes();
246  // </group>
247  // Get the correct Muvw type from a given direction type (or v.v.)
248  // <group>
249  static Muvw::Types fromDirType(const MDirection::Types in);
250  static MDirection::Types toDirType(const Muvw::Types in);
251  // </group>
252  // Get the reference type (for records, including codes like R_)
253  virtual String getRefString() const;
254  // Get my type (as Register)
255  static uInt myType();
256 
257  // Get Measure data
258  // <group>
259  Quantum<Vector<Double> > get(const Unit &inunit) const;
261  Quantum<Vector<Double> > getAngle(const Unit &inunit) const;
262  // </group>
263 
264  // Make copy
265  // <group>
266  virtual Measure *clone() const;
267  // </group>
268 
269  private:
270  //# Enumerations
271 
272  //# Data
273 
274  //# Member functions
275 
276 };
277 
278 
279 } //# NAMESPACE CASACORE - END
280 
281 #endif
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.
int Int
Definition: aipstype.h:50
virtual const String * allTypes(Int &nall, Int &nextra, const uInt *&typ) const
Get a list of all known reference codes.
Conversion of Measures.
Definition: MDirection.h:43
Muvw conversion routines.
Definition: MCuvw.h:85
Muvw & operator=(const Muvw &)
Bool giveMe(Muvw::Ref &mr, const String &in)
A Measure: uvw on Earth.
Definition: Muvw.h:115
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
Types
Types of known Muvws Warning: The order defines the order in the translation matrix FromTo in the ge...
Definition: Muvw.h:130
Base class for all measures.
Definition: MeasBase.h:75
Read only access to table array Measure columns.
Definition: MDirection.h:44
ScalarMeasColumn< Muvw > ScalarColumn
Measure table Columns (e.g., Muvw::ScalarColumn)
Definition: Muvw.h:170
virtual const String & getDefaultType() const
Get the default reference type.
Types
Types of known MDirections Warning: The order defines the order in the translation matrix FromTo in ...
Definition: MDirection.h:188
defines physical units
Definition: Unit.h:189
static const String & showMe()
virtual Bool setOffset(const Measure &in)
Set the offset in the reference (False if non-matching Measure)
Quantum< Vector< Double > > getAngle() const
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
virtual ~Muvw()
virtual const String & tellMe() const
Tell me your type.
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 uInt myType()
Get my type (as Register)
static MDirection::Types toDirType(const Muvw::Types in)
virtual Bool setRefString(const String &in)
Set the reference type to the specified String.
virtual uInt type() const
Get the type (== Register() of derived Measure (faster than Strings) All should have: static uInt myT...
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
static void checkMyTypes()
Quantities (i.e. dimensioned values)
Definition: QuantumHolder.h:44
Types
Each derived class should have a Types enumeration, specifying the recognised frame types...
Definition: Measure.h:254
static const String & showType(Muvw::Types tp)
Muvw()
Tip: In the following constructors and other functions, all MeasRef can be replaced with simple Meas...
virtual String getRefString() const
Get the reference type (for records, including codes like R_)
String: the storage and methods of handling collections of characters.
Definition: String.h:223
Read only access to table scalar Measure columns.
Definition: MDirection.h:45
virtual Measure * clone() const
Make copy.
Defaults.
Definition: Muvw.h:155
unsigned int uInt
Definition: aipstype.h:51
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42