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/pnp/sp00.rs
Line
Count
Source
1
use crate::consts::{DAS2R, DJ00, DJC};
2
3
///  The TIO locator s', positioning the Terrestrial Intermediate Origin
4
///  on the equator of the Celestial Intermediate Pole.
5
///
6
///  Given:
7
///     date1,date2  f64       TT as a 2-part Julian Date (Note 1)
8
///
9
///  Returned (function value):
10
///                  f64       the TIO locator s' in radians (Note 2)
11
///
12
///  Notes:
13
///
14
///  1) The TT date date1+date2 is a Julian Date, apportioned in any
15
///     convenient way between the two arguments.  For example,
16
///     JD(TT)=2450123.7 could be expressed in any of these ways,
17
///     among others:
18
///
19
///            date1          date2
20
///
21
///         2450123.7           0.0       (JD method)
22
///         2451545.0       -1421.3       (J2000 method)
23
///         2400000.5       50123.2       (MJD method)
24
///         2450123.5           0.2       (date & time method)
25
///
26
///     The JD method is the most natural and convenient to use in
27
///     cases where the loss of several decimal digits of resolution
28
///     is acceptable.  The J2000 method is best matched to the way
29
///     the argument is handled internally and will deliver the
30
///     optimum resolution.  The MJD method and the date & time methods
31
///     are both good compromises between resolution and convenience.
32
///
33
///  2) The TIO locator s' is obtained from polar motion observations by
34
///     numerical integration, and so is in essence unpredictable.
35
///     However, it is dominated by a secular drift of about
36
///     47 microarcseconds per century, which is the approximation
37
///     evaluated by the present function.
38
///
39
///  Reference:
40
///
41
///     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
42
///     IERS Technical Note No. 32, BKG (2004)
43
0
pub fn sp00(date1: f64, date2: f64) -> f64 {
44
    // Interval between fundamental epoch J2000.0 and current date (JC).
45
0
    let t = ((date1 - DJ00) + date2) / DJC;
46
47
    // Approximate s'.
48
0
    -47e-6 * t * DAS2R
49
0
}