1 | #include "erfa.h"
|
---|
2 |
|
---|
3 | void eraPn00(double date1, double date2, double dpsi, double deps,
|
---|
4 | double *epsa,
|
---|
5 | double rb[3][3], double rp[3][3], double rbp[3][3],
|
---|
6 | double rn[3][3], double rbpn[3][3])
|
---|
7 | /*
|
---|
8 | ** - - - - - - - -
|
---|
9 | ** e r a P n 0 0
|
---|
10 | ** - - - - - - - -
|
---|
11 | **
|
---|
12 | ** Precession-nutation, IAU 2000 model: a multi-purpose function,
|
---|
13 | ** supporting classical (equinox-based) use directly and CIO-based
|
---|
14 | ** use indirectly.
|
---|
15 | **
|
---|
16 | ** Given:
|
---|
17 | ** date1,date2 double TT as a 2-part Julian Date (Note 1)
|
---|
18 | ** dpsi,deps double nutation (Note 2)
|
---|
19 | **
|
---|
20 | ** Returned:
|
---|
21 | ** epsa double mean obliquity (Note 3)
|
---|
22 | ** rb double[3][3] frame bias matrix (Note 4)
|
---|
23 | ** rp double[3][3] precession matrix (Note 5)
|
---|
24 | ** rbp double[3][3] bias-precession matrix (Note 6)
|
---|
25 | ** rn double[3][3] nutation matrix (Note 7)
|
---|
26 | ** rbpn double[3][3] GCRS-to-true matrix (Note 8)
|
---|
27 | **
|
---|
28 | ** Notes:
|
---|
29 | **
|
---|
30 | ** 1) The TT date date1+date2 is a Julian Date, apportioned in any
|
---|
31 | ** convenient way between the two arguments. For example,
|
---|
32 | ** JD(TT)=2450123.7 could be expressed in any of these ways,
|
---|
33 | ** among others:
|
---|
34 | **
|
---|
35 | ** date1 date2
|
---|
36 | **
|
---|
37 | ** 2450123.7 0.0 (JD method)
|
---|
38 | ** 2451545.0 -1421.3 (J2000 method)
|
---|
39 | ** 2400000.5 50123.2 (MJD method)
|
---|
40 | ** 2450123.5 0.2 (date & time method)
|
---|
41 | **
|
---|
42 | ** The JD method is the most natural and convenient to use in
|
---|
43 | ** cases where the loss of several decimal digits of resolution
|
---|
44 | ** is acceptable. The J2000 method is best matched to the way
|
---|
45 | ** the argument is handled internally and will deliver the
|
---|
46 | ** optimum resolution. The MJD method and the date & time methods
|
---|
47 | ** are both good compromises between resolution and convenience.
|
---|
48 | **
|
---|
49 | ** 2) The caller is responsible for providing the nutation components;
|
---|
50 | ** they are in longitude and obliquity, in radians and are with
|
---|
51 | ** respect to the equinox and ecliptic of date. For high-accuracy
|
---|
52 | ** applications, free core nutation should be included as well as
|
---|
53 | ** any other relevant corrections to the position of the CIP.
|
---|
54 | **
|
---|
55 | ** 3) The returned mean obliquity is consistent with the IAU 2000
|
---|
56 | ** precession-nutation models.
|
---|
57 | **
|
---|
58 | ** 4) The matrix rb transforms vectors from GCRS to J2000.0 mean
|
---|
59 | ** equator and equinox by applying frame bias.
|
---|
60 | **
|
---|
61 | ** 5) The matrix rp transforms vectors from J2000.0 mean equator and
|
---|
62 | ** equinox to mean equator and equinox of date by applying
|
---|
63 | ** precession.
|
---|
64 | **
|
---|
65 | ** 6) The matrix rbp transforms vectors from GCRS to mean equator and
|
---|
66 | ** equinox of date by applying frame bias then precession. It is
|
---|
67 | ** the product rp x rb.
|
---|
68 | **
|
---|
69 | ** 7) The matrix rn transforms vectors from mean equator and equinox of
|
---|
70 | ** date to true equator and equinox of date by applying the nutation
|
---|
71 | ** (luni-solar + planetary).
|
---|
72 | **
|
---|
73 | ** 8) The matrix rbpn transforms vectors from GCRS to true equator and
|
---|
74 | ** equinox of date. It is the product rn x rbp, applying frame
|
---|
75 | ** bias, precession and nutation in that order.
|
---|
76 | **
|
---|
77 | ** 9) It is permissible to re-use the same array in the returned
|
---|
78 | ** arguments. The arrays are filled in the order given.
|
---|
79 | **
|
---|
80 | ** Called:
|
---|
81 | ** eraPr00 IAU 2000 precession adjustments
|
---|
82 | ** eraObl80 mean obliquity, IAU 1980
|
---|
83 | ** eraBp00 frame bias and precession matrices, IAU 2000
|
---|
84 | ** eraCr copy r-matrix
|
---|
85 | ** eraNumat form nutation matrix
|
---|
86 | ** eraRxr product of two r-matrices
|
---|
87 | **
|
---|
88 | ** Reference:
|
---|
89 | **
|
---|
90 | ** Capitaine, N., Chapront, J., Lambert, S. and Wallace, P.,
|
---|
91 | ** "Expressions for the Celestial Intermediate Pole and Celestial
|
---|
92 | ** Ephemeris Origin consistent with the IAU 2000A precession-
|
---|
93 | ** nutation model", Astron.Astrophys. 400, 1145-1154 (2003)
|
---|
94 | **
|
---|
95 | ** n.b. The celestial ephemeris origin (CEO) was renamed "celestial
|
---|
96 | ** intermediate origin" (CIO) by IAU 2006 Resolution 2.
|
---|
97 | **
|
---|
98 | ** Copyright (C) 2013-2015, NumFOCUS Foundation.
|
---|
99 | ** Derived, with permission, from the SOFA library. See notes at end of file.
|
---|
100 | */
|
---|
101 | {
|
---|
102 | double dpsipr, depspr, rbpw[3][3], rnw[3][3];
|
---|
103 |
|
---|
104 | /* IAU 2000 precession-rate adjustments. */
|
---|
105 | eraPr00(date1, date2, &dpsipr, &depspr);
|
---|
106 |
|
---|
107 | /* Mean obliquity, consistent with IAU 2000 precession-nutation. */
|
---|
108 | *epsa = eraObl80(date1, date2) + depspr;
|
---|
109 |
|
---|
110 | /* Frame bias and precession matrices and their product. */
|
---|
111 | eraBp00(date1, date2, rb, rp, rbpw);
|
---|
112 | eraCr(rbpw, rbp);
|
---|
113 |
|
---|
114 | /* Nutation matrix. */
|
---|
115 | eraNumat(*epsa, dpsi, deps, rnw);
|
---|
116 | eraCr(rnw, rn);
|
---|
117 |
|
---|
118 | /* Bias-precession-nutation matrix (classical). */
|
---|
119 | eraRxr(rnw, rbpw, rbpn);
|
---|
120 |
|
---|
121 | return;
|
---|
122 |
|
---|
123 | }
|
---|
124 | /*----------------------------------------------------------------------
|
---|
125 | **
|
---|
126 | **
|
---|
127 | ** Copyright (C) 2013-2015, NumFOCUS Foundation.
|
---|
128 | ** All rights reserved.
|
---|
129 | **
|
---|
130 | ** This library is derived, with permission, from the International
|
---|
131 | ** Astronomical Union's "Standards of Fundamental Astronomy" library,
|
---|
132 | ** available from http://www.iausofa.org.
|
---|
133 | **
|
---|
134 | ** The ERFA version is intended to retain identical functionality to
|
---|
135 | ** the SOFA library, but made distinct through different function and
|
---|
136 | ** file names, as set out in the SOFA license conditions. The SOFA
|
---|
137 | ** original has a role as a reference standard for the IAU and IERS,
|
---|
138 | ** and consequently redistribution is permitted only in its unaltered
|
---|
139 | ** state. The ERFA version is not subject to this restriction and
|
---|
140 | ** therefore can be included in distributions which do not support the
|
---|
141 | ** concept of "read only" software.
|
---|
142 | **
|
---|
143 | ** Although the intent is to replicate the SOFA API (other than
|
---|
144 | ** replacement of prefix names) and results (with the exception of
|
---|
145 | ** bugs; any that are discovered will be fixed), SOFA is not
|
---|
146 | ** responsible for any errors found in this version of the library.
|
---|
147 | **
|
---|
148 | ** If you wish to acknowledge the SOFA heritage, please acknowledge
|
---|
149 | ** that you are using a library derived from SOFA, rather than SOFA
|
---|
150 | ** itself.
|
---|
151 | **
|
---|
152 | **
|
---|
153 | ** TERMS AND CONDITIONS
|
---|
154 | **
|
---|
155 | ** Redistribution and use in source and binary forms, with or without
|
---|
156 | ** modification, are permitted provided that the following conditions
|
---|
157 | ** are met:
|
---|
158 | **
|
---|
159 | ** 1 Redistributions of source code must retain the above copyright
|
---|
160 | ** notice, this list of conditions and the following disclaimer.
|
---|
161 | **
|
---|
162 | ** 2 Redistributions in binary form must reproduce the above copyright
|
---|
163 | ** notice, this list of conditions and the following disclaimer in
|
---|
164 | ** the documentation and/or other materials provided with the
|
---|
165 | ** distribution.
|
---|
166 | **
|
---|
167 | ** 3 Neither the name of the Standards Of Fundamental Astronomy Board,
|
---|
168 | ** the International Astronomical Union nor the names of its
|
---|
169 | ** contributors may be used to endorse or promote products derived
|
---|
170 | ** from this software without specific prior written permission.
|
---|
171 | **
|
---|
172 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
---|
173 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
---|
174 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
---|
175 | ** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
---|
176 | ** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
---|
177 | ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
---|
178 | ** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
---|
179 | ** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
---|
180 | ** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
---|
181 | ** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
---|
182 | ** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
---|
183 | ** POSSIBILITY OF SUCH DAMAGE.
|
---|
184 | **
|
---|
185 | */
|
---|