sofars/astro/atcc13.rs
1use 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/// ```
64pub fn atcc13(
65 rc: f64,
66 dc: f64,
67 pr: f64,
68 pd: f64,
69 px: f64,
70 rv: f64,
71 date1: f64,
72 date2: f64,
73) -> (f64, f64) {
74 /* Star-independent astrometry parameters */
75 let astrom = &mut IauAstrom::default();
76 let w = &mut 0.0;
77
78 /* The transformation parameters. */
79 apci13(date1, date2, astrom, w);
80
81 /* Catalog ICRS (epoch J2000.0) to astrometric. */
82 let (ra, da) = atccq(rc, dc, pr, pd, px, rv, astrom);
83
84 (ra, da)
85}