casacore
Loading...
Searching...
No Matches
Nutation.h
Go to the documentation of this file.
1//# Nutation.h: Nutation class
2//# Copyright (C) 1995,1996,1997,1998,2003,2004
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_NUTATION_H
27#define MEASURES_NUTATION_H
28
29//# Includes
30#include <casacore/casa/aips.h>
31#include <casacore/casa/Quanta/Quantum.h>
32#include <casacore/casa/Quanta/Euler.h>
33
34namespace casacore { //# NAMESPACE CASACORE - BEGIN
35
36//# Forward Declarations
37
38// <summary> Nutation class and calculations </summary>
39
40// <use visibility=export>
41
42// <reviewed reviewer="Tim Cornwell" date="1996/07/01" tests="tMeasMath"
43// demos="">
44// </reviewed>
45
46// <prerequisite>
47// <li> <linkto class=Measure>Measure</linkto> class
48// <li> <linkto class=Euler>Euler</linkto>
49// <li> <linkto class=MeasData>MeasData</linkto> class for constants
50// </prerequisite>
51//
52// <etymology>
53// Nutation
54// </etymology>
55//
56// <synopsis>
57// Nutation forms the class for Nutation calculations. It is a simple
58// container with the selected method, and the mean epoch.
59// It acts as a cache
60// for values and their derivatives, to enable fast calculations for time
61// epochs close together (see the <em>aipsrc</em> variable
62// <em>measures.nutation.d_interval</em>).
63//
64// The calculation method is selected from one of the following:
65// <ul>
66// <li> Nutation::STANDARD (at 1995/09/04 the IAU1980 definition,
67// from 2004/01/01 IAU2000B)
68// <li> Nutation::NONE (nutation of zero returned)
69// <li> Nutation::IAU1980
70// <li> Nutation::B1950
71// <li> Nutation::IAU2000
72// <li> Nutation::IAU2000A (equal to the full precision (uas) IAU2000)
73// <li> Nutation::IAU2000B (official lower precision (mas) of IAU2000)
74// </ul>
75// Epochs can be specified as the MJD (with defined constants MeasData::MJD2000
76// and MeasData::MJDB1950 or the actual MJD),
77// leading to the following constructors:
78// <ul>
79// <li> Nutation() default; assuming STANDARD
80// <li> Nutation(method)
81// </ul>
82// Actual Nutation for a certain Epoch is calculated by the () operator
83// as Nutation(epoch), with epoch Double MJD. Values are returned as an
84// <linkto class=Euler>Euler</linkto>.
85// The derivative (d<sup>-1</sup>) can be obtained as well by
86// derivative(epoch). <br>
87// A Nutation can be re-initialed with a different method and/or zero
88// epoch with the <src>init()</src> functions (same format as constructors).
89// To bypass the full calculation actual returned values are calculated
90// using the derivative if within about 2 hours (error less than about
91// 10<sup>-5</sup> mas). A call to refresh() will re-initiate calculations
92// from scratch.<br>
93// The following details can be set with the
94// <linkto class=Aipsrc>Aipsrc</linkto> mechanism:
95// <ul>
96// <li> measures.nutation.d_interval: approximation interval as time
97// (fraction of days is default unit) over which linear approximation
98// is used (default 0.04d (about 1 hour)).
99// <li> measures.nutation.b_usejpl: use the JPL database nutations for
100// IAU1980.
101// Else analytical expression, relative error about 10<sup>-9</sup>
102// Note that the JPL database to be used can be set with
103// measures.jpl.ephemeris (at the moment of writing DE200
104// (default), or DE405)
105// <li> measures.nutation.b_useiers: use the IERS Database nutation
106// corrections for IAU1980 (default False)
107// </ul>
108// </synopsis>
109//
110// <example>
111// <srcblock>
112// #include <casacore/measures/Measures.h>
113// MVDirection pos(Quantity(10,"degree"),Quantity(-10.5,"degree"));
114// // direction RA=10; DEC=-10.5
115// Nutation mine(Nutation::IAU1980); // define nutation type
116// RotMatrix rotat(mine(45837.0)); // rotation matrix for 84/05/17
117// MVDirection new = rotat*pos; // apply nutation
118// </srcblock>
119// The normal way to use Nutation is by using the
120// <linkto class=MeasConvert>MeasConvert</linkto> class.
121// </example>
122//
123// <motivation>
124// To calculate the Nutation angles. An alternate route could have been
125// a global function, but having a simple container allows caching of some
126// calculations for speed.<br>
127// Using MJD (JD-2400000.5) rather than JD is for precision reasons.
128// </motivation>
129//
130// <todo asof="2003/10/20">
131// <li> Correct deval_p (derivative complimentary eqox terms)
132// <li> Improve speed by a bit more lazyness in derivative calculations
133// and separate eqox calculations
134// </todo>
135
136class Nutation {
137 public:
138 //# Constants
139 // Interval to be used for linear approximation (in days)
140 static const Double INTV;
141
142 //# Enumerations
143 // Types of known Nutation calculations (at 1995/09/04 STANDARD == IAU1980,
144 // after 2004/01/01 it will be IAU2000B))
149
150 //# Constructors
151 // Default constructor, generates default J2000 Nutation identification
153 // Copy constructor
154 Nutation(const Nutation &other);
155 // Constructor with type
156 explicit Nutation(NutationTypes type);
157 // Copy assignment
159
160 //# Destructor
162
163 //# Operators
164 // Return the Nutation angles
165 const Euler &operator()(Double epoch);
166
167 //# General Member Functions
168 // Return derivative of Nutation (d<sup>-1</sup>)
169 const Euler &derivative(Double epoch);
170
171 // Re-initialise Nutation object
172 // <group>
173 void init();
174 void init(NutationTypes type);
175 // </group>
176
177 // Refresh calculations
178 void refresh();
179
180 // Get the equation of equinox
181 // <group>
184 Quantity getEqoxAngle(Double epoch, const Unit &unit) ;
185 // </group>
186 // Get the derivative of the equation of equinoxes in d<sup>-1</sup>
188 // Get the complimentary terms of the equation of equinoxes
190 // Get the derivative of the complimentary terms of the equation of equinoxes
192
193 private:
194
195 //# Data members
196 // Method to be used
198 // Check epoch for linear approximation
200 // Check epoch for calculation of derivatives
202 // Cached calculated angles
204 // Cached derivatives
206 // Cached equation of equinoxes
208 // Cached derivative equation of equinoxes
210 // Cached complimentary terms equation of equinoxes
212 // Cached derivative of complimentary terms equation of equinoxes
214 // To be able to use references rather than copies, and also to use these
215 // references in simple (up to 4 terms of Nutation results) expressions,
216 // results are calculated in circulating buffer
218 // Last calculation
220 // Interpolation interval
222 // IERS use
224 // JPL use
226 //# Member functions
227 // Make a copy
228 void copy(const Nutation &other);
229 // Fill an empty copy
230 void fill();
231 // Calculate Nutation angles for time t; also derivatives if True given
232 void calcNut(Double t, Bool calcDer = False);
233};
234
235
236} //# NAMESPACE CASACORE - END
237
238#endif
239
240
static uInt myInterval_reg
Interpolation interval.
Definition Nutation.h:221
void init(NutationTypes type)
void calcNut(Double t, Bool calcDer=False)
Calculate Nutation angles for time t; also derivatives if True given.
Quantity getEqoxAngle(Double epoch)
Double neval_p
Cached complimentary terms equation of equinoxes.
Definition Nutation.h:211
Nutation()
Default constructor, generates default J2000 Nutation identification.
NutationTypes
Types of known Nutation calculations (at 1995/09/04 STANDARD == IAU1980, after 2004/01/01 it will be ...
Definition Nutation.h:145
Double nval_p[3]
Cached calculated angles.
Definition Nutation.h:203
void refresh()
Refresh calculations.
Double eqoxCT(Double epoch)
Get the complimentary terms of the equation of equinoxes.
Double derivativeEqox(Double epoch)
Get the derivative of the equation of equinoxes in d-1
NutationTypes method_p
Method to be used.
Definition Nutation.h:197
Euler result_p[4]
Last calculation.
Definition Nutation.h:219
Double eqox(Double epoch)
Get the equation of equinox.
Nutation(NutationTypes type)
Constructor with type.
Quantity getEqoxAngle(Double epoch, const Unit &unit)
Nutation & operator=(const Nutation &other)
Copy assignment.
void fill()
Fill an empty copy.
static const Double INTV
Interval to be used for linear approximation (in days)
Definition Nutation.h:140
Double deval_p
Cached derivative of complimentary terms equation of equinoxes.
Definition Nutation.h:213
Double checkDerEpoch_p
Check epoch for calculation of derivatives.
Definition Nutation.h:201
Double checkEpoch_p
Check epoch for linear approximation.
Definition Nutation.h:199
void init()
Re-initialise Nutation object.
Nutation(const Nutation &other)
Copy constructor.
const Euler & derivative(Double epoch)
Return derivative of Nutation (d-1)
static uInt myUseiers_reg
IERS use.
Definition Nutation.h:223
Int lres_p
To be able to use references rather than copies, and also to use these references in simple (up to 4 ...
Definition Nutation.h:217
static uInt myUsejpl_reg
JPL use.
Definition Nutation.h:225
Double eqeq_p
Cached equation of equinoxes.
Definition Nutation.h:207
const Euler & operator()(Double epoch)
Return the Nutation angles.
Double dval_p[3]
Cached derivatives.
Definition Nutation.h:205
Double derivativeEqoxCT(Double epoch)
Get the derivative of the complimentary terms of the equation of equinoxes.
void copy(const Nutation &other)
Make a copy.
Double deqeq_p
Cached derivative equation of equinoxes.
Definition Nutation.h:209
this file contains all the compiler specific defines
Definition mainpage.dox:28
const Bool False
Definition aipstype.h:42
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
double Double
Definition aipstype.h:53