casacore
MBaseline.h
Go to the documentation of this file.
1 //# MBaseline.h: A Measure: Baseline 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_MBASELINE_H
30 #define MEASURES_MBASELINE_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/MVBaseline.h>
38 
39 namespace casacore { //# NAMESPACE CASACORE - BEGIN
40 
41 //# Forward Declarations
42 class MBaseline;
43 class MCBaseline;
44 template <class M> class MeasConvert;
45 template <class M> class ArrayMeasColumn;
46 template <class M> class ScalarMeasColumn;
47 
48 //# Typedefs
49 
50 // <summary> A Measure: Baseline on Earth </summary>
51 
52 // <use visibility=export>
53 
54 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="tMBaseline" demos="">
55 // </reviewed>
56 
57 // <prerequisite>
58 // <li> <linkto class=Measure>Measure</linkto> class
59 // </prerequisite>
60 //
61 // <etymology>
62 // From Measure and Baseline
63 // </etymology>
64 //
65 // <synopsis>
66 // MBaseline forms derived Measure class for an interferometer baseline.
67 // Baselines can be given in any of the direction types, or as ITRF, the
68 // IERS base.<br>
69 // Note that at the moment no correction for Earth tides (error <~ 0.05 mm/km
70 // EW baseline), plate motion (not relevant for telescopes on same plate) and
71 // relativistic effects are incorporated. B1950 has the same caveat as in
72 // <linkto class=MDirection>MDirection</linkto>.
73 // </synopsis>
74 //
75 // <example>
76 // </example>
77 //
78 // <motivation>
79 // </motivation>
80 //
81 // <todo asof="2000/06/15">
82 // <li> add some Earth tide model
83 // </todo>
84 
85 class MBaseline : public MeasBase<MVBaseline, MeasRef<MBaseline> > {
86 
87  public:
88  //# Friends
89  // Conversion of data
90  friend class MeasConvert<MBaseline>;
91 
92  //# Enumerations
93  // Types of known MBaselines
94  // <note role=warning>
95  // The order defines the order in the translation matrix FromTo
96  // in the getConvert routine. Do not change the order without
97  // changing the array. Additions should be made before N_types, and
98  // an additional row and column should be coded in FromTo, and
99  // in showType().</note>
100  enum Types {
124  // Defaults
126  // Synonyms
129 
130  //# Typedefs
131  // Measure value container for this class (i.e. MBaseline::MVType)
133  // Measure conversion routines for this class (i.e. MBaseline::MCType)
135  // Measure reference (i.e. MBaseline::Ref)
137  // Measure Convert (i.e. MBaseline::Convert)
139  // Measure table Columns (e.g., MBaseline::ScalarColumn)
142  // Reference enum Types (included originally for gcc 2.95)
143  typedef WHATEVER_SUN_TYPEDEF(MBaseline) Types Types;
144 
145 //# Constructors
146 // <note role=tip> In the following constructors and other functions, all
147 // <em>MeasRef</em> can be replaced with simple <src>Measure::TYPE</src>
148 // where no offsets or frames are needed in the reference. </note>
149 // Default constructor; generates the ITRF centre
150  MBaseline();
151 // Create from data and reference
152 // <group>
153  MBaseline(const MVBaseline &dt);
154  MBaseline(const MVBaseline &dt, const MBaseline::Ref &rf);
155  MBaseline(const MVBaseline &dt, MBaseline::Types rf);
156  MBaseline(const Measure *dt);
157  MBaseline(const MeasValue *dt);
158 // </group>
159 
160  // <group>
161  MBaseline(const MBaseline &);
162  MBaseline &operator=(const MBaseline &);
163  // </group>
164 
165 //# Destructor
166  virtual ~MBaseline();
167 
168 //# Operators
169 
170 //# General Member Functions
171 // Tell me your type
172 // <group>
173  virtual const String &tellMe() const;
174  static const String &showMe();
175  virtual uInt type() const;
176  static void assure(const Measure &in);
177 // </group>
178  // Translate reference code. The uInt version has a check for valid codes
179  // (i.e. it is a safe cast).
180  // <thrown>
181  // <li> AipsError in the uInt interface if illegal code given
182  // </thrown>
183  // <group>
184  static MBaseline::Types castType(uInt tp);
185  static const String &showType(MBaseline::Types tp);
186  static const String &showType(uInt tp);
187  // </group>
188  // Translate string to reference code
189  // <group>
190  static Bool getType(MBaseline::Types &tp, const String &in);
191  Bool giveMe(MBaseline::Ref &mr, const String &in);
192 // </group>
193  // Set the offset in the reference (False if non-matching Measure)
194  virtual Bool setOffset(const Measure &in);
195  // Set the reference type to the specified String. False if illegal
196  // string, reference set to DEFAULT.
197  virtual Bool setRefString(const String &in);
198  // Get the default reference type
199  virtual const String &getDefaultType() const;
200  // Get a list of all known reference codes. nall returns the number in list,
201  // nextra the number of specials (like planets) that should be at
202  // end of list). typ returns the list of corresponding types.
203  // <group>
204  virtual const String* allTypes(Int &nall, Int &nextra,
205  const uInt *&typ) const;
206  static const String* allMyTypes(Int &nall, Int &nextra,
207  const uInt *&typ);
208  // </group>
209  // Check if all internal tables of types (both enum and String) are
210  // complete and correct. This function is called automatically if and when
211  // necessary.
212  // <thrown>
213  // <li> AipsError if a (programming) error in the types.
214  // </thrown>
215  // <group>
216  virtual void checkTypes() const;
217  static void checkMyTypes();
218  // </group>
219  // Get the correct MBaseline type from a given direction type (or v.v.)
220  // <group>
221  static MBaseline::Types fromDirType(const MDirection::Types in);
222  static MDirection::Types toDirType(const MBaseline::Types in);
223  // </group>
224  // Get the reference type (for records, including codes like R_)
225  virtual String getRefString() const;
226  // Get my type (as Register)
227  static uInt myType();
228 
229 // Get Measure data
230 // <group>
231  Quantum<Vector<Double> > get(const Unit &inunit) const;
232  Quantum<Vector<Double> > getAngle() const;
233  Quantum<Vector<Double> > getAngle(const Unit &inunit) const;
234 // </group>
235 
236 // Make copy
237 // <group>
238  virtual Measure *clone() const;
239 // </group>
240 
241 private:
242 //# Enumerations
243 
244 //# Data
245 
246 //# Member functions
247 
248 };
249 
250 
251 } //# NAMESPACE CASACORE - END
252 
253 #endif
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:47
virtual uInt type() const
Get the type (== Register() of derived Measure (faster than Strings) All should have: static uInt myT...
Conversion of Measures.
Definition: MBaseline.h:44
static const String * allMyTypes(Int &nall, Int &nextra, const uInt *&typ)
Bool giveMe(MBaseline::Ref &mr, const String &in)
Quantum< Vector< Double > > get(const Unit &inunit) const
Get Measure data.
virtual const String & tellMe() const
Tell me your type.
MCBaseline MCType
Measure conversion routines for this class (i.e.
Definition: MBaseline.h:134
static const String & showType(MBaseline::Types tp)
ScalarMeasColumn< MBaseline > ScalarColumn
Measure table Columns (e.g., MBaseline::ScalarColumn)
Definition: MBaseline.h:140
Physical quantities within reference frame.
Definition: Measure.h:235
virtual const String & getDefaultType() const
Get the default reference type.
virtual Measure * clone() const
Make copy.
virtual String getRefString() const
Get the reference type (for records, including codes like R_)
Quantum< Vector< Double > > getAngle() const
Base class for all measures.
Definition: MeasBase.h:75
Read only access to table array Measure columns.
Definition: MBaseline.h:45
MeasRef< MBaseline > Ref
Measure reference (i.e.
Definition: MBaseline.h:136
defines physical units
Definition: Unit.h:189
A 3D vector on Earth.
Definition: MVBaseline.h:107
MBaseline conversion routines.
Definition: MCBaseline.h:84
static MBaseline::Types fromDirType(const MDirection::Types in)
Get the correct MBaseline type from a given direction type (or v.v.)
MVBaseline MVType
Measure value container for this class (i.e.
Definition: MBaseline.h:132
Base class for values in a Measure.
Definition: MeasValue.h:107
static Bool getType(MBaseline::Types &tp, const String &in)
Translate string to reference code.
double Double
Definition: aipstype.h:52
static MDirection::Types toDirType(const MBaseline::Types in)
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:39
Quantities (i.e. dimensioned values)
Definition: MeasValue.h:40
ArrayMeasColumn< MBaseline > ArrayColumn
Definition: MBaseline.h:141
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)
MeasConvert< MBaseline > Convert
Measure Convert (i.e.
Definition: MBaseline.h:138
virtual Bool setRefString(const String &in)
Set the reference type to the specified String.
static void assure(const Measure &in)
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
typedef WHATEVER_SUN_TYPEDEF(MBaseline) Types Types
Reference enum Types (included originally for gcc 2.95)
static MBaseline::Types castType(uInt tp)
Translate reference code.
this file contains all the compiler specific defines
Definition: mainpage.dox:28
virtual const String * allTypes(Int &nall, Int &nextra, const uInt *&typ) const
Get a list of all known reference codes.
unsigned int uInt
Definition: aipstype.h:48