casacore
Loading...
Searching...
No Matches
Aberration.h
Go to the documentation of this file.
1// # Aberration.h: Aberration class
2// # Copyright (C) 1995,1996,1997,1998
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_ABERRATION_H
27#define MEASURES_ABERRATION_H
28
29// # Includes
30#include <mutex>
31#include <casacore/casa/aips.h>
32#include <casacore/casa/Quanta/MVPosition.h>
33
34namespace casacore { // # NAMESPACE CASACORE - BEGIN
35
36// <summary>
37// Aberration class and calculations
38// </summary>
39
40// <use visibility=export>
41
42// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="tMeasMath" demos="">
43// </reviewed>
44
45// <prerequisite>
46// <li> <linkto class=Measure>Measure</linkto> class,
47// especially <linkto class=MEpoch>MEpoch</linkto>
48// <li> <linkto class=MeasData>MeasData</linkto> class for constants
49// </prerequisite>
50//
51// <etymology>
52// Aberration
53// </etymology>
54//
55// <synopsis>
56// Aberration forms the class for Aberration calculations. It is a simple
57// container with the selected method, and the mean epoch.<br>
58// The method is selected from one of the following:
59// <ul>
60// <li> Aberration::STANDARD (at 1995/09/04 the IAU1980 definition)
61// <li> Aberration::NONE
62// <li> Aberration::B1950
63// </ul>
64// Epochs can be specified as the MJD (with defined constants MeasData::MJD2000
65// and MeasData::MJDB1950 or the actual MJD),
66// leading to the following constructors:
67// <ul>
68// <li> Aberration() default; assuming JD2000, IAU1980
69// <li> Aberration(method) assuming the correct default epoch of
70// JD2000 or B1950
71// <li> Aberration(method,epoch) with epoch Double(MJD).
72// </ul>
73// Actual Aberration for a certain Epoch is calculated by the () operator
74// as Aberration(epoch), with epoch Double MJD, values returned as an
75// MVPosition.<br>
76// The derivative (d<sup>-1</sup>) can be obtained as well by
77// derivative(epoch).<br>
78// The following details can be set with the
79// <linkto class=Aipsrc>Aipsrc</linkto> mechanism:
80// <ul>
81// <li> measures.aberration.d_interval: approximation interval as time
82// (fraction of days is default unit) over which linear approximation
83// is used
84// <li> measures.aberration.b_usejpl: use the JPL database values for IAU1980.
85// Else analytical expression, relative error about 10<sup>-9</sup>
86// Note that the JPL database to be used can be set with
87// measures.jpl.ephemeris (at the moment of writing DE200 (default),
88// or DE405). If using the JPL database, the d_interval (and the
89// output of derivative()) are irrelevant.
90// </ul>
91// </synopsis>
92//
93// <example>
94// </example>
95//
96// <motivation>
97// To calculate the Aberration angles. An alternate route could have been
98// a global function, but having a simple container allows
99// caching of some calculations for speed.<br>
100// Using MJD (JD-2400000.5) rather than JD is for precision reasons.
101// </motivation>
102//
103// <todo asof="1997/12/02">
104// </todo>
105
107 public:
108 // # Constants
109 // Interval to be used for linear approximation (in days)
110 static constexpr Double INTV = 0.04;
111
112 // # Enumerations
113 // Types of known Aberration calculations (at 1995/09/04 STANDARD == IAU1980)
115
116 // # Constructors
117 // Default constructor, generates default J2000 Aberration identification
119 // Copy constructor
120 Aberration(const Aberration &other);
121 // Constructor with type
123 // Copy assignment
125
126 // # Destructor
128
129 // # Operators
130 // Operator () calculates the Aberration direction cosine vector
132
133 // # General Member Functions
134 // Return derivative of Aberration (d<sup>-1</sup>) w.r.t. time
136
137 // Re-initialise Aberration object
138 // <group>
140 // </group>
141
142 // Refresh calculations
143 void refresh();
144
145 private:
146 // # Data menbers
147 // Method to be used
149 // Check epoch for linear approximation
151 // Cached calculated angles
153 // Cached derivatives
155 // To be able to use referenced results in simple calculations, a circular
156 // result buffer is used.
157 // Current buffer pointer.
159 // Last calculation
161 // Interpolation interval
162 inline static uInt interval_reg;
163 // JPL use
164 inline static uInt usejpl_reg;
165 inline static std::once_flag initialize_once_flag;
166
167 // # Member functions
168 // Copy
169 void copy(const Aberration &other);
170 // Fill an empty copy
171 static void initialize();
172 // Calculate Aberration angles for time t
174};
175
176} // namespace casacore
177
178#endif
Aberration & operator=(const Aberration &other)
Copy assignment.
void calcAber(Double t)
Calculate Aberration angles for time t.
Double dval[3]
Cached derivatives.
Definition Aberration.h:154
Aberration(const Aberration &other)
Copy constructor.
void copy(const Aberration &other)
Copy.
static constexpr Double INTV
Interval to be used for linear approximation (in days).
Definition Aberration.h:110
void init(AberrationTypes type=Aberration::STANDARD)
Re-initialise Aberration object.
MVPosition result[4]
Last calculation.
Definition Aberration.h:160
static std::once_flag initialize_once_flag
Definition Aberration.h:165
Double checkEpoch
Check epoch for linear approximation.
Definition Aberration.h:150
Aberration()
Default constructor, generates default J2000 Aberration identification.
static uInt usejpl_reg
JPL use.
Definition Aberration.h:164
static uInt interval_reg
Interpolation interval.
Definition Aberration.h:162
AberrationTypes method
Method to be used.
Definition Aberration.h:148
Double aval[3]
Cached calculated angles.
Definition Aberration.h:152
const MVPosition & operator()(Double epoch)
Operator () calculates the Aberration direction cosine vector.
Int lres
To be able to use referenced results in simple calculations, a circular result buffer is used.
Definition Aberration.h:158
void refresh()
Refresh calculations.
AberrationTypes
Types of known Aberration calculations (at 1995/09/04 STANDARD == IAU1980).
Definition Aberration.h:114
Aberration(AberrationTypes type)
Constructor with type.
static void initialize()
Fill an empty copy.
const MVPosition & derivative(Double epoch)
Return derivative of Aberration (d-1) w.r.t.
For temporary backward namespace compatibility, use casa as alias for casacore.
Definition mainpage.dox:28
unsigned int uInt
Definition aipstype.h:49
int Int
Definition aipstype.h:48
double Double
Definition aipstype.h:53