Coverage Report

Created: 2026-05-16 06:09

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/rust/registry/src/index.crates.io-1949cf8c6b5b557f/sofars-0.6.1/src/astro/apcg.rs
Line
Count
Source
1
use super::{IauAstrom, apcs};
2
///  Prepare for ICRS <−> GCRS, geocentric, special
3
///
4
///  For a geocentric observer, prepare star-independent astrometry
5
///  parameters for transformations between ICRS and GCRS coordinates.
6
///  The Earth ephemeris is supplied by the caller.
7
///
8
///  The parameters produced by this function are required in the
9
///  parallax, light deflection and aberration parts of the astrometric
10
///  transformation chain.
11
///
12
///  This function is part of the International Astronomical Union's
13
///  SOFA (Standards of Fundamental Astronomy) software collection.
14
///
15
///  Status:  support function.
16
///
17
///  Given:
18
///  ```
19
///     date1  double       TDB as a 2-part...
20
///     date2  double       ...Julian Date (Note 1)
21
///     ebpv   double[2][3] Earth barycentric pos/vel (au, au/day)
22
///     ehp    double[3]    Earth heliocentric position (au)
23
///  ```
24
///  Returned:
25
///  ```
26
///     astrom iauASTROM*   star-independent astrometry parameters:
27
///      pmt    double       PM time interval (SSB, Julian years)
28
///      eb     double[3]    SSB to observer (vector, au)
29
///      eh     double[3]    Sun to observer (unit vector)
30
///      em     double       distance from Sun to observer (au)
31
///      v      double[3]    barycentric observer velocity (vector, c)
32
///      bm1    double       sqrt(1-|v|^2): reciprocal of Lorenz factor
33
///      bpn    double[3][3] bias-precession-nutation matrix
34
///      along  double       unchanged
35
///      xpl    double       unchanged
36
///      ypl    double       unchanged
37
///      sphi   double       unchanged
38
///      cphi   double       unchanged
39
///      diurab double       unchanged
40
///      eral   double       unchanged
41
///      refa   double       unchanged
42
///      refb   double       unchanged
43
///  ```
44
///  Notes:
45
///
46
///  1) The TDB date date1+date2 is a Julian Date, apportioned in any
47
///     convenient way between the two arguments.  For example,
48
///     JD(TDB)=2450123.7 could be expressed in any of these ways, among
49
///     others:
50
///  ```
51
///            date1          date2
52
///
53
///         2450123.7           0.0       (JD method)
54
///         2451545.0       -1421.3       (J2000 method)
55
///         2400000.5       50123.2       (MJD method)
56
///         2450123.5           0.2       (date & time method)
57
///  ```
58
///     The JD method is the most natural and convenient to use in cases
59
///     where the loss of several decimal digits of resolution is
60
///     acceptable.  The J2000 method is best matched to the way the
61
///     argument is handled internally and will deliver the optimum
62
///     resolution.  The MJD method and the date & time methods are both
63
///     good compromises between resolution and convenience.  For most
64
///     applications of this function the choice will not be at all
65
///     critical.
66
///
67
///     TT can be used instead of TDB without any significant impact on
68
///     accuracy.
69
///
70
///  2) All the vectors are with respect to BCRS axes.
71
///
72
///  3) This is one of several functions that inserts into the astrom
73
///     structure star-independent parameters needed for the chain of
74
///     astrometric transformations ICRS <-> GCRS <-> CIRS <-> observed.
75
///
76
///     The various functions support different classes of observer and
77
///     portions of the transformation chain:
78
///  ```
79
///          functions         observer        transformation
80
///
81
///       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
82
///       iauApci iauApci13    terrestrial     ICRS <-> CIRS
83
///       iauApco iauApco13    terrestrial     ICRS <-> observed
84
///       iauApcs iauApcs13    space           ICRS <-> GCRS
85
///       iauAper iauAper13    terrestrial     update Earth rotation
86
///       iauApio iauApio13    terrestrial     CIRS <-> observed
87
///  ```
88
///     Those with names ending in "13" use contemporary SOFA models to
89
///     compute the various ephemerides.  The others accept ephemerides
90
///     supplied by the caller.
91
///
92
///     The transformation from ICRS to GCRS covers space motion,
93
///     parallax, light deflection, and aberration.  From GCRS to CIRS
94
///     comprises frame bias and precession-nutation.  From CIRS to
95
///     observed takes account of Earth rotation, polar motion, diurnal
96
///     aberration and parallax (unless subsumed into the ICRS <-> GCRS
97
///     transformation), and atmospheric refraction.
98
///
99
///  4) The context structure astrom produced by this function is used by
100
///     iauAtciq* and iauAticq*.
101
///
102
///  Called:
103
///  ```
104
///     iauApcs      astrometry parameters, ICRS-GCRS, space observer
105
///  ```
106
0
pub fn apcg(date1: f64, date2: f64, ebpv: &[[f64; 3]; 2], ehp: &[f64; 3], astrom: &mut IauAstrom) {
107
    /* Geocentric observer */
108
0
    let pv = [[0.0; 3]; 2];
109
110
    /* Compute the star-independent astrometry parameters. */
111
0
    apcs(date1, date2, &pv, ebpv, ehp, astrom);
112
0
}