1 #include "erfa.h"
2
eraFk52h(double r5,double d5,double dr5,double dd5,double px5,double rv5,double * rh,double * dh,double * drh,double * ddh,double * pxh,double * rvh)3 void eraFk52h(double r5, double d5,
4 double dr5, double dd5, double px5, double rv5,
5 double *rh, double *dh,
6 double *drh, double *ddh, double *pxh, double *rvh)
7 /*
8 ** - - - - - - - - -
9 ** e r a F k 5 2 h
10 ** - - - - - - - - -
11 **
12 ** Transform FK5 (J2000.0) star data into the Hipparcos system.
13 **
14 ** Given (all FK5, equinox J2000.0, epoch J2000.0):
15 ** r5 double RA (radians)
16 ** d5 double Dec (radians)
17 ** dr5 double proper motion in RA (dRA/dt, rad/Jyear)
18 ** dd5 double proper motion in Dec (dDec/dt, rad/Jyear)
19 ** px5 double parallax (arcsec)
20 ** rv5 double radial velocity (km/s, positive = receding)
21 **
22 ** Returned (all Hipparcos, epoch J2000.0):
23 ** rh double RA (radians)
24 ** dh double Dec (radians)
25 ** drh double proper motion in RA (dRA/dt, rad/Jyear)
26 ** ddh double proper motion in Dec (dDec/dt, rad/Jyear)
27 ** pxh double parallax (arcsec)
28 ** rvh double radial velocity (km/s, positive = receding)
29 **
30 ** Notes:
31 **
32 ** 1) This function transforms FK5 star positions and proper motions
33 ** into the system of the Hipparcos catalog.
34 **
35 ** 2) The proper motions in RA are dRA/dt rather than
36 ** cos(Dec)*dRA/dt, and are per year rather than per century.
37 **
38 ** 3) The FK5 to Hipparcos transformation is modeled as a pure
39 ** rotation and spin; zonal errors in the FK5 catalog are not
40 ** taken into account.
41 **
42 ** 4) See also eraH2fk5, eraFk5hz, eraHfk5z.
43 **
44 ** Called:
45 ** eraStarpv star catalog data to space motion pv-vector
46 ** eraFk5hip FK5 to Hipparcos rotation and spin
47 ** eraRxp product of r-matrix and p-vector
48 ** eraPxp vector product of two p-vectors
49 ** eraPpp p-vector plus p-vector
50 ** eraPvstar space motion pv-vector to star catalog data
51 **
52 ** Reference:
53 **
54 ** F.Mignard & M.Froeschle, Astron.Astrophys., 354, 732-739 (2000).
55 **
56 ** This revision: 2021 May 11
57 **
58 ** Copyright (C) 2013-2021, NumFOCUS Foundation.
59 ** Derived, with permission, from the SOFA library. See notes at end of file.
60 */
61 {
62 int i;
63 double pv5[2][3], r5h[3][3], s5h[3], wxp[3], vv[3], pvh[2][3];
64
65
66 /* FK5 barycentric position/velocity pv-vector (normalized). */
67 eraStarpv(r5, d5, dr5, dd5, px5, rv5, pv5);
68
69 /* FK5 to Hipparcos orientation matrix and spin vector. */
70 eraFk5hip(r5h, s5h);
71
72 /* Make spin units per day instead of per year. */
73 for ( i = 0; i < 3; s5h[i++] /= 365.25 );
74
75 /* Orient the FK5 position into the Hipparcos system. */
76 eraRxp(r5h, pv5[0], pvh[0]);
77
78 /* Apply spin to the position giving an extra space motion component. */
79 eraPxp(pv5[0], s5h, wxp);
80
81 /* Add this component to the FK5 space motion. */
82 eraPpp(wxp, pv5[1], vv);
83
84 /* Orient the FK5 space motion into the Hipparcos system. */
85 eraRxp(r5h, vv, pvh[1]);
86
87 /* Hipparcos pv-vector to spherical. */
88 eraPvstar(pvh, rh, dh, drh, ddh, pxh, rvh);
89
90 /* Finished. */
91
92 }
93 /*----------------------------------------------------------------------
94 **
95 **
96 ** Copyright (C) 2013-2021, NumFOCUS Foundation.
97 ** All rights reserved.
98 **
99 ** This library is derived, with permission, from the International
100 ** Astronomical Union's "Standards of Fundamental Astronomy" library,
101 ** available from http://www.iausofa.org.
102 **
103 ** The ERFA version is intended to retain identical functionality to
104 ** the SOFA library, but made distinct through different function and
105 ** file names, as set out in the SOFA license conditions. The SOFA
106 ** original has a role as a reference standard for the IAU and IERS,
107 ** and consequently redistribution is permitted only in its unaltered
108 ** state. The ERFA version is not subject to this restriction and
109 ** therefore can be included in distributions which do not support the
110 ** concept of "read only" software.
111 **
112 ** Although the intent is to replicate the SOFA API (other than
113 ** replacement of prefix names) and results (with the exception of
114 ** bugs; any that are discovered will be fixed), SOFA is not
115 ** responsible for any errors found in this version of the library.
116 **
117 ** If you wish to acknowledge the SOFA heritage, please acknowledge
118 ** that you are using a library derived from SOFA, rather than SOFA
119 ** itself.
120 **
121 **
122 ** TERMS AND CONDITIONS
123 **
124 ** Redistribution and use in source and binary forms, with or without
125 ** modification, are permitted provided that the following conditions
126 ** are met:
127 **
128 ** 1 Redistributions of source code must retain the above copyright
129 ** notice, this list of conditions and the following disclaimer.
130 **
131 ** 2 Redistributions in binary form must reproduce the above copyright
132 ** notice, this list of conditions and the following disclaimer in
133 ** the documentation and/or other materials provided with the
134 ** distribution.
135 **
136 ** 3 Neither the name of the Standards Of Fundamental Astronomy Board,
137 ** the International Astronomical Union nor the names of its
138 ** contributors may be used to endorse or promote products derived
139 ** from this software without specific prior written permission.
140 **
141 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
142 ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
143 ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
144 ** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
145 ** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
146 ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
147 ** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
148 ** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
149 ** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
150 ** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
151 ** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
152 ** POSSIBILITY OF SUCH DAMAGE.
153 **
154 */
155