FACT++  1.0
gst06.c
Go to the documentation of this file.
1 #include "erfa.h"
2 
3 double eraGst06(double uta, double utb, double tta, double ttb,
4  double rnpb[3][3])
5 /*
6 ** - - - - - - - - -
7 ** e r a G s t 0 6
8 ** - - - - - - - - -
9 **
10 ** Greenwich apparent sidereal time, IAU 2006, given the NPB matrix.
11 **
12 ** Given:
13 ** uta,utb double UT1 as a 2-part Julian Date (Notes 1,2)
14 ** tta,ttb double TT as a 2-part Julian Date (Notes 1,2)
15 ** rnpb double[3][3] nutation x precession x bias matrix
16 **
17 ** Returned (function value):
18 ** double Greenwich apparent sidereal time (radians)
19 **
20 ** Notes:
21 **
22 ** 1) The UT1 and TT dates uta+utb and tta+ttb respectively, are both
23 ** Julian Dates, apportioned in any convenient way between the
24 ** argument pairs. For example, JD=2450123.7 could be expressed in
25 ** any of these ways, among others:
26 **
27 ** Part A Part B
28 **
29 ** 2450123.7 0.0 (JD method)
30 ** 2451545.0 -1421.3 (J2000 method)
31 ** 2400000.5 50123.2 (MJD method)
32 ** 2450123.5 0.2 (date & time method)
33 **
34 ** The JD method is the most natural and convenient to use in
35 ** cases where the loss of several decimal digits of resolution
36 ** is acceptable (in the case of UT; the TT is not at all critical
37 ** in this respect). The J2000 and MJD methods are good compromises
38 ** between resolution and convenience. For UT, the date & time
39 ** method is best matched to the algorithm that is used by the Earth
40 ** rotation angle function, called internally: maximum precision is
41 ** delivered when the uta argument is for 0hrs UT1 on the day in
42 ** question and the utb argument lies in the range 0 to 1, or vice
43 ** versa.
44 **
45 ** 2) Both UT1 and TT are required, UT1 to predict the Earth rotation
46 ** and TT to predict the effects of precession-nutation. If UT1 is
47 ** used for both purposes, errors of order 100 microarcseconds
48 ** result.
49 **
50 ** 3) Although the function uses the IAU 2006 series for s+XY/2, it is
51 ** otherwise independent of the precession-nutation model and can in
52 ** practice be used with any equinox-based NPB matrix.
53 **
54 ** 4) The result is returned in the range 0 to 2pi.
55 **
56 ** Called:
57 ** eraBpn2xy extract CIP X,Y coordinates from NPB matrix
58 ** eraS06 the CIO locator s, given X,Y, IAU 2006
59 ** eraAnp normalize angle into range 0 to 2pi
60 ** eraEra00 Earth rotation angle, IAU 2000
61 ** eraEors equation of the origins, given NPB matrix and s
62 **
63 ** Reference:
64 **
65 ** Wallace, P.T. & Capitaine, N., 2006, Astron.Astrophys. 459, 981
66 **
67 ** Copyright (C) 2013-2015, NumFOCUS Foundation.
68 ** Derived, with permission, from the SOFA library. See notes at end of file.
69 */
70 {
71  double x, y, s, era, eors, gst;
72 
73 /* Extract CIP coordinates. */
74  eraBpn2xy(rnpb, &x, &y);
75 
76 /* The CIO locator, s. */
77  s = eraS06(tta, ttb, x, y);
78 
79 /* Greenwich apparent sidereal time. */
80  era = eraEra00(uta, utb);
81  eors = eraEors(rnpb, s);
82  gst = eraAnp(era - eors);
83 
84  return gst;
85 
86 }
87 /*----------------------------------------------------------------------
88 **
89 **
90 ** Copyright (C) 2013-2015, NumFOCUS Foundation.
91 ** All rights reserved.
92 **
93 ** This library is derived, with permission, from the International
94 ** Astronomical Union's "Standards of Fundamental Astronomy" library,
95 ** available from http://www.iausofa.org.
96 **
97 ** The ERFA version is intended to retain identical functionality to
98 ** the SOFA library, but made distinct through different function and
99 ** file names, as set out in the SOFA license conditions. The SOFA
100 ** original has a role as a reference standard for the IAU and IERS,
101 ** and consequently redistribution is permitted only in its unaltered
102 ** state. The ERFA version is not subject to this restriction and
103 ** therefore can be included in distributions which do not support the
104 ** concept of "read only" software.
105 **
106 ** Although the intent is to replicate the SOFA API (other than
107 ** replacement of prefix names) and results (with the exception of
108 ** bugs; any that are discovered will be fixed), SOFA is not
109 ** responsible for any errors found in this version of the library.
110 **
111 ** If you wish to acknowledge the SOFA heritage, please acknowledge
112 ** that you are using a library derived from SOFA, rather than SOFA
113 ** itself.
114 **
115 **
116 ** TERMS AND CONDITIONS
117 **
118 ** Redistribution and use in source and binary forms, with or without
119 ** modification, are permitted provided that the following conditions
120 ** are met:
121 **
122 ** 1 Redistributions of source code must retain the above copyright
123 ** notice, this list of conditions and the following disclaimer.
124 **
125 ** 2 Redistributions in binary form must reproduce the above copyright
126 ** notice, this list of conditions and the following disclaimer in
127 ** the documentation and/or other materials provided with the
128 ** distribution.
129 **
130 ** 3 Neither the name of the Standards Of Fundamental Astronomy Board,
131 ** the International Astronomical Union nor the names of its
132 ** contributors may be used to endorse or promote products derived
133 ** from this software without specific prior written permission.
134 **
135 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
136 ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
137 ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
138 ** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
139 ** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
140 ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
141 ** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
142 ** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
143 ** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
144 ** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
145 ** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
146 ** POSSIBILITY OF SUCH DAMAGE.
147 **
148 */
double eraGst06(double uta, double utb, double tta, double ttb, double rnpb[3][3])
Definition: gst06.c:3
void eraBpn2xy(double rbpn[3][3], double *x, double *y)
Definition: bpn2xy.c:3
double eraEra00(double dj1, double dj2)
Definition: era00.c:3
double eraS06(double date1, double date2, double x, double y)
Definition: s06.c:3
double eraAnp(double a)
Definition: anp.c:3
double eraEors(double rnpb[3][3], double s)
Definition: eors.c:3