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