Coverage Report

Created: 2026-09-04 06:48

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/atcc13.rs
Line
Count
Source
1
use super::{IauAstrom, apci13, atccq};
2
3
///  Catalog -> astrometric.
4
///
5
///  Transform a star's ICRS catalog entry (epoch J2000.0) into ICRS
6
///  astrometric place.
7
///
8
///  This function is part of the International Astronomical Union's
9
///  SOFA (Standards of Fundamental Astronomy) software collection.
10
///
11
///  Status:  support function.
12
///
13
///  Given:
14
///  ```
15
///     rc     double   ICRS right ascension at J2000.0 (radians, Note 1)
16
///     dc     double   ICRS declination at J2000.0 (radians, Note 1)
17
///     pr     double   RA proper motion (radians/year, Note 2)
18
///     pd     double   Dec proper motion (radians/year)
19
///     px     double   parallax (arcsec)
20
///     rv     double   radial velocity (km/s, +ve if receding)
21
///     date1  double   TDB as a 2-part...
22
///     date2  double   ...Julian Date (Note 3)
23
///  ```
24
///  Returned:
25
///     ra,da  double*  ICRS astrometric RA,Dec (radians)
26
///
27
///  Notes:
28
///
29
///  1) Star data for an epoch other than J2000.0 (for example from the
30
///     Hipparcos catalog, which has an epoch of J1991.25) will require a
31
///     preliminary call to iauPmsafe before use.
32
///
33
///  2) The proper motion in RA is dRA/dt rather than cos(Dec)*dRA/dt.
34
///
35
///  3) The TDB date date1+date2 is a Julian Date, apportioned in any
36
///     convenient way between the two arguments.  For example,
37
///     JD(TDB)=2450123.7 could be expressed in any of these ways, among
38
///     others:
39
///  ```
40
///            date1          date2
41
///
42
///         2450123.7           0.0       (JD method)
43
///         2451545.0       -1421.3       (J2000 method)
44
///         2400000.5       50123.2       (MJD method)
45
///         2450123.5           0.2       (date & time method)
46
///  ```
47
///     The JD method is the most natural and convenient to use in cases
48
///     where the loss of several decimal digits of resolution is
49
///     acceptable.  The J2000 method is best matched to the way the
50
///     argument is handled internally and will deliver the optimum
51
///     resolution.  The MJD method and the date & time methods are both
52
///     good compromises between resolution and convenience.  For most
53
///     applications of this function the choice will not be at all
54
///     critical.
55
///
56
///     TT can be used instead of TDB without any significant impact on
57
///     accuracy.
58
///
59
///  Called:
60
///  ```
61
///     iauApci13    astrometry parameters, ICRS-CIRS, 2013
62
///     iauAtccq     quick catalog ICRS to astrometric
63
///  ```
64
0
pub fn atcc13(
65
0
    rc: f64,
66
0
    dc: f64,
67
0
    pr: f64,
68
0
    pd: f64,
69
0
    px: f64,
70
0
    rv: f64,
71
0
    date1: f64,
72
0
    date2: f64,
73
0
) -> (f64, f64) {
74
    /* Star-independent astrometry parameters */
75
0
    let astrom = &mut IauAstrom::default();
76
0
    let w = &mut 0.0;
77
78
    /* The transformation parameters. */
79
0
    apci13(date1, date2, astrom, w);
80
81
    /* Catalog ICRS (epoch J2000.0) to astrometric. */
82
0
    let (ra, da) = atccq(rc, dc, pr, pd, px, rv, astrom);
83
84
0
    (ra, da)
85
0
}