| 1 | #include "sofa.h"
|
|---|
| 2 |
|
|---|
| 3 | double iauEra00(double dj1, double dj2)
|
|---|
| 4 | /*
|
|---|
| 5 | ** - - - - - - - - -
|
|---|
| 6 | ** i a u E r a 0 0
|
|---|
| 7 | ** - - - - - - - - -
|
|---|
| 8 | **
|
|---|
| 9 | ** Earth rotation angle (IAU 2000 model).
|
|---|
| 10 | **
|
|---|
| 11 | ** This function is part of the International Astronomical Union's
|
|---|
| 12 | ** SOFA (Standards Of Fundamental Astronomy) software collection.
|
|---|
| 13 | **
|
|---|
| 14 | ** Status: canonical model.
|
|---|
| 15 | **
|
|---|
| 16 | ** Given:
|
|---|
| 17 | ** dj1,dj2 double UT1 as a 2-part Julian Date (see note)
|
|---|
| 18 | **
|
|---|
| 19 | ** Returned (function value):
|
|---|
| 20 | ** double Earth rotation angle (radians), range 0-2pi
|
|---|
| 21 | **
|
|---|
| 22 | ** Notes:
|
|---|
| 23 | **
|
|---|
| 24 | ** 1) The UT1 date dj1+dj2 is a Julian Date, apportioned in any
|
|---|
| 25 | ** convenient way between the arguments dj1 and dj2. For example,
|
|---|
| 26 | ** JD(UT1)=2450123.7 could be expressed in any of these ways,
|
|---|
| 27 | ** among others:
|
|---|
| 28 | **
|
|---|
| 29 | ** dj1 dj2
|
|---|
| 30 | **
|
|---|
| 31 | ** 2450123.7 0.0 (JD method)
|
|---|
| 32 | ** 2451545.0 -1421.3 (J2000 method)
|
|---|
| 33 | ** 2400000.5 50123.2 (MJD method)
|
|---|
| 34 | ** 2450123.5 0.2 (date & time method)
|
|---|
| 35 | **
|
|---|
| 36 | ** The JD method is the most natural and convenient to use in
|
|---|
| 37 | ** cases where the loss of several decimal digits of resolution
|
|---|
| 38 | ** is acceptable. The J2000 and MJD methods are good compromises
|
|---|
| 39 | ** between resolution and convenience. The date & time method is
|
|---|
| 40 | ** best matched to the algorithm used: maximum precision is
|
|---|
| 41 | ** delivered when the dj1 argument is for 0hrs UT1 on the day in
|
|---|
| 42 | ** question and the dj2 argument lies in the range 0 to 1, or vice
|
|---|
| 43 | ** versa.
|
|---|
| 44 | **
|
|---|
| 45 | ** 2) The algorithm is adapted from Expression 22 of Capitaine et al.
|
|---|
| 46 | ** 2000. The time argument has been expressed in days directly,
|
|---|
| 47 | ** and, to retain precision, integer contributions have been
|
|---|
| 48 | ** eliminated. The same formulation is given in IERS Conventions
|
|---|
| 49 | ** (2003), Chap. 5, Eq. 14.
|
|---|
| 50 | **
|
|---|
| 51 | ** Called:
|
|---|
| 52 | ** iauAnp normalize angle into range 0 to 2pi
|
|---|
| 53 | **
|
|---|
| 54 | ** References:
|
|---|
| 55 | **
|
|---|
| 56 | ** Capitaine N., Guinot B. and McCarthy D.D, 2000, Astron.
|
|---|
| 57 | ** Astrophys., 355, 398-405.
|
|---|
| 58 | **
|
|---|
| 59 | ** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
|
|---|
| 60 | ** IERS Technical Note No. 32, BKG (2004)
|
|---|
| 61 | **
|
|---|
| 62 | ** This revision: 2013 June 18
|
|---|
| 63 | **
|
|---|
| 64 | ** SOFA release 2015-02-09
|
|---|
| 65 | **
|
|---|
| 66 | ** Copyright (C) 2015 IAU SOFA Board. See notes at end.
|
|---|
| 67 | */
|
|---|
| 68 | {
|
|---|
| 69 | double d1, d2, t, f, theta;
|
|---|
| 70 |
|
|---|
| 71 | /* Days since fundamental epoch. */
|
|---|
| 72 | if (dj1 < dj2) {
|
|---|
| 73 | d1 = dj1;
|
|---|
| 74 | d2 = dj2;
|
|---|
| 75 | } else {
|
|---|
| 76 | d1 = dj2;
|
|---|
| 77 | d2 = dj1;
|
|---|
| 78 | }
|
|---|
| 79 | t = d1 + (d2- DJ00);
|
|---|
| 80 |
|
|---|
| 81 | /* Fractional part of T (days). */
|
|---|
| 82 | f = fmod(d1, 1.0) + fmod(d2, 1.0);
|
|---|
| 83 |
|
|---|
| 84 | /* Earth rotation angle at this UT1. */
|
|---|
| 85 | theta = iauAnp(D2PI * (f + 0.7790572732640
|
|---|
| 86 | + 0.00273781191135448 * t));
|
|---|
| 87 |
|
|---|
| 88 | return theta;
|
|---|
| 89 |
|
|---|
| 90 | /*----------------------------------------------------------------------
|
|---|
| 91 | **
|
|---|
| 92 | ** Copyright (C) 2015
|
|---|
| 93 | ** Standards Of Fundamental Astronomy Board
|
|---|
| 94 | ** of the International Astronomical Union.
|
|---|
| 95 | **
|
|---|
| 96 | ** =====================
|
|---|
| 97 | ** SOFA Software License
|
|---|
| 98 | ** =====================
|
|---|
| 99 | **
|
|---|
| 100 | ** NOTICE TO USER:
|
|---|
| 101 | **
|
|---|
| 102 | ** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
|
|---|
| 103 | ** CONDITIONS WHICH APPLY TO ITS USE.
|
|---|
| 104 | **
|
|---|
| 105 | ** 1. The Software is owned by the IAU SOFA Board ("SOFA").
|
|---|
| 106 | **
|
|---|
| 107 | ** 2. Permission is granted to anyone to use the SOFA software for any
|
|---|
| 108 | ** purpose, including commercial applications, free of charge and
|
|---|
| 109 | ** without payment of royalties, subject to the conditions and
|
|---|
| 110 | ** restrictions listed below.
|
|---|
| 111 | **
|
|---|
| 112 | ** 3. You (the user) may copy and distribute SOFA source code to others,
|
|---|
| 113 | ** and use and adapt its code and algorithms in your own software,
|
|---|
| 114 | ** on a world-wide, royalty-free basis. That portion of your
|
|---|
| 115 | ** distribution that does not consist of intact and unchanged copies
|
|---|
| 116 | ** of SOFA source code files is a "derived work" that must comply
|
|---|
| 117 | ** with the following requirements:
|
|---|
| 118 | **
|
|---|
| 119 | ** a) Your work shall be marked or carry a statement that it
|
|---|
| 120 | ** (i) uses routines and computations derived by you from
|
|---|
| 121 | ** software provided by SOFA under license to you; and
|
|---|
| 122 | ** (ii) does not itself constitute software provided by and/or
|
|---|
| 123 | ** endorsed by SOFA.
|
|---|
| 124 | **
|
|---|
| 125 | ** b) The source code of your derived work must contain descriptions
|
|---|
| 126 | ** of how the derived work is based upon, contains and/or differs
|
|---|
| 127 | ** from the original SOFA software.
|
|---|
| 128 | **
|
|---|
| 129 | ** c) The names of all routines in your derived work shall not
|
|---|
| 130 | ** include the prefix "iau" or "sofa" or trivial modifications
|
|---|
| 131 | ** thereof such as changes of case.
|
|---|
| 132 | **
|
|---|
| 133 | ** d) The origin of the SOFA components of your derived work must
|
|---|
| 134 | ** not be misrepresented; you must not claim that you wrote the
|
|---|
| 135 | ** original software, nor file a patent application for SOFA
|
|---|
| 136 | ** software or algorithms embedded in the SOFA software.
|
|---|
| 137 | **
|
|---|
| 138 | ** e) These requirements must be reproduced intact in any source
|
|---|
| 139 | ** distribution and shall apply to anyone to whom you have
|
|---|
| 140 | ** granted a further right to modify the source code of your
|
|---|
| 141 | ** derived work.
|
|---|
| 142 | **
|
|---|
| 143 | ** Note that, as originally distributed, the SOFA software is
|
|---|
| 144 | ** intended to be a definitive implementation of the IAU standards,
|
|---|
| 145 | ** and consequently third-party modifications are discouraged. All
|
|---|
| 146 | ** variations, no matter how minor, must be explicitly marked as
|
|---|
| 147 | ** such, as explained above.
|
|---|
| 148 | **
|
|---|
| 149 | ** 4. You shall not cause the SOFA software to be brought into
|
|---|
| 150 | ** disrepute, either by misuse, or use for inappropriate tasks, or
|
|---|
| 151 | ** by inappropriate modification.
|
|---|
| 152 | **
|
|---|
| 153 | ** 5. The SOFA software is provided "as is" and SOFA makes no warranty
|
|---|
| 154 | ** as to its use or performance. SOFA does not and cannot warrant
|
|---|
| 155 | ** the performance or results which the user may obtain by using the
|
|---|
| 156 | ** SOFA software. SOFA makes no warranties, express or implied, as
|
|---|
| 157 | ** to non-infringement of third party rights, merchantability, or
|
|---|
| 158 | ** fitness for any particular purpose. In no event will SOFA be
|
|---|
| 159 | ** liable to the user for any consequential, incidental, or special
|
|---|
| 160 | ** damages, including any lost profits or lost savings, even if a
|
|---|
| 161 | ** SOFA representative has been advised of such damages, or for any
|
|---|
| 162 | ** claim by any third party.
|
|---|
| 163 | **
|
|---|
| 164 | ** 6. The provision of any version of the SOFA software under the terms
|
|---|
| 165 | ** and conditions specified herein does not imply that future
|
|---|
| 166 | ** versions will also be made available under the same terms and
|
|---|
| 167 | ** conditions.
|
|---|
| 168 | *
|
|---|
| 169 | ** In any published work or commercial product which uses the SOFA
|
|---|
| 170 | ** software directly, acknowledgement (see www.iausofa.org) is
|
|---|
| 171 | ** appreciated.
|
|---|
| 172 | **
|
|---|
| 173 | ** Correspondence concerning SOFA software should be addressed as
|
|---|
| 174 | ** follows:
|
|---|
| 175 | **
|
|---|
| 176 | ** By email: sofa@ukho.gov.uk
|
|---|
| 177 | ** By post: IAU SOFA Center
|
|---|
| 178 | ** HM Nautical Almanac Office
|
|---|
| 179 | ** UK Hydrographic Office
|
|---|
| 180 | ** Admiralty Way, Taunton
|
|---|
| 181 | ** Somerset, TA1 2DN
|
|---|
| 182 | ** United Kingdom
|
|---|
| 183 | **
|
|---|
| 184 | **--------------------------------------------------------------------*/
|
|---|
| 185 | }
|
|---|