/rust/registry/src/index.crates.io-1949cf8c6b5b557f/sofars-0.6.1/src/astro/atciqz.rs
Line | Count | Source |
1 | | use crate::vm::{anp, c2s, rxp, s2c}; |
2 | | |
3 | | use super::{IauAstrom, ab, ldsun}; |
4 | | |
5 | | /// Quick astrometric ICRS −> CIRS |
6 | | /// |
7 | | /// Quick ICRS to CIRS transformation, given precomputed star- |
8 | | /// independent astrometry parameters, and assuming zero parallax and |
9 | | /// proper motion. |
10 | | /// |
11 | | /// Use of this function is appropriate when efficiency is important and |
12 | | /// where many star positions are to be transformed for one date. The |
13 | | /// star-independent parameters can be obtained by calling one of the |
14 | | /// functions iauApci[13], iauApcg[13], iauApco[13] or iauApcs[13]. |
15 | | /// |
16 | | /// The corresponding function for the case of non-zero parallax and |
17 | | /// proper motion is iauAtciq. |
18 | | /// |
19 | | /// This function is part of the International Astronomical Union's |
20 | | /// SOFA (Standards of Fundamental Astronomy) software collection. |
21 | | /// |
22 | | /// Status: support function. |
23 | | /// |
24 | | /// Given: |
25 | | /// ``` |
26 | | /// rc,dc double ICRS astrometric RA,Dec (radians) |
27 | | /// astrom iauASTROM* star-independent astrometry parameters: |
28 | | /// pmt double PM time interval (SSB, Julian years) |
29 | | /// eb double[3] SSB to observer (vector, au) |
30 | | /// eh double[3] Sun to observer (unit vector) |
31 | | /// em double distance from Sun to observer (au) |
32 | | /// v double[3] barycentric observer velocity (vector, c) |
33 | | /// bm1 double sqrt(1-|v|^2): reciprocal of Lorenz factor |
34 | | /// bpn double[3][3] bias-precession-nutation matrix |
35 | | /// along double longitude + s' (radians) |
36 | | /// xpl double polar motion xp wrt local meridian (radians) |
37 | | /// ypl double polar motion yp wrt local meridian (radians) |
38 | | /// sphi double sine of geodetic latitude |
39 | | /// cphi double cosine of geodetic latitude |
40 | | /// diurab double magnitude of diurnal aberration vector |
41 | | /// eral double "local" Earth rotation angle (radians) |
42 | | /// refa double refraction constant A (radians) |
43 | | /// refb double refraction constant B (radians) |
44 | | /// ``` |
45 | | /// Returned: |
46 | | /// ``` |
47 | | /// ri,di double CIRS RA,Dec (radians) |
48 | | /// ``` |
49 | | /// Note: |
50 | | /// |
51 | | /// All the vectors are with respect to BCRS axes. |
52 | | /// |
53 | | /// References: |
54 | | /// |
55 | | /// Urban, S. & Seidelmann, P. K. (eds), Explanatory Supplement to |
56 | | /// the Astronomical Almanac, 3rd ed., University Science Books |
57 | | /// (2013). |
58 | | /// |
59 | | /// Klioner, Sergei A., "A practical relativistic model for micro- |
60 | | /// arcsecond astrometry in space", Astr. J. 125, 1580-1597 (2003). |
61 | | /// |
62 | | /// Called: |
63 | | /// ``` |
64 | | /// iauS2c spherical coordinates to unit vector |
65 | | /// iauLdsun light deflection due to Sun |
66 | | /// iauAb stellar aberration |
67 | | /// iauRxp product of r-matrix and p-vector |
68 | | /// iauC2s p-vector to spherical |
69 | | /// iauAnp normalize angle into range +/- pi |
70 | | /// ``` |
71 | 0 | pub fn atciqz(rc: f64, dc: f64, astrom: &mut IauAstrom) -> (f64, f64) { |
72 | | /* BCRS coordinate direction (unit vector). */ |
73 | 0 | let pco = s2c(rc, dc); |
74 | | |
75 | | /* Light deflection by the Sun, giving BCRS natural direction. */ |
76 | 0 | let pnat = ldsun(pco, astrom.eh, astrom.em); |
77 | | |
78 | | /* Aberration, giving GCRS proper direction. */ |
79 | 0 | let ppr = ab(&pnat, &astrom.v, astrom.em, astrom.bm1); |
80 | | |
81 | | /* Bias-precession-nutation, giving CIRS proper direction. */ |
82 | 0 | let mut pi = [0.0; 3]; |
83 | 0 | rxp(&astrom.bpn, &ppr, &mut pi); |
84 | | |
85 | | /* CIRS RA,Dec. */ |
86 | 0 | let (w, di) = c2s(&pi); |
87 | 0 | let ri = anp(w); |
88 | | |
89 | 0 | (ri, di) |
90 | 0 | } |