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 
143 //# Constructors
144 // <note role=tip> In the following constructors and other functions, all
145 // <em>MeasRef</em> can be replaced with simple <src>Measure::TYPE</src>
146 // where no offsets or frames are needed in the reference. </note>
147 // Default constructor; generates the ITRF centre
149 // Create from data and reference
150 // <group>
151  MBaseline(const MVBaseline &dt);
152  MBaseline(const MVBaseline &dt, const MBaseline::Ref &rf);
154  MBaseline(const Measure *dt);
155  MBaseline(const MeasValue *dt);
156 // </group>
157 
158  // <group>
161  // </group>
162 
163 //# Destructor
164  virtual ~MBaseline();
165 
166 //# Operators
167 
168 //# General Member Functions
169 // Tell me your type
170 // <group>
171  virtual const String &tellMe() const;
172  static const String &showMe();
173  static void assure(const Measure &in);
174 // </group>
175  // Translate reference code. The uInt version has a check for valid codes
176  // (i.e. it is a safe cast).
177  // <thrown>
178  // <li> AipsError in the uInt interface if illegal code given
179  // </thrown>
180  // <group>
182  static const String &showType(MBaseline::Types tp);
183  static const String &showType(uInt tp);
184  // </group>
185  // Translate string to reference code
186  // <group>
187  static Bool getType(MBaseline::Types &tp, const String &in);
188  Bool giveMe(MBaseline::Ref &mr, const String &in);
189 // </group>
190  // Set the offset in the reference (False if non-matching Measure)
191  virtual Bool setOffset(const Measure &in);
192  // Set the reference type to the specified String. False if illegal
193  // string, reference set to DEFAULT.
194  virtual Bool setRefString(const String &in);
195  // Get the default reference type
196  virtual const String &getDefaultType() const;
197  // Get a list of all known reference codes. nall returns the number in list,
198  // nextra the number of specials (like planets) that should be at
199  // end of list). typ returns the list of corresponding types.
200  // <group>
201  virtual const String* allTypes(Int &nall, Int &nextra,
202  const uInt *&typ) const;
203  static const String* allMyTypes(Int &nall, Int &nextra,
204  const uInt *&typ);
205  // </group>
206  // Check if all internal tables of types (both enum and String) are
207  // complete and correct. This function is called automatically if and when
208  // necessary.
209  // <thrown>
210  // <li> AipsError if a (programming) error in the types.
211  // </thrown>
212  // <group>
213  virtual void checkTypes() const;
214  static void checkMyTypes();
215  // </group>
216  // Get the correct MBaseline type from a given direction type (or v.v.)
217  // <group>
220  // </group>
221  // Get the reference type (for records, including codes like R_)
222  virtual String getRefString() const;
223 
224 // Get Measure data
225 // <group>
226  Quantum<Vector<Double> > get(const Unit &inunit) const;
228  Quantum<Vector<Double> > getAngle(const Unit &inunit) const;
229 // </group>
230 
231 // Make copy
232 // <group>
233  virtual Measure *clone() const;
234 // </group>
235 
236 private:
237 //# Enumerations
238 
239 //# Data
240 
241 //# Member functions
242 
243 };
244 
245 
246 } //# NAMESPACE CASACORE - END
247 
248 #endif
static Bool getType(MBaseline::Types &tp, const String &in)
Translate string to reference code.
virtual const String & getDefaultType() const
Get the default reference type.
virtual const String & tellMe() const
Tell me your type.
MBaseline(const MVBaseline &dt, const MBaseline::Ref &rf)
static MBaseline::Types fromDirType(const MDirection::Types in)
Get the correct MBaseline type from a given direction type (or v.v.)
static void checkMyTypes()
virtual void checkTypes() const
Check if all internal tables of types (both enum and String) are complete and correct.
static MDirection::Types toDirType(const MBaseline::Types in)
Types
Types of known MBaselines Warning: The order defines the order in the translation matrix FromTo in t...
Definition: MBaseline.h:100
@ DEFAULT
Defaults.
Definition: MBaseline.h:125
@ AZELNE
Synonyms.
Definition: MBaseline.h:127
Bool giveMe(MBaseline::Ref &mr, const String &in)
ArrayMeasColumn< MBaseline > ArrayColumn
Definition: MBaseline.h:141
MBaseline(const MeasValue *dt)
virtual Bool setRefString(const String &in)
Set the reference type to the specified String.
MBaseline(const MBaseline &)
Quantum< Vector< Double > > getAngle(const Unit &inunit) const
static const String & showMe()
MBaseline(const Measure *dt)
virtual String getRefString() const
Get the reference type (for records, including codes like R_)
static MBaseline::Types castType(uInt tp)
Translate reference code.
MVBaseline MVType
Measure value container for this class (i.e.
Definition: MBaseline.h:132
MBaseline(const MVBaseline &dt)
Create from data and reference.
virtual Measure * clone() const
Make copy.
MCBaseline MCType
Measure conversion routines for this class (i.e.
Definition: MBaseline.h:134
Quantum< Vector< Double > > get(const Unit &inunit) const
Get Measure data.
static const String * allMyTypes(Int &nall, Int &nextra, const uInt *&typ)
virtual Bool setOffset(const Measure &in)
Set the offset in the reference (False if non-matching Measure)
MBaseline()
Tip: In the following constructors and other functions, all MeasRef can be replaced with simple Measu...
ScalarMeasColumn< MBaseline > ScalarColumn
Measure table Columns (e.g., MBaseline::ScalarColumn)
Definition: MBaseline.h:140
MeasConvert< MBaseline > Convert
Measure Convert (i.e.
Definition: MBaseline.h:138
virtual const String * allTypes(Int &nall, Int &nextra, const uInt *&typ) const
Get a list of all known reference codes.
static void assure(const Measure &in)
Quantum< Vector< Double > > getAngle() const
MBaseline & operator=(const MBaseline &)
static const String & showType(MBaseline::Types tp)
MBaseline(const MVBaseline &dt, MBaseline::Types rf)
MeasRef< MBaseline > Ref
Measure reference (i.e.
Definition: MBaseline.h:136
static const String & showType(uInt tp)
Types
Types of known MDirections Warning: The order defines the order in the translation matrix FromTo in ...
Definition: MDirection.h:188
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