casacore
Loading...
Searching...
No Matches
MCFrame.h
Go to the documentation of this file.
1// # MCFrame.h: Measure frame calculations proxy
2// # Copyright (C) 1996-2003,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: 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_MCFRAME_H
27#define MEASURES_MCFRAME_H
28
29// # Includes
30#include <casacore/casa/aips.h>
31#include <casacore/measures/Measures/Measure.h>
32
33namespace casacore { // # NAMESPACE CASACORE - BEGIN
34
35// # Forward Declarations
36class MeasFrame;
37struct MCFrameImplementation;
38
39// <summary>
40// Measure frame calculations proxy
41// </summary>
42
43// <use visibility=local>
44
45// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="tMeasure" demos="">
46// </reviewed>
47
48// <prerequisite>
49// <li> <linkto class=Measure>Measure</linkto> class
50// <li> <linkto class=MeasFrame>MeasFrame</linkto> class
51// </prerequisite>
52//
53// <etymology>
54// From Measure and Frame
55// </etymology>
56//
57// <synopsis>
58// The <linkto class=MeasFrame>MeasFrame</linkto> class contains the 'when
59// and where' of an observed Measure. Calculations to get the appropiate
60// value (e.g. the Earth's longitude) from this frame for conversions are
61// done in this class, together with all the caching of (intermediate) results
62// that can speed-up calculations.<br>
63// The MCFrame class is used by the individual measure conversion classes
64// (see <linkto class=MCBase>MCBase</linkto> class).<br>
65// </synopsis>
66//
67// <example>
68// <srcblock>
69// MEpoch my_epoch(Quantity(MeasData::MJDB1950,"d")); // an epoch
70// MCFrame frame(my_epoch); // used in a frame
71// frame.set(obser); // add observatory (an MPosition)
72// MEpoch::Convert conv(my_epoch, MEPoch::Ref(MEpoch::LAST, frame));
73// </srcblock>
74// The <em>conv</em> conversion engine will (transpararently) use the MCFrame
75// class in calls from MCEpoch (the time conversions), which will be called
76// by the MEpoch::Convert () operator.
77// </example>
78//
79// <motivation>
80// To separate the frame calculations from the Measure containers, to enable
81// e.g. Tables to have Measures.
82// </motivation>
83//
84// <todo asof="1997/04/17">
85// </todo>
86
87class MCFrame {
88 public:
89 // # Friends
90
91 // # Constructors
92 // Construct using the MeasFrame parent
94 MCFrame(const MCFrame& other);
95 MCFrame(MCFrame&& other);
96
97 // Destructor
99
100 // # Operators
101
102 // # General member functions
103 // Reset Epoch value
105 // Reset Position value
107 // Reset Direction value
109 // Reset RadialVelocity value
111 // Reset Comet
113 // Make full Epoch
114 void makeEpoch(MeasFrame& frame);
115 // Make full Position
116 void makePosition(const MeasFrame& frame);
117 // Make full Direction
119 // Make full RadialVelocity
120 void makeRadialVelocity(const MeasFrame& frame);
121 // Make full Comet
122 void makeComet();
123
124 // Get time as Temps Dynamique Barycentrique (TDB, or Barycentric Dynamical Time) in days
125 Bool getTDB(Double& tdb, const MeasFrame& frame);
126 // Get UT1 in days
127 Bool getUT1(Double& tdb, const MeasFrame& frame);
128 // Get TT in days
129 Bool getTT(Double& tdb, const MeasFrame& frame);
130 // Get the longitude (in rad)
131 Bool getLong(Double& tdb, const MeasFrame& frame);
132 // Get the latitude (ITRF) (in rad)
133 Bool getLat(Double& tdb, const MeasFrame& frame);
134 // Get the position
135 Bool getITRF(MVPosition& tdb, const MeasFrame& frame);
136 // Get the geocentric position (in m)
137 Bool getRadius(Double& tdb, const MeasFrame& frame);
138 // Get the geodetic latitude
139 Bool getLatGeo(Double& tdb, const MeasFrame& frame);
140 // Get the LAST (in days)
141 Bool getLAST(Double& tdb, const MeasFrame& frame);
142 // Get the LAST (in rad)
143 Bool getLASTr(Double& tdb, const MeasFrame& frame);
144 // Get J2000 coordinates (direction cosines) and long/lat (rad)
145 // <group>
146 Bool getJ2000(MVDirection& tdb, const MeasFrame& frame);
147 Bool getJ2000Long(Double& tdb, const MeasFrame& frame);
148 Bool getJ2000Lat(Double& tdb, const MeasFrame& frame);
149 // </group>
150 // Get B1950 coordinates (direction cosines) and long/lat (rad)
151 // <group>
152 Bool getB1950(MVDirection& tdb, const MeasFrame& frame);
153 Bool getB1950Long(Double& tdb, const MeasFrame& frame);
154 Bool getB1950Lat(Double& tdb, const MeasFrame& frame);
155 // </group>
156 // Get apparent coordinates (direction cosines) and long/lat (rad)
157 // <group>
158 Bool getApp(MVDirection& tdb, const MeasFrame& frame);
159 Bool getAppLong(Double& tdb, const MeasFrame& frame);
160 Bool getAppLat(Double& tdb, const MeasFrame& frame);
161 // </group>
162 // Get LSR radial velocity (m/s)
163 Bool getLSR(Double& tdb, const MeasFrame& frame);
164 // Get Comet type
165 Bool getCometType(uInt& tdb, const MeasFrame& frame);
166 // Get Comet position
167 Bool getComet(MVPosition& tdb, const MeasFrame& frame);
168
169 private:
170 MCFrame& operator=(const MCFrame& other) = delete;
171
172 // pointer-to-implementation (pimpl) pattern is used to avoid a large number of
173 // dependencies in the header file.
174 std::unique_ptr<MCFrameImplementation> impl_;
175};
176
177} // namespace casacore
178
179#endif
void makePosition(const MeasFrame &frame)
Make full Position.
Bool getB1950Lat(Double &tdb, const MeasFrame &frame)
void makeEpoch(MeasFrame &frame)
Make full Epoch.
void resetPosition()
Reset Position value.
void resetComet()
Reset Comet.
void resetEpoch()
Reset Epoch value.
void makeComet()
Make full Comet.
Bool getLong(Double &tdb, const MeasFrame &frame)
Get the longitude (in rad).
Bool getITRF(MVPosition &tdb, const MeasFrame &frame)
Get the position.
void makeRadialVelocity(const MeasFrame &frame)
Make full RadialVelocity.
MCFrame(MCFrame &&other)
Bool getAppLong(Double &tdb, const MeasFrame &frame)
MCFrame()
Construct using the MeasFrame parent.
Bool getTDB(Double &tdb, const MeasFrame &frame)
Get time as Temps Dynamique Barycentrique (TDB, or Barycentric Dynamical Time) in days.
std::unique_ptr< MCFrameImplementation > impl_
pointer-to-implementation (pimpl) pattern is used to avoid a large number of dependencies in the head...
Definition MCFrame.h:174
Bool getLatGeo(Double &tdb, const MeasFrame &frame)
Get the geodetic latitude.
Bool getAppLat(Double &tdb, const MeasFrame &frame)
Bool getLASTr(Double &tdb, const MeasFrame &frame)
Get the LAST (in rad).
Bool getApp(MVDirection &tdb, const MeasFrame &frame)
Get apparent coordinates (direction cosines) and long/lat (rad).
void makeDirection(MeasFrame &frame)
Make full Direction.
Bool getRadius(Double &tdb, const MeasFrame &frame)
Get the geocentric position (in m).
Bool getLat(Double &tdb, const MeasFrame &frame)
Get the latitude (ITRF) (in rad).
Bool getJ2000Lat(Double &tdb, const MeasFrame &frame)
Bool getTT(Double &tdb, const MeasFrame &frame)
Get TT in days.
Bool getB1950Long(Double &tdb, const MeasFrame &frame)
Bool getCometType(uInt &tdb, const MeasFrame &frame)
Get Comet type.
MCFrame(const MCFrame &other)
void resetDirection()
Reset Direction value.
void resetRadialVelocity()
Reset RadialVelocity value.
Bool getUT1(Double &tdb, const MeasFrame &frame)
Get UT1 in days.
MCFrame & operator=(const MCFrame &other)=delete
Bool getComet(MVPosition &tdb, const MeasFrame &frame)
Get Comet position.
Bool getJ2000(MVDirection &tdb, const MeasFrame &frame)
Get J2000 coordinates (direction cosines) and long/lat (rad).
Bool getLSR(Double &tdb, const MeasFrame &frame)
Get LSR radial velocity (m/s).
~MCFrame()
Destructor.
Bool getLAST(Double &tdb, const MeasFrame &frame)
Get the LAST (in days).
Bool getB1950(MVDirection &tdb, const MeasFrame &frame)
Get B1950 coordinates (direction cosines) and long/lat (rad).
Bool getJ2000Long(Double &tdb, const MeasFrame &frame)
For temporary backward namespace compatibility, use casa as alias for casacore.
Definition mainpage.dox:28
unsigned int uInt
Definition aipstype.h:49
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40
double Double
Definition aipstype.h:53