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  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>
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>
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
casacore::Muvw::GALACTIC
@ GALACTIC
Definition: Muvw.h:139
casacore::Measure::Types
Types
Each derived class should have a Types enumeration, specifying the recognised frame types.
Definition: Measure.h:254
casacore::Muvw::N_Types
@ N_Types
Definition: Muvw.h:153
casacore::Muvw::B1950
@ B1950
Definition: Muvw.h:135
casacore::Muvw::MVType
MVuvw MVType
Measure value container for this class (i.e.
Definition: Muvw.h:162
casacore::Muvw::type
virtual uInt type() const
Get the type (== Register() of derived Measure (faster than Strings) All should have: static uInt myT...
casacore::Muvw::B1950_VLA
@ B1950_VLA
Definition: Muvw.h:136
casacore::Muvw::Muvw
Muvw(const MeasValue *dt)
casacore::Muvw::Muvw
Muvw()
Tip: In the following constructors and other functions, all MeasRef can be replaced with simple Measu...
casacore::Measure
Physical quantities within reference frame.
Definition: Measure.h:235
casacore::Muvw::MECLIPTIC
@ MECLIPTIC
Definition: Muvw.h:147
casacore::Muvw::checkMyTypes
static void checkMyTypes()
casacore::Muvw::~Muvw
virtual ~Muvw()
casacore::Muvw::toDirType
static MDirection::Types toDirType(const Muvw::Types in)
casacore::Muvw::getAngle
Quantum< Vector< Double > > getAngle() const
casacore::MeasValue
Base class for values in a Measure.
Definition: MeasValue.h:107
casacore::Muvw::AZELSW
@ AZELSW
Definition: Muvw.h:142
casacore::Muvw::TOPO
@ TOPO
Definition: Muvw.h:151
casacore::Muvw::AZELNE
@ AZELNE
Synonyms.
Definition: Muvw.h:157
casacore::Muvw::checkTypes
virtual void checkTypes() const
Check if all internal tables of types (both enum and String) are complete and correct.
casacore::Muvw::showType
static const String & showType(uInt tp)
casacore::Muvw::showType
static const String & showType(Muvw::Types tp)
casacore::Muvw
A Measure: uvw on Earth.
Definition: Muvw.h:115
casacore::MCuvw
Muvw conversion routines
Definition: MCuvw.h:85
casacore::Muvw::allTypes
virtual const String * allTypes(Int &nall, Int &nextra, const uInt *&typ) const
Get a list of all known reference codes.
casacore::Muvw::castType
static Muvw::Types castType(uInt tp)
Translate reference code.
casacore::ArrayMeasColumn
Read only access to table array Measure columns.
Definition: MBaseline.h:45
casacore::Muvw::get
Quantum< Vector< Double > > get(const Unit &inunit) const
Get Measure data.
casacore::uInt
unsigned int uInt
Definition: aipstype.h:51
casacore::Muvw::BTRUE
@ BTRUE
Definition: Muvw.h:138
casacore::Muvw::JNAT
@ JNAT
Definition: Muvw.h:145
casacore::MeasConvert
Conversion of Measures.
Definition: MBaseline.h:44
casacore::Muvw::AZELGEO
@ AZELGEO
Definition: Muvw.h:143
casacore::MDirection
A Measure: astronomical direction.
Definition: MDirection.h:174
casacore::Muvw::ICRS
@ ICRS
Definition: Muvw.h:152
casacore::Muvw::JTRUE
@ JTRUE
Definition: Muvw.h:133
casacore::Muvw::Muvw
Muvw(const MVuvw &dt, const Muvw::Ref &rf)
casacore::Int
int Int
Definition: aipstype.h:50
casacore
this file contains all the compiler specific defines
Definition: mainpage.dox:28
casacore::Muvw::Muvw
Muvw(const MVuvw &dt)
Create from data and reference.
casacore::Muvw::APP
@ APP
Definition: Muvw.h:134
casacore::Muvw::SUPERGAL
@ SUPERGAL
Definition: Muvw.h:149
casacore::Muvw::giveMe
Bool giveMe(Muvw::Ref &mr, const String &in)
casacore::Muvw::AZELNEGEO
@ AZELNEGEO
Definition: Muvw.h:158
casacore::Muvw::getDefaultType
virtual const String & getDefaultType() const
Get the default reference type.
casacore::Muvw::Muvw
Muvw(const Muvw &)
Copy constructor and assign.
casacore::Muvw::JMEAN
@ JMEAN
Definition: Muvw.h:132
casacore::Muvw::BMEAN
@ BMEAN
Definition: Muvw.h:137
casacore::Muvw::MCType
MCuvw MCType
Measure conversion routines for this class (i.e.
Definition: Muvw.h:164
casacore::Muvw::TECLIPTIC
@ TECLIPTIC
Definition: Muvw.h:148
casacore::MVuvw
A 3D vector on Earth.
Definition: MVuvw.h:110
casacore::Muvw::ECLIPTIC
@ ECLIPTIC
Definition: Muvw.h:146
casacore::Muvw::AZEL
@ AZEL
Definition: Muvw.h:141
casacore::Muvw::HADEC
@ HADEC
Definition: Muvw.h:140
casacore::Muvw::showMe
static const String & showMe()
casacore::Muvw::Convert
MeasConvert< Muvw > Convert
MeasConvert use (i.e.
Definition: Muvw.h:168
casacore::Muvw::Ref
MeasRef< Muvw > Ref
Measure reference (i.e.
Definition: Muvw.h:166
casacore::Muvw::operator=
Muvw & operator=(const Muvw &)
casacore::Muvw::getRefString
virtual String getRefString() const
Get the reference type (for records, including codes like R_)
casacore::Muvw::Types
Types
Types of known Muvws Warning: The order defines the order in the translation matrix FromTo in the ge...
Definition: Muvw.h:130
casacore::Muvw::DEFAULT
@ DEFAULT
Defaults.
Definition: Muvw.h:155
casacore::Muvw::tellMe
virtual const String & tellMe() const
Tell me your type.
casacore::MeasBase
Base class for all measures.
Definition: MeasBase.h:75
casacore::String
String: the storage and methods of handling collections of characters.
Definition: String.h:223
casacore::Muvw::getType
static Bool getType(Muvw::Types &tp, const String &in)
Translate string to reference code.
casacore::Muvw::Muvw
Muvw(const Measure *dt)
casacore::ScalarMeasColumn
Read only access to table scalar Measure columns.
Definition: MBaseline.h:46
casacore::Muvw::AZELSWGEO
@ AZELSWGEO
Definition: Muvw.h:144
casacore::Bool
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
casacore::MDirection::Types
Types
Types of known MDirections Warning: The order defines the order in the translation matrix FromTo in ...
Definition: MDirection.h:188
casacore::Unit
defines physical units
Definition: Unit.h:189
casacore::Muvw::ScalarColumn
ScalarMeasColumn< Muvw > ScalarColumn
Measure table Columns (e.g., Muvw::ScalarColumn)
Definition: Muvw.h:170
casacore::Muvw::getAngle
Quantum< Vector< Double > > getAngle(const Unit &inunit) const
casacore::MeasRef< Muvw >
casacore::Muvw::allMyTypes
static const String * allMyTypes(Int &nall, Int &nextra, const uInt *&typ)
casacore::Muvw::fromDirType
static Muvw::Types fromDirType(const MDirection::Types in)
Get the correct Muvw type from a given direction type (or v.v.)
casacore::Muvw::J2000
@ J2000
Definition: Muvw.h:131
casacore::Muvw::ArrayColumn
ArrayMeasColumn< Muvw > ArrayColumn
Definition: Muvw.h:171
casacore::Muvw::myType
static uInt myType()
Get my type (as Register)
casacore::Quantum
Quantities (i.e. dimensioned values)
Definition: MeasValue.h:40
casacore::Muvw::setRefString
virtual Bool setRefString(const String &in)
Set the reference type to the specified String.
casacore::Muvw::setOffset
virtual Bool setOffset(const Measure &in)
Set the offset in the reference (False if non-matching Measure)
casacore::Muvw::assure
static void assure(const Measure &in)
casacore::Muvw::Muvw
Muvw(const MVuvw &dt, Muvw::Types rf)
casacore::Muvw::clone
virtual Measure * clone() const
Make copy.
casacore::Muvw::ITRF
@ ITRF
Definition: Muvw.h:150