Coverage Report

Created: 2026-07-30 06:46

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/s06a.rs
Line
Count
Source
1
use super::{bpn2xy, pnm06a, s06};
2
3
/// The CIO locator s, positioning the Celestial Intermediate Origin on
4
/// the equator of the Celestial Intermediate Pole, using the IAU 2006
5
/// precession and IAU 2000A nutation models.
6
///
7
/// This function is part of the International Astronomical Union's
8
/// SOFA (Standards of Fundamental Astronomy) software collection.
9
///
10
/// Status:  support function.
11
///
12
/// Given:
13
///    date1,date2  f64    TT as a 2-part Julian Date (Note 1)
14
///
15
/// Returned (function value):
16
///                 f64    the CIO locator s in radians (Note 2)
17
///
18
/// Notes:
19
///
20
/// 1) The TT date date1+date2 is a Julian Date, apportioned in any
21
///    convenient way between the two arguments.  For example,
22
///    JD(TT)=2450123.7 could be expressed in any of these ways,
23
///    among others:
24
///
25
/// ```text
26
///           date1          date2
27
///
28
///        2450123.7           0.0       (JD method)
29
///        2451545.0       -1421.3       (J2000 method)
30
///        2400000.5       50123.2       (MJD method)
31
///        2450123.5           0.2       (date & time method)
32
/// ```
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.  The J2000 method is best matched to the way
37
///    the argument is handled internally and will deliver the
38
///    optimum resolution.  The MJD method and the date & time methods
39
///    are both good compromises between resolution and convenience.
40
///
41
/// 2) The CIO locator s is the difference between the right ascensions
42
///    of the same point in two systems.  The two systems are the GCRS
43
///    and the CIP,CIO, and the point is the ascending node of the
44
///    CIP equator.  The CIO locator s remains a small fraction of
45
///    1 arcsecond throughout 1900-2100.
46
///
47
/// 3) The series used to compute s is in fact for s+XY/2, where X and Y
48
///    are the x and y components of the CIP unit vector;  this series is
49
///    more compact than a direct series for s would be.  The present
50
///    function uses the full IAU 2000A nutation model when predicting
51
///    the CIP position.
52
///
53
/// References:
54
///
55
///    Capitaine, N., Chapront, J., Lambert, S. and Wallace, P.,
56
///    "Expressions for the Celestial Intermediate Pole and Celestial
57
///    Ephemeris Origin consistent with the IAU 2000A precession-
58
///    nutation model", Astron.Astrophys. 400, 1145-1154 (2003)
59
///
60
///    n.b. The celestial ephemeris origin (CEO) was renamed "celestial
61
///         intermediate origin" (CIO) by IAU 2006 Resolution 2.
62
///
63
///    Capitaine, N. & Wallace, P.T., 2006, Astron.Astrophys. 450, 855
64
///
65
///    McCarthy, D. D., Petit, G. (eds.), 2004, IERS Conventions (2003),
66
///    IERS Technical Note No. 32, BKG
67
///
68
///    Wallace, P.T. & Capitaine, N., 2006, Astron.Astrophys. 459, 981
69
0
pub fn s06a(date1: f64, date2: f64) -> f64 {
70
    /* Bias-precession-nutation-matrix, IAU 20006/2000A. */
71
0
    let rnpb = pnm06a(date1, date2);
72
73
    /* Extract the CIP coordinates. */
74
0
    let (x, y) = bpn2xy(&rnpb);
75
76
    /* Compute the CIO locator s, given the CIP coordinates. */
77
0
    s06(date1, date2, x, y)
78
0
}