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  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>
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
casacore::MBaseline::get
Quantum< Vector< Double > > get(const Unit &inunit) const
Get Measure data.
casacore::MBaseline
Definition: MBaseline.h:85
casacore::MBaseline::JMEAN
@ JMEAN
Definition: MBaseline.h:102
casacore::MBaseline::castType
static MBaseline::Types castType(uInt tp)
Translate reference code.
casacore::MBaseline::operator=
MBaseline & operator=(const MBaseline &)
casacore::MBaseline::ECLIPTIC
@ ECLIPTIC
Definition: MBaseline.h:116
casacore::MBaseline::fromDirType
static MBaseline::Types fromDirType(const MDirection::Types in)
Get the correct MBaseline type from a given direction type (or v.v.)
casacore::MBaseline::setRefString
virtual Bool setRefString(const String &in)
Set the reference type to the specified String.
casacore::MBaseline::MBaseline
MBaseline(const MVBaseline &dt, MBaseline::Types rf)
casacore::Measure
Definition: Measure.h:235
casacore::MBaseline::AZELSW
@ AZELSW
Definition: MBaseline.h:112
casacore::MBaseline::type
virtual uInt type() const
Get the type (== Register() of derived Measure (faster than Strings) All should have: static uInt myT...
casacore::MBaseline::MECLIPTIC
@ MECLIPTIC
Definition: MBaseline.h:117
casacore::MBaseline::MBaseline
MBaseline(const Measure *dt)
casacore::MBaseline::tellMe
virtual const String & tellMe() const
Tell me your type.
casacore::MBaseline::MCType
MCBaseline MCType
Measure conversion routines for this class (i.e.
Definition: MBaseline.h:134
casacore::MeasValue
Definition: MeasValue.h:107
casacore::MBaseline::APP
@ APP
Definition: MBaseline.h:104
casacore::MBaseline::showType
static const String & showType(MBaseline::Types tp)
casacore::MBaseline::ScalarColumn
ScalarMeasColumn< MBaseline > ScalarColumn
Measure table Columns (e.g., MBaseline::ScalarColumn)
Definition: MBaseline.h:140
casacore::MBaseline::BTRUE
@ BTRUE
Definition: MBaseline.h:108
casacore::MBaseline::N_Types
@ N_Types
Definition: MBaseline.h:123
casacore::MBaseline::getType
static Bool getType(MBaseline::Types &tp, const String &in)
Translate string to reference code.
casacore::MBaseline::MBaseline
MBaseline(const MeasValue *dt)
casacore::MBaseline::~MBaseline
virtual ~MBaseline()
casacore::MBaseline::AZELGEO
@ AZELGEO
Definition: MBaseline.h:113
casacore::MBaseline::allMyTypes
static const String * allMyTypes(Int &nall, Int &nextra, const uInt *&typ)
casacore::MBaseline::giveMe
Bool giveMe(MBaseline::Ref &mr, const String &in)
casacore::MBaseline::getAngle
Quantum< Vector< Double > > getAngle(const Unit &inunit) const
casacore::MBaseline::getRefString
virtual String getRefString() const
Get the reference type (for records, including codes like R_)
casacore::MBaseline::getAngle
Quantum< Vector< Double > > getAngle() const
casacore::ArrayMeasColumn
Definition: ArrayMeasColumn.h:172
casacore::MBaseline::Ref
MeasRef< MBaseline > Ref
Measure reference (i.e.
Definition: MBaseline.h:136
casacore::MBaseline::JNAT
@ JNAT
Definition: MBaseline.h:115
casacore::MBaseline::showMe
static const String & showMe()
casacore::uInt
unsigned int uInt
Definition: aipstype.h:51
casacore::MBaseline::ArrayColumn
ArrayMeasColumn< MBaseline > ArrayColumn
Definition: MBaseline.h:141
casacore::MBaseline::ITRF
@ ITRF
Definition: MBaseline.h:120
casacore::MBaseline::MVType
MVBaseline MVType
Measure value container for this class (i.e.
Definition: MBaseline.h:132
casacore::MeasConvert
Definition: MeasConvert.h:143
casacore::MBaseline::TOPO
@ TOPO
Definition: MBaseline.h:121
casacore::MBaseline::MBaseline
MBaseline(const MVBaseline &dt, const MBaseline::Ref &rf)
casacore::MBaseline::GALACTIC
@ GALACTIC
Definition: MBaseline.h:109
casacore::MBaseline::clone
virtual Measure * clone() const
Make copy.
casacore::Int
int Int
Definition: aipstype.h:50
casacore
this file contains all the compiler specific defines
Definition: mainpage.dox:28
casacore::MBaseline::MBaseline
MBaseline(const MBaseline &)
casacore::MBaseline::DEFAULT
@ DEFAULT
Defaults.
Definition: MBaseline.h:125
casacore::MBaseline::B1950
@ B1950
Definition: MBaseline.h:105
casacore::MBaseline::J2000
@ J2000
Definition: MBaseline.h:101
casacore::MBaseline::checkMyTypes
static void checkMyTypes()
casacore::MBaseline::toDirType
static MDirection::Types toDirType(const MBaseline::Types in)
casacore::MBaseline::MBaseline
MBaseline()
Tip: In the following constructors and other functions, all MeasRef can be replaced with simple Measu...
casacore::MBaseline::assure
static void assure(const Measure &in)
casacore::MBaseline::B1950_VLA
@ B1950_VLA
Definition: MBaseline.h:106
casacore::MBaseline::AZELNEGEO
@ AZELNEGEO
Definition: MBaseline.h:128
casacore::MBaseline::ICRS
@ ICRS
Definition: MBaseline.h:122
casacore::MBaseline::JTRUE
@ JTRUE
Definition: MBaseline.h:103
casacore::MeasBase
Definition: MeasBase.h:75
casacore::String
String: the storage and methods of handling collections of characters.
Definition: String.h:223
casacore::ScalarMeasColumn
Definition: ScalarMeasColumn.h:144
casacore::Bool
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
casacore::MBaseline::setOffset
virtual Bool setOffset(const Measure &in)
Set the offset in the reference (False if non-matching Measure)
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::MBaseline::HADEC
@ HADEC
Definition: MBaseline.h:110
casacore::MBaseline::allTypes
virtual const String * allTypes(Int &nall, Int &nextra, const uInt *&typ) const
Get a list of all known reference codes.
casacore::MBaseline::AZEL
@ AZEL
Definition: MBaseline.h:111
casacore::MBaseline::TECLIPTIC
@ TECLIPTIC
Definition: MBaseline.h:118
casacore::Unit
Definition: Unit.h:189
casacore::MBaseline::MBaseline
MBaseline(const MVBaseline &dt)
Create from data and reference.
casacore::MBaseline::BMEAN
@ BMEAN
Definition: MBaseline.h:107
casacore::MeasRef< MBaseline >
casacore::MBaseline::showType
static const String & showType(uInt tp)
casacore::MBaseline::SUPERGAL
@ SUPERGAL
Definition: MBaseline.h:119
casacore::MBaseline::Convert
MeasConvert< MBaseline > Convert
Measure Convert (i.e.
Definition: MBaseline.h:138
casacore::MVBaseline
Definition: MVBaseline.h:107
casacore::MBaseline::AZELSWGEO
@ AZELSWGEO
Definition: MBaseline.h:114
casacore::MBaseline::Types
Types
Types of known MBaselines Warning: The order defines the order in the translation matrix FromTo in t...
Definition: MBaseline.h:100
casacore::MBaseline::AZELNE
@ AZELNE
Synonyms.
Definition: MBaseline.h:127
casacore::MBaseline::myType
static uInt myType()
Get my type (as Register)
casacore::Quantum
Definition: Quantum.h:271
casacore::MBaseline::getDefaultType
virtual const String & getDefaultType() const
Get the default reference type.
casacore::MCBaseline
Definition: MCBaseline.h:84
casacore::MBaseline::checkTypes
virtual void checkTypes() const
Check if all internal tables of types (both enum and String) are complete and correct.