casacore
Loading...
Searching...
No Matches
MPosition.h
Go to the documentation of this file.
1//# MPosition.h: A Measure: position on Earth
2//# Copyright (C) 1995,1996,1997,1998,1999,2000,2002
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_MPOSITION_H
27#define MEASURES_MPOSITION_H
28
29//# Includes
30#include <casacore/casa/aips.h>
31#include <casacore/measures/Measures/MeasBase.h>
32#include <casacore/measures/Measures/MeasRef.h>
33#include <casacore/casa/Quanta/MVPosition.h>
34
35namespace casacore { //# NAMESPACE CASACORE - BEGIN
36
37//# Forward Declarations
38class MPosition;
39class MCPosition;
40template <class M> class MeasConvert;
41template <class M> class ArrayMeasColumn;
42template <class M> class ScalarMeasColumn;
43
44//# Typedefs
45
46// <summary>
47// A Measure: position on Earth
48// </summary>
49
50// <use visibility=export>
51
52// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="tMeasure" demos="">
53// </reviewed>
54
55// <prerequisite>
56// <li> <linkto class=Measure>Measure</linkto> class
57// </prerequisite>
58//
59// <etymology>
60// </etymology>
61//
62// <synopsis>
63// MPosition forms derived Measure class for an instant in time.
64// </synopsis>
65//
66// <example>
67// </example>
68//
69// <motivation>
70// </motivation>
71//
72// <todo asof="2000/06/15">
73// <li>
74// </todo>
75
76class MPosition : public MeasBase<MVPosition, MeasRef<MPosition> > {
77
78 public:
79 //# Friends
80 // Conversion of data
81 friend class MeasConvert<MPosition>;
82
83 //# Enumerations
84 // Types of known MPositions
85 // <note role=warning> The order defines the order in the translation
86 // matrix FromTo
87 // in the getConvert routine. Do not change the order without
88 // changing the array. Additions should be made before N_types, and
89 // an additional row and column should be coded in FromTo, and
90 // in showType().</note>
96
97 //# Typedefs
98 // Measure value container for this class (i.e. MPosition::MVType)
100 // Measure conversion routines for this class (i.e. MPosition::MCType)
102 // Measure reference (i.e. MPosition::Ref)
104 // Measure Convert (i.e. MPosition::Convert)
106 // Measure table Columns (e.g., MPosition::ScalarColumn)
109
110 //# Constructors
111 // <note role=tip> In the following constructors and other functions, all
112 // <em>MeasRef</em> can be replaced with simple <src>Measure::TYPE</src>
113 // where no offsets or frames are needed in the reference. </note>
114 // Default constructor; generates the ITRF centre
116 // Create from data and reference
117 // <group>
119 MPosition(const MVPosition &dt, const MPosition::Ref &rf);
121 MPosition(const Quantity &dt, const Quantity &dt1, const Quantity &dt2);
122 MPosition(const Quantity &dt, const Quantity &dt1, const Quantity &dt2,
123 const MPosition::Ref &rf);
124 MPosition(const Quantity &dt, const Quantity &dt1, const Quantity &dt2,
126 MPosition(const Quantity &dt0, const Quantum<Vector<Double> > &dt);
127 MPosition(const Quantity &dt0, const Quantum<Vector<Double> > &dt,
128 const MPosition::Ref &rf);
129 MPosition(const Quantity &dt0, const Quantum<Vector<Double> > &dt,
131 MPosition(const Measure *dt);
133 // </group>
134
135 // <group>
138 // </group>
139
140 //# Destructor
141 virtual ~MPosition();
142
143 //# Operators
144
145 //# General Member Functions
146 // Tell me your type
147 // <group>
148 virtual const String &tellMe() const;
149 static const String &showMe();
150 static void assure(const Measure &in);
151 // </group>
152 // Translate reference code. The uInt version has a check for valid codes
153 // (i.e. it is a safe cast).
154 // <thrown>
155 // <li> AipsError in the uInt interface if illegal code given
156 // </thrown>
157 // <group>
160 static const String &showType(uInt tp);
161 // </group>
162 // Translate string to reference code
163 // <group>
164 static Bool getType(MPosition::Types &tp, const String &in);
165 // this one throws an exception for an unrecognized String
166 static MPosition::Types getType(const String& in);
167
169 // </group>
170 // Set the offset in the reference (False if non-matching Measure)
171 virtual Bool setOffset(const Measure &in);
172 // Set the reference type to the specified String. False if illegal
173 // string, reference set to DEFAULT.
174 virtual Bool setRefString(const String &in);
175 // Get the default reference type
176 virtual const String &getDefaultType() const;
177 // Get a list of all known reference codes. nall returns the number in list,
178 // nextra the number of specials (like planets) that should be at
179 // end of list). typ returns the list of corresponding types.
180 // <group>
181 virtual const String* allTypes(Int &nall, Int &nextra,
182 const uInt *&typ) const;
183 static const String* allMyTypes(Int &nall, Int &nextra,
184 const uInt *&typ);
185 // </group>
186 // Check if all internal tables of types (both enum and String) are
187 // complete and correct. This function is called automatically if and when
188 // necessary.
189 // <thrown>
190 // <li> AipsError if a (programming) error in the types.
191 // </thrown>
192 // <group>
193 virtual void checkTypes() const;
194 static void checkMyTypes();
195 // </group>
196 // Get the reference type (for records, including codes like R_)
197 virtual String getRefString() const;
198
199 // Get Measure data
200 // <group>
201 Quantum<Vector<Double> > get(const Unit &inunit) const;
203 Quantum<Vector<Double> > getAngle(const Unit &inunit) const;
204 // </group>
205
206 // Make copy
207 // <group>
208 virtual Measure *clone() const;
209 // </group>
210
211 private:
212 //# Enumerations
213
214 //# Data
215
216 //# Member functions
217
218};
219
220
221} //# NAMESPACE CASACORE - END
222
223#endif
MPosition()
Tip: In the following constructors and other functions, all MeasRef can be replaced with simple Measu...
virtual const String & getDefaultType() const
Get the default reference type.
static Bool getType(MPosition::Types &tp, const String &in)
Translate string to reference code.
MPosition(const Quantity &dt0, const Quantum< Vector< Double > > &dt, const MPosition::Ref &rf)
static MPosition::Types getType(const String &in)
this one throws an exception for an unrecognized String
static void assure(const Measure &in)
Quantum< Vector< Double > > get(const Unit &inunit) const
Get Measure data.
Types
Types of known MPositions Warning: The order defines the order in the translation matrix FromTo in t...
Definition MPosition.h:91
ArrayMeasColumn< MPosition > ArrayColumn
Definition MPosition.h:108
MPosition(const MVPosition &dt)
Create from data and reference.
Bool giveMe(MPosition::Ref &mr, const String &in)
MPosition(const MPosition &)
static const String * allMyTypes(Int &nall, Int &nextra, const uInt *&typ)
static void checkMyTypes()
MPosition(const MeasValue *dt)
MCPosition MCType
Measure conversion routines for this class (i.e.
Definition MPosition.h:101
static const String & showType(MPosition::Types tp)
virtual const String & tellMe() const
Tell me your type.
virtual const String * allTypes(Int &nall, Int &nextra, const uInt *&typ) const
Get a list of all known reference codes.
MPosition & operator=(const MPosition &)
Quantum< Vector< Double > > getAngle(const Unit &inunit) const
MPosition(const Quantity &dt0, const Quantum< Vector< Double > > &dt)
virtual String getRefString() const
Get the reference type (for records, including codes like R_)
MeasConvert< MPosition > Convert
Measure Convert (i.e.
Definition MPosition.h:105
static MPosition::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.
MeasRef< MPosition > Ref
Measure reference (i.e.
Definition MPosition.h:103
MPosition(const Quantity &dt0, const Quantum< Vector< Double > > &dt, MPosition::Types rf)
MVPosition MVType
Measure value container for this class (i.e.
Definition MPosition.h:99
virtual Bool setOffset(const Measure &in)
Set the offset in the reference (False if non-matching Measure)
static const String & showMe()
static const String & showType(uInt tp)
ScalarMeasColumn< MPosition > ScalarColumn
Measure table Columns (e.g., MPosition::ScalarColumn)
Definition MPosition.h:107
virtual Bool setRefString(const String &in)
Set the reference type to the specified String.
MPosition(const Quantity &dt, const Quantity &dt1, const Quantity &dt2)
virtual Measure * clone() const
Make copy.
MPosition(const MVPosition &dt, const MPosition::Ref &rf)
MPosition(const Quantity &dt, const Quantity &dt1, const Quantity &dt2, MPosition::Types rf)
MPosition(const Measure *dt)
Quantum< Vector< Double > > getAngle() const
MPosition(const Quantity &dt, const Quantity &dt1, const Quantity &dt2, const MPosition::Ref &rf)
MPosition(const MVPosition &dt, MPosition::Types rf)
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