/rust/registry/src/index.crates.io-1949cf8c6b5b557f/sofars-0.6.1/src/erst/gst00a.rs
Line | Count | Source |
1 | | use crate::vm::anp; |
2 | | |
3 | | use super::{ee00a, gmst00}; |
4 | | |
5 | | /// Greenwich apparent sidereal time, IAU 2000A |
6 | | /// |
7 | | /// Greenwich apparent sidereal time (consistent with IAU 2000 |
8 | | /// resolutions). |
9 | | /// |
10 | | /// This function is part of the International Astronomical Union's |
11 | | /// SOFA (Standards of Fundamental Astronomy) software collection. |
12 | | /// |
13 | | /// Status: canonical model. |
14 | | /// |
15 | | /// Given: |
16 | | /// ``` |
17 | | /// uta,utb double UT1 as a 2-part Julian Date (Notes 1,2) |
18 | | /// tta,ttb double TT as a 2-part Julian Date (Notes 1,2) |
19 | | /// ``` |
20 | | /// Returned (function value): |
21 | | /// ``` |
22 | | /// double Greenwich apparent sidereal time (radians) |
23 | | /// ``` |
24 | | /// Notes: |
25 | | /// |
26 | | /// 1) The UT1 and TT dates uta+utb and tta+ttb respectively, are both |
27 | | /// Julian Dates, apportioned in any convenient way between the |
28 | | /// argument pairs. For example, JD(UT1)=2450123.7 could be |
29 | | /// expressed in any of these ways, among others: |
30 | | /// ``` |
31 | | /// uta utb |
32 | | /// |
33 | | /// 2450123.7 0.0 (JD method) |
34 | | /// 2451545.0 -1421.3 (J2000 method) |
35 | | /// 2400000.5 50123.2 (MJD method) |
36 | | /// 2450123.5 0.2 (date & time method) |
37 | | /// ``` |
38 | | /// The JD method is the most natural and convenient to use in |
39 | | /// cases where the loss of several decimal digits of resolution |
40 | | /// is acceptable (in the case of UT; the TT is not at all critical |
41 | | /// in this respect). The J2000 and MJD methods are good compromises |
42 | | /// between resolution and convenience. For UT, the date & time |
43 | | /// method is best matched to the algorithm that is used by the Earth |
44 | | /// Rotation Angle function, called internally: maximum precision is |
45 | | /// delivered when the uta argument is for 0hrs UT1 on the day in |
46 | | /// question and the utb argument lies in the range 0 to 1, or vice |
47 | | /// versa. |
48 | | /// |
49 | | /// 2) Both UT1 and TT are required, UT1 to predict the Earth rotation |
50 | | /// and TT to predict the effects of precession-nutation. If UT1 is |
51 | | /// used for both purposes, errors of order 100 microarcseconds |
52 | | /// result. |
53 | | /// |
54 | | /// 3) This GAST is compatible with the IAU 2000 resolutions and must be |
55 | | /// used only in conjunction with other IAU 2000 compatible |
56 | | /// components such as precession-nutation. |
57 | | /// |
58 | | /// 4) The result is returned in the range 0 to 2pi. |
59 | | /// |
60 | | /// 5) The algorithm is from Capitaine et al. (2003) and IERS |
61 | | /// Conventions 2003. |
62 | | /// |
63 | | /// Called: |
64 | | /// ``` |
65 | | /// iauGmst00 Greenwich mean sidereal time, IAU 2000 |
66 | | /// iauEe00a equation of the equinoxes, IAU 2000A |
67 | | /// iauAnp normalize angle into range 0 to 2pi |
68 | | /// ``` |
69 | | /// References: |
70 | | /// |
71 | | /// Capitaine, N., Wallace, P.T. and McCarthy, D.D., "Expressions to |
72 | | /// implement the IAU 2000 definition of UT1", Astronomy & |
73 | | /// Astrophysics, 406, 1135-1149 (2003) |
74 | | /// |
75 | | /// McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), |
76 | | /// IERS Technical Note No. 32, BKG (2004) |
77 | | /// |
78 | 0 | pub fn gst00a(uta: f64, utb: f64, tta: f64, ttb: f64) -> f64 { |
79 | 0 | let gmst00 = gmst00(uta, utb, tta, ttb); |
80 | 0 | let ee00a = ee00a(tta, ttb); |
81 | 0 | let gst = anp(gmst00 + ee00a); |
82 | | |
83 | 0 | gst |
84 | 0 | } |