casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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>
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
148  MBaseline();
149 // Create from data and reference
150 // <group>
151  MBaseline(const MVBaseline &dt);
152  MBaseline(const MVBaseline &dt, const MBaseline::Ref &rf);
153  MBaseline(const MVBaseline &dt, MBaseline::Types rf);
154  MBaseline(const Measure *dt);
155  MBaseline(const MeasValue *dt);
156 // </group>
157 
158  // <group>
159  MBaseline(const MBaseline &);
160  MBaseline &operator=(const MBaseline &);
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  virtual uInt type() const;
174  static void assure(const Measure &in);
175 // </group>
176  // Translate reference code. The uInt version has a check for valid codes
177  // (i.e. it is a safe cast).
178  // <thrown>
179  // <li> AipsError in the uInt interface if illegal code given
180  // </thrown>
181  // <group>
182  static MBaseline::Types castType(uInt tp);
183  static const String &showType(MBaseline::Types tp);
184  static const String &showType(uInt tp);
185  // </group>
186  // Translate string to reference code
187  // <group>
188  static Bool getType(MBaseline::Types &tp, const String &in);
189  Bool giveMe(MBaseline::Ref &mr, const String &in);
190 // </group>
191  // Set the offset in the reference (False if non-matching Measure)
192  virtual Bool setOffset(const Measure &in);
193  // Set the reference type to the specified String. False if illegal
194  // string, reference set to DEFAULT.
195  virtual Bool setRefString(const String &in);
196  // Get the default reference type
197  virtual const String &getDefaultType() const;
198  // Get a list of all known reference codes. nall returns the number in list,
199  // nextra the number of specials (like planets) that should be at
200  // end of list). typ returns the list of corresponding types.
201  // <group>
202  virtual const String* allTypes(Int &nall, Int &nextra,
203  const uInt *&typ) const;
204  static const String* allMyTypes(Int &nall, Int &nextra,
205  const uInt *&typ);
206  // </group>
207  // Check if all internal tables of types (both enum and String) are
208  // complete and correct. This function is called automatically if and when
209  // necessary.
210  // <thrown>
211  // <li> AipsError if a (programming) error in the types.
212  // </thrown>
213  // <group>
214  virtual void checkTypes() const;
215  static void checkMyTypes();
216  // </group>
217  // Get the correct MBaseline type from a given direction type (or v.v.)
218  // <group>
221  // </group>
222  // Get the reference type (for records, including codes like R_)
223  virtual String getRefString() const;
224  // Get my type (as Register)
225  static uInt myType();
226 
227 // Get Measure data
228 // <group>
229  Quantum<Vector<Double> > get(const Unit &inunit) const;
231  Quantum<Vector<Double> > getAngle(const Unit &inunit) const;
232 // </group>
233 
234 // Make copy
235 // <group>
236  virtual Measure *clone() const;
237 // </group>
238 
239 private:
240 //# Enumerations
241 
242 //# Data
243 
244 //# Member functions
245 
246 };
247 
248 
249 } //# NAMESPACE CASACORE - END
250 
251 #endif
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
Conversion of Measures.
Definition: MDirection.h:43
static const String * allMyTypes(Int &nall, Int &nextra, const uInt *&typ)
Bool giveMe(MBaseline::Ref &mr, const String &in)
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
static uInt myType()
Get my type (as Register)
Physical quantities within reference frame.
Definition: Measure.h:235
virtual String getRefString() const
Get the reference type (for records, including codes like R_)
Base class for all measures.
Definition: MeasBase.h:75
Read only access to table array Measure columns.
Definition: MDirection.h:44
virtual Measure * clone() const
Make copy.
MeasRef< MBaseline > Ref
Measure reference (i.e.
Definition: MBaseline.h:136
Types
Types of known MDirections Warning: The order defines the order in the translation matrix FromTo in ...
Definition: MDirection.h:188
virtual const String & getDefaultType() const
Get the default reference type.
defines physical units
Definition: Unit.h:189
A 3D vector on Earth.
Definition: MVBaseline.h:107
MBaseline conversion routines.
Definition: MCBaseline.h:84
virtual const String * allTypes(Int &nall, Int &nextra, const uInt *&typ) const
Get a list of all known reference codes.
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.
Quantum< Vector< Double > > getAngle() const
static MDirection::Types toDirType(const MBaseline::Types in)
MBaseline()
Tip: In the following constructors and other functions, all MeasRef can be replaced with simple Meas...
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 const String & showMe()
Types
Types of known MBaselines Warning: The order defines the order in the translation matrix FromTo in t...
Definition: MBaseline.h:100
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
ArrayMeasColumn< MBaseline > ArrayColumn
Definition: MBaseline.h:141
virtual Bool setOffset(const Measure &in)
Set the offset in the reference (False if non-matching Measure)
MBaseline & operator=(const MBaseline &)
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: MDirection.h:45
virtual const String & tellMe() const
Tell me your type.
static MBaseline::Types castType(uInt tp)
Translate reference code.
unsigned int uInt
Definition: aipstype.h:51
A Measure: Baseline on Earth.
Definition: MBaseline.h:85
static void checkMyTypes()
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42