Skip to main content

sofars/astro/
atic13.rs

1use super::{IauAstrom, apci13, aticq};
2
3///  Transform star RA,Dec from geocentric CIRS to ICRS astrometric.
4///
5///  This function is part of the International Astronomical Union's
6///  SOFA (Standards of Fundamental Astronomy) software collection.
7///
8///  Status:  support function.
9///
10///  Given:
11///  ```
12///     ri,di  double  CIRS geocentric RA,Dec (radians)
13///     date1  double  TDB as a 2-part...
14///     date2  double  ...Julian Date (Note 1)
15///  ```
16///
17///  Returned:
18///  ```
19///     rc,dc  double  ICRS astrometric RA,Dec (radians)
20///     eo     double  equation of the origins (ERA-GST, radians, Note 4)
21///  ```
22///  Notes:
23///
24///  1) The TDB date date1+date2 is a Julian Date, apportioned in any
25///     convenient way between the two arguments.  For example,
26///     JD(TDB)=2450123.7 could be expressed in any of these ways, among
27///     others:
28///  ```
29///
30///            date1          date2
31///
32///         2450123.7           0.0       (JD method)
33///         2451545.0       -1421.3       (J2000 method)
34///         2400000.5       50123.2       (MJD method)
35///         2450123.5           0.2       (date & time method)
36///  ```
37///     The JD method is the most natural and convenient to use in cases
38///     where the loss of several decimal digits of resolution is
39///     acceptable.  The J2000 method is best matched to the way the
40///     argument is handled internally and will deliver the optimum
41///     resolution.  The MJD method and the date & time methods are both
42///     good compromises between resolution and convenience.  For most
43///     applications of this function the choice will not be at all
44///     critical.
45///
46///     TT can be used instead of TDB without any significant impact on
47///     accuracy.
48///
49///  2) Iterative techniques are used for the aberration and light
50///     deflection corrections so that the functions iauAtic13 (or
51///     iauAticq) and iauAtci13 (or iauAtciq) are accurate inverses;
52///     even at the edge of the Sun's disk the discrepancy is only about
53///     1 nanoarcsecond.
54///
55///  3) The available accuracy is better than 1 milliarcsecond, limited
56///     mainly by the precession-nutation model that is used, namely
57///     IAU 2000A/2006.  Very close to solar system bodies, additional
58///     errors of up to several milliarcseconds can occur because of
59///     unmodeled light deflection;  however, the Sun's contribution is
60///     taken into account, to first order.  The accuracy limitations of
61///     the SOFA function iauEpv00 (used to compute Earth position and
62///     velocity) can contribute aberration errors of up to
63///     5 microarcseconds.  Light deflection at the Sun's limb is
64///     uncertain at the 0.4 mas level.
65///
66///  4) Should the transformation to (equinox based) J2000.0 mean place
67///     be required rather than (CIO based) ICRS coordinates, subtract the
68///     equation of the origins from the returned right ascension:
69///     RA = RI - EO.  (The iauAnp function can then be applied, as
70///     required, to keep the result in the conventional 0-2pi range.)
71///
72///  Called:
73///  ```
74///     iauApci13    astrometry parameters, ICRS-CIRS, 2013
75///     iauAticq     quick CIRS to ICRS astrometric
76///  ```
77pub fn atic13(ri: f64, di: f64, date1: f64, date2: f64) -> (f64, f64, f64) {
78    // double *rc, double *dc, double *eo
79    let astrom = &mut IauAstrom::default();
80    let eo = &mut 0.0;
81
82    /* Star-independent astrometry parameters. */
83    apci13(date1, date2, astrom, eo);
84
85    /* CIRS to ICRS astrometric. */
86    let (rc, dc) = aticq(ri, di, astrom);
87
88    (rc, dc, *eo)
89}