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