Coverage Report

Created: 2026-09-14 07:01

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/rust/registry/src/index.crates.io-1949cf8c6b5b557f/sofars-0.6.1/src/erst/gst00b.rs
Line
Count
Source
1
use crate::vm::anp;
2
3
use super::{ee00b, gmst00};
4
5
///  Greenwich apparent sidereal time, IAU 2000B
6
///
7
///  Greenwich apparent sidereal time (consistent with IAU 2000
8
///  resolutions but using the truncated nutation model IAU 2000B).
9
///
10
///  This function is part of the International Astronomical Union's
11
///  SOFA (Standards of Fundamental Astronomy) software collection.
12
///
13
///  Status:  support function.
14
///
15
///  Given:
16
///  ```
17
///     uta,utb    double    UT1 as a 2-part Julian Date (Notes 1,2)
18
///  ```
19
///  Returned (function value):
20
///  ```
21
///                double    Greenwich apparent sidereal time (radians)
22
///  ```
23
///  Notes:
24
///
25
///  1) The UT1 date uta+utb is a Julian Date, apportioned in any
26
///     convenient way between the argument pair.  For example,
27
///     JD(UT1)=2450123.7 could be expressed in any of these ways,
28
///     among others:
29
///  ```
30
///             uta            utb
31
///
32
///         2450123.7           0.0       (JD method)
33
///         2451545.0       -1421.3       (J2000 method)
34
///         2400000.5       50123.2       (MJD method)
35
///         2450123.5           0.2       (date & time method)
36
///  ```
37
///     The JD method is the most natural and convenient to use in cases
38
///     where the loss of several decimal digits of resolution is
39
///     acceptable.  The J2000 and MJD methods are good compromises
40
///     between resolution and convenience.  For UT, the date & time
41
///     method is best matched to the algorithm that is used by the Earth
42
///     Rotation Angle function, called internally:  maximum precision is
43
///     delivered when the uta argument is for 0hrs UT1 on the day in
44
///     question and the utb argument lies in the range 0 to 1, or vice
45
///     versa.
46
///
47
///  2) The result is compatible with the IAU 2000 resolutions, except
48
///     that accuracy has been compromised for the sake of speed and
49
///     convenience in two respects:
50
///
51
///     . UT is used instead of TDB (or TT) to compute the precession
52
///       component of GMST and the equation of the equinoxes.  This
53
///       results in errors of order 0.1 mas at present.
54
///
55
///     . The IAU 2000B abridged nutation model (McCarthy & Luzum, 2003)
56
///       is used, introducing errors of up to 1 mas.
57
///
58
///  3) This GAST is compatible with the IAU 2000 resolutions and must be
59
///     used only in conjunction with other IAU 2000 compatible
60
///     components such as precession-nutation.
61
///
62
///  4) The result is returned in the range 0 to 2pi.
63
///
64
///  5) The algorithm is from Capitaine et al. (2003) and IERS
65
///     Conventions 2003.
66
///
67
///  Called:
68
///  ```
69
///     iauGmst00    Greenwich mean sidereal time, IAU 2000
70
///     iauEe00b     equation of the equinoxes, IAU 2000B
71
///     iauAnp       normalize angle into range 0 to 2pi
72
///  ```
73
///  References:
74
///
75
///     Capitaine, N., Wallace, P.T. and McCarthy, D.D., "Expressions to
76
///     implement the IAU 2000 definition of UT1", Astronomy &
77
///     Astrophysics, 406, 1135-1149 (2003)
78
///
79
///     McCarthy, D.D. & Luzum, B.J., "An abridged model of the
80
///     precession-nutation of the celestial pole", Celestial Mechanics &
81
///     Dynamical Astronomy, 85, 37-49 (2003)
82
///
83
///     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
84
///     IERS Technical Note No. 32, BKG (2004)
85
///
86
0
pub fn gst00b(uta: f64, utb: f64) -> f64 {
87
0
    let gmst00 = gmst00(uta, utb, uta, utb);
88
0
    let ee00b = ee00b(uta, utb);
89
0
    let gst = anp(gmst00 + ee00b);
90
91
0
    gst
92
0
}