1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
use crate;
use IauAstrom;
/// Quick observed −> CIRS
///
/// Quick observed place to CIRS, given the star-independent astrometry
/// parameters.
///
/// Use of this function is appropriate when efficiency is important and
/// where many star positions are all to be transformed for one date.
/// The star-independent astrometry parameters can be obtained by
/// calling iauApio[13] or iauApco[13].
///
/// This function is part of the International Astronomical Union's
/// SOFA (Standards of Fundamental Astronomy) software collection.
///
/// Status: support function.
///
/// Given:
/// ```
/// type char[] type of coordinates: "R", "H" or "A" (Note 1)
/// ob1 double observed Az, HA or RA (radians; Az is N=0,E=90)
/// ob2 double observed ZD or Dec (radians)
/// astrom iauASTROM* star-independent astrometry parameters:
/// pmt double PM time interval (SSB, Julian years)
/// eb double[3] SSB to observer (vector, au)
/// eh double[3] Sun to observer (unit vector)
/// em double distance from Sun to observer (au)
/// v double[3] barycentric observer velocity (vector, c)
/// bm1 double sqrt(1-|v|^2): reciprocal of Lorenz factor
/// bpn double[3][3] bias-precession-nutation matrix
/// along double longitude + s' (radians)
/// xpl double polar motion xp wrt local meridian (radians)
/// ypl double polar motion yp wrt local meridian (radians)
/// sphi double sine of geodetic latitude
/// cphi double cosine of geodetic latitude
/// diurab double magnitude of diurnal aberration vector
/// eral double "local" Earth rotation angle (radians)
/// refa double refraction constant A (radians)
/// refb double refraction constant B (radians)
/// ```
/// Returned:
/// ```
/// ri double* CIRS right ascension (CIO-based, radians)
/// di double* CIRS declination (radians)
/// ```
/// Notes:
///
/// 1) "Observed" Az,ZD means the position that would be seen by a
/// perfect geodetically aligned theodolite. This is related to
/// the observed HA,Dec via the standard rotation, using the geodetic
/// latitude (corrected for polar motion), while the observed HA and
/// (CIO-based) RA are related simply through the Earth rotation
/// angle and the site longitude. "Observed" RA,Dec or HA,Dec thus
/// means the position that would be seen by a perfect equatorial
/// with its polar axis aligned to the Earth's axis of rotation.
///
/// 2) Only the first character of the type argument is significant.
/// "R" or "r" indicates that ob1 and ob2 are the observed right
/// ascension (CIO-based) and declination; "H" or "h" indicates that
/// they are hour angle (west +ve) and declination; anything else
/// ("A" or "a" is recommended) indicates that ob1 and ob2 are
/// azimuth (north zero, east 90 deg) and zenith distance. (Zenith
/// distance is used rather than altitude in order to reflect the
/// fact that no allowance is made for depression of the horizon.)
///
/// 3) The accuracy of the result is limited by the corrections for
/// refraction, which use a simple A*tan(z) + B*tan^3(z) model.
/// Providing the meteorological parameters are known accurately and
/// there are no gross local effects, the predicted intermediate
/// coordinates should be within 0.05 arcsec (optical) or 1 arcsec
/// (radio) for a zenith distance of less than 70 degrees, better
/// than 30 arcsec (optical or radio) at 85 degrees and better than
/// 20 arcmin (optical) or 25 arcmin (radio) at the horizon.
///
/// Without refraction, the complementary functions iauAtioq and
/// iauAtoiq are self-consistent to better than 1 microarcsecond all
/// over the celestial sphere. With refraction included, consistency
/// falls off at high zenith distances, but is still better than
/// 0.05 arcsec at 85 degrees.
///
/// 4) It is advisable to take great care with units, as even unlikely
/// values of the input parameters are accepted and processed in
/// accordance with the models used.
///
/// Called:
/// iauS2c spherical coordinates to unit vector
/// iauC2s p-vector to spherical
/// iauAnp normalize angle into range 0 to 2pi
///