| 1 | #include "sofa.h"
|
|---|
| 2 |
|
|---|
| 3 | void iauPn06(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 | ** i a u P n 0 6
|
|---|
| 10 | ** - - - - - - - -
|
|---|
| 11 | **
|
|---|
| 12 | ** Precession-nutation, IAU 2006 model: a multi-purpose function,
|
|---|
| 13 | ** supporting classical (equinox-based) use directly and CIO-based use
|
|---|
| 14 | ** indirectly.
|
|---|
| 15 | **
|
|---|
| 16 | ** This function is part of the International Astronomical Union's
|
|---|
| 17 | ** SOFA (Standards Of Fundamental Astronomy) software collection.
|
|---|
| 18 | **
|
|---|
| 19 | ** Status: support function.
|
|---|
| 20 | **
|
|---|
| 21 | ** Given:
|
|---|
| 22 | ** date1,date2 double TT as a 2-part Julian Date (Note 1)
|
|---|
| 23 | ** dpsi,deps double nutation (Note 2)
|
|---|
| 24 | **
|
|---|
| 25 | ** Returned:
|
|---|
| 26 | ** epsa double mean obliquity (Note 3)
|
|---|
| 27 | ** rb double[3][3] frame bias matrix (Note 4)
|
|---|
| 28 | ** rp double[3][3] precession matrix (Note 5)
|
|---|
| 29 | ** rbp double[3][3] bias-precession matrix (Note 6)
|
|---|
| 30 | ** rn double[3][3] nutation matrix (Note 7)
|
|---|
| 31 | ** rbpn double[3][3] GCRS-to-true matrix (Note 8)
|
|---|
| 32 | **
|
|---|
| 33 | ** Notes:
|
|---|
| 34 | **
|
|---|
| 35 | ** 1) The TT date date1+date2 is a Julian Date, apportioned in any
|
|---|
| 36 | ** convenient way between the two arguments. For example,
|
|---|
| 37 | ** JD(TT)=2450123.7 could be expressed in any of these ways,
|
|---|
| 38 | ** among others:
|
|---|
| 39 | **
|
|---|
| 40 | ** date1 date2
|
|---|
| 41 | **
|
|---|
| 42 | ** 2450123.7 0.0 (JD method)
|
|---|
| 43 | ** 2451545.0 -1421.3 (J2000 method)
|
|---|
| 44 | ** 2400000.5 50123.2 (MJD method)
|
|---|
| 45 | ** 2450123.5 0.2 (date & time method)
|
|---|
| 46 | **
|
|---|
| 47 | ** The JD method is the most natural and convenient to use in
|
|---|
| 48 | ** cases where the loss of several decimal digits of resolution
|
|---|
| 49 | ** is acceptable. The J2000 method is best matched to the way
|
|---|
| 50 | ** the argument is handled internally and will deliver the
|
|---|
| 51 | ** optimum resolution. The MJD method and the date & time methods
|
|---|
| 52 | ** are both good compromises between resolution and convenience.
|
|---|
| 53 | **
|
|---|
| 54 | ** 2) The caller is responsible for providing the nutation components;
|
|---|
| 55 | ** they are in longitude and obliquity, in radians and are with
|
|---|
| 56 | ** respect to the equinox and ecliptic of date. For high-accuracy
|
|---|
| 57 | ** applications, free core nutation should be included as well as
|
|---|
| 58 | ** any other relevant corrections to the position of the CIP.
|
|---|
| 59 | **
|
|---|
| 60 | ** 3) The returned mean obliquity is consistent with the IAU 2006
|
|---|
| 61 | ** precession.
|
|---|
| 62 | **
|
|---|
| 63 | ** 4) The matrix rb transforms vectors from GCRS to J2000.0 mean
|
|---|
| 64 | ** equator and equinox by applying frame bias.
|
|---|
| 65 | **
|
|---|
| 66 | ** 5) The matrix rp transforms vectors from J2000.0 mean equator and
|
|---|
| 67 | ** equinox to mean equator and equinox of date by applying
|
|---|
| 68 | ** precession.
|
|---|
| 69 | **
|
|---|
| 70 | ** 6) The matrix rbp transforms vectors from GCRS to mean equator and
|
|---|
| 71 | ** equinox of date by applying frame bias then precession. It is
|
|---|
| 72 | ** the product rp x rb.
|
|---|
| 73 | **
|
|---|
| 74 | ** 7) The matrix rn transforms vectors from mean equator and equinox
|
|---|
| 75 | ** of date to true equator and equinox of date by applying the
|
|---|
| 76 | ** nutation (luni-solar + planetary).
|
|---|
| 77 | **
|
|---|
| 78 | ** 8) The matrix rbpn transforms vectors from GCRS to true equator and
|
|---|
| 79 | ** equinox of date. It is the product rn x rbp, applying frame
|
|---|
| 80 | ** bias, precession and nutation in that order.
|
|---|
| 81 | **
|
|---|
| 82 | ** 9) The X,Y,Z coordinates of the Celestial Intermediate Pole are
|
|---|
| 83 | ** elements (3,1-3) of the GCRS-to-true matrix, i.e. rbpn[2][0-2].
|
|---|
| 84 | **
|
|---|
| 85 | ** 10) It is permissible to re-use the same array in the returned
|
|---|
| 86 | ** arguments. The arrays are filled in the stated order.
|
|---|
| 87 | **
|
|---|
| 88 | ** Called:
|
|---|
| 89 | ** iauPfw06 bias-precession F-W angles, IAU 2006
|
|---|
| 90 | ** iauFw2m F-W angles to r-matrix
|
|---|
| 91 | ** iauCr copy r-matrix
|
|---|
| 92 | ** iauTr transpose r-matrix
|
|---|
| 93 | ** iauRxr product of two r-matrices
|
|---|
| 94 | **
|
|---|
| 95 | ** References:
|
|---|
| 96 | **
|
|---|
| 97 | ** Capitaine, N. & Wallace, P.T., 2006, Astron.Astrophys. 450, 855
|
|---|
| 98 | **
|
|---|
| 99 | ** Wallace, P.T. & Capitaine, N., 2006, Astron.Astrophys. 459, 981
|
|---|
| 100 | **
|
|---|
| 101 | ** This revision: 2013 November 14
|
|---|
| 102 | **
|
|---|
| 103 | ** SOFA release 2015-02-09
|
|---|
| 104 | **
|
|---|
| 105 | ** Copyright (C) 2015 IAU SOFA Board. See notes at end.
|
|---|
| 106 | */
|
|---|
| 107 | {
|
|---|
| 108 | double gamb, phib, psib, eps, r1[3][3], r2[3][3], rt[3][3];
|
|---|
| 109 |
|
|---|
| 110 | /* Bias-precession Fukushima-Williams angles of J2000.0 = frame bias. */
|
|---|
| 111 | iauPfw06(DJM0, DJM00, &gamb, &phib, &psib, &eps);
|
|---|
| 112 |
|
|---|
| 113 | /* B matrix. */
|
|---|
| 114 | iauFw2m(gamb, phib, psib, eps, r1);
|
|---|
| 115 | iauCr(r1, rb);
|
|---|
| 116 |
|
|---|
| 117 | /* Bias-precession Fukushima-Williams angles of date. */
|
|---|
| 118 | iauPfw06(date1, date2, &gamb, &phib, &psib, &eps);
|
|---|
| 119 |
|
|---|
| 120 | /* Bias-precession matrix. */
|
|---|
| 121 | iauFw2m(gamb, phib, psib, eps, r2);
|
|---|
| 122 | iauCr(r2, rbp);
|
|---|
| 123 |
|
|---|
| 124 | /* Solve for precession matrix. */
|
|---|
| 125 | iauTr(r1, rt);
|
|---|
| 126 | iauRxr(r2, rt, rp);
|
|---|
| 127 |
|
|---|
| 128 | /* Equinox-based bias-precession-nutation matrix. */
|
|---|
| 129 | iauFw2m(gamb, phib, psib + dpsi, eps + deps, r1);
|
|---|
| 130 | iauCr(r1, rbpn);
|
|---|
| 131 |
|
|---|
| 132 | /* Solve for nutation matrix. */
|
|---|
| 133 | iauTr(r2, rt);
|
|---|
| 134 | iauRxr(r1, rt, rn);
|
|---|
| 135 |
|
|---|
| 136 | /* Obliquity, mean of date. */
|
|---|
| 137 | *epsa = eps;
|
|---|
| 138 |
|
|---|
| 139 | return;
|
|---|
| 140 |
|
|---|
| 141 | /*----------------------------------------------------------------------
|
|---|
| 142 | **
|
|---|
| 143 | ** Copyright (C) 2015
|
|---|
| 144 | ** Standards Of Fundamental Astronomy Board
|
|---|
| 145 | ** of the International Astronomical Union.
|
|---|
| 146 | **
|
|---|
| 147 | ** =====================
|
|---|
| 148 | ** SOFA Software License
|
|---|
| 149 | ** =====================
|
|---|
| 150 | **
|
|---|
| 151 | ** NOTICE TO USER:
|
|---|
| 152 | **
|
|---|
| 153 | ** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
|
|---|
| 154 | ** CONDITIONS WHICH APPLY TO ITS USE.
|
|---|
| 155 | **
|
|---|
| 156 | ** 1. The Software is owned by the IAU SOFA Board ("SOFA").
|
|---|
| 157 | **
|
|---|
| 158 | ** 2. Permission is granted to anyone to use the SOFA software for any
|
|---|
| 159 | ** purpose, including commercial applications, free of charge and
|
|---|
| 160 | ** without payment of royalties, subject to the conditions and
|
|---|
| 161 | ** restrictions listed below.
|
|---|
| 162 | **
|
|---|
| 163 | ** 3. You (the user) may copy and distribute SOFA source code to others,
|
|---|
| 164 | ** and use and adapt its code and algorithms in your own software,
|
|---|
| 165 | ** on a world-wide, royalty-free basis. That portion of your
|
|---|
| 166 | ** distribution that does not consist of intact and unchanged copies
|
|---|
| 167 | ** of SOFA source code files is a "derived work" that must comply
|
|---|
| 168 | ** with the following requirements:
|
|---|
| 169 | **
|
|---|
| 170 | ** a) Your work shall be marked or carry a statement that it
|
|---|
| 171 | ** (i) uses routines and computations derived by you from
|
|---|
| 172 | ** software provided by SOFA under license to you; and
|
|---|
| 173 | ** (ii) does not itself constitute software provided by and/or
|
|---|
| 174 | ** endorsed by SOFA.
|
|---|
| 175 | **
|
|---|
| 176 | ** b) The source code of your derived work must contain descriptions
|
|---|
| 177 | ** of how the derived work is based upon, contains and/or differs
|
|---|
| 178 | ** from the original SOFA software.
|
|---|
| 179 | **
|
|---|
| 180 | ** c) The names of all routines in your derived work shall not
|
|---|
| 181 | ** include the prefix "iau" or "sofa" or trivial modifications
|
|---|
| 182 | ** thereof such as changes of case.
|
|---|
| 183 | **
|
|---|
| 184 | ** d) The origin of the SOFA components of your derived work must
|
|---|
| 185 | ** not be misrepresented; you must not claim that you wrote the
|
|---|
| 186 | ** original software, nor file a patent application for SOFA
|
|---|
| 187 | ** software or algorithms embedded in the SOFA software.
|
|---|
| 188 | **
|
|---|
| 189 | ** e) These requirements must be reproduced intact in any source
|
|---|
| 190 | ** distribution and shall apply to anyone to whom you have
|
|---|
| 191 | ** granted a further right to modify the source code of your
|
|---|
| 192 | ** derived work.
|
|---|
| 193 | **
|
|---|
| 194 | ** Note that, as originally distributed, the SOFA software is
|
|---|
| 195 | ** intended to be a definitive implementation of the IAU standards,
|
|---|
| 196 | ** and consequently third-party modifications are discouraged. All
|
|---|
| 197 | ** variations, no matter how minor, must be explicitly marked as
|
|---|
| 198 | ** such, as explained above.
|
|---|
| 199 | **
|
|---|
| 200 | ** 4. You shall not cause the SOFA software to be brought into
|
|---|
| 201 | ** disrepute, either by misuse, or use for inappropriate tasks, or
|
|---|
| 202 | ** by inappropriate modification.
|
|---|
| 203 | **
|
|---|
| 204 | ** 5. The SOFA software is provided "as is" and SOFA makes no warranty
|
|---|
| 205 | ** as to its use or performance. SOFA does not and cannot warrant
|
|---|
| 206 | ** the performance or results which the user may obtain by using the
|
|---|
| 207 | ** SOFA software. SOFA makes no warranties, express or implied, as
|
|---|
| 208 | ** to non-infringement of third party rights, merchantability, or
|
|---|
| 209 | ** fitness for any particular purpose. In no event will SOFA be
|
|---|
| 210 | ** liable to the user for any consequential, incidental, or special
|
|---|
| 211 | ** damages, including any lost profits or lost savings, even if a
|
|---|
| 212 | ** SOFA representative has been advised of such damages, or for any
|
|---|
| 213 | ** claim by any third party.
|
|---|
| 214 | **
|
|---|
| 215 | ** 6. The provision of any version of the SOFA software under the terms
|
|---|
| 216 | ** and conditions specified herein does not imply that future
|
|---|
| 217 | ** versions will also be made available under the same terms and
|
|---|
| 218 | ** conditions.
|
|---|
| 219 | *
|
|---|
| 220 | ** In any published work or commercial product which uses the SOFA
|
|---|
| 221 | ** software directly, acknowledgement (see www.iausofa.org) is
|
|---|
| 222 | ** appreciated.
|
|---|
| 223 | **
|
|---|
| 224 | ** Correspondence concerning SOFA software should be addressed as
|
|---|
| 225 | ** follows:
|
|---|
| 226 | **
|
|---|
| 227 | ** By email: sofa@ukho.gov.uk
|
|---|
| 228 | ** By post: IAU SOFA Center
|
|---|
| 229 | ** HM Nautical Almanac Office
|
|---|
| 230 | ** UK Hydrographic Office
|
|---|
| 231 | ** Admiralty Way, Taunton
|
|---|
| 232 | ** Somerset, TA1 2DN
|
|---|
| 233 | ** United Kingdom
|
|---|
| 234 | **
|
|---|
| 235 | **--------------------------------------------------------------------*/
|
|---|
| 236 | }
|
|---|