FACT++  1.0
fk52h.c
Go to the documentation of this file.
1 #include "erfa.h"
2 
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 ** Copyright (C) 2013-2015, NumFOCUS Foundation.
57 ** Derived, with permission, from the SOFA library. See notes at end of file.
58 */
59 {
60  int i;
61  double pv5[2][3], r5h[3][3], s5h[3], wxp[3], vv[3], pvh[2][3];
62 
63 /* FK5 barycentric position/velocity pv-vector (normalized). */
64  eraStarpv(r5, d5, dr5, dd5, px5, rv5, pv5);
65 
66 /* FK5 to Hipparcos orientation matrix and spin vector. */
67  eraFk5hip(r5h, s5h);
68 
69 /* Make spin units per day instead of per year. */
70  for ( i = 0; i < 3; s5h[i++] /= 365.25 );
71 
72 /* Orient the FK5 position into the Hipparcos system. */
73  eraRxp(r5h, pv5[0], pvh[0]);
74 
75 /* Apply spin to the position giving an extra space motion component. */
76  eraPxp(pv5[0], s5h, wxp);
77 
78 /* Add this component to the FK5 space motion. */
79  eraPpp(wxp, pv5[1], vv);
80 
81 /* Orient the FK5 space motion into the Hipparcos system. */
82  eraRxp(r5h, vv, pvh[1]);
83 
84 /* Hipparcos pv-vector to spherical. */
85  eraPvstar(pvh, rh, dh, drh, ddh, pxh, rvh);
86 
87  return;
88 
89 }
90 /*----------------------------------------------------------------------
91 **
92 **
93 ** Copyright (C) 2013-2015, NumFOCUS Foundation.
94 ** All rights reserved.
95 **
96 ** This library is derived, with permission, from the International
97 ** Astronomical Union's "Standards of Fundamental Astronomy" library,
98 ** available from http://www.iausofa.org.
99 **
100 ** The ERFA version is intended to retain identical functionality to
101 ** the SOFA library, but made distinct through different function and
102 ** file names, as set out in the SOFA license conditions. The SOFA
103 ** original has a role as a reference standard for the IAU and IERS,
104 ** and consequently redistribution is permitted only in its unaltered
105 ** state. The ERFA version is not subject to this restriction and
106 ** therefore can be included in distributions which do not support the
107 ** concept of "read only" software.
108 **
109 ** Although the intent is to replicate the SOFA API (other than
110 ** replacement of prefix names) and results (with the exception of
111 ** bugs; any that are discovered will be fixed), SOFA is not
112 ** responsible for any errors found in this version of the library.
113 **
114 ** If you wish to acknowledge the SOFA heritage, please acknowledge
115 ** that you are using a library derived from SOFA, rather than SOFA
116 ** itself.
117 **
118 **
119 ** TERMS AND CONDITIONS
120 **
121 ** Redistribution and use in source and binary forms, with or without
122 ** modification, are permitted provided that the following conditions
123 ** are met:
124 **
125 ** 1 Redistributions of source code must retain the above copyright
126 ** notice, this list of conditions and the following disclaimer.
127 **
128 ** 2 Redistributions in binary form must reproduce the above copyright
129 ** notice, this list of conditions and the following disclaimer in
130 ** the documentation and/or other materials provided with the
131 ** distribution.
132 **
133 ** 3 Neither the name of the Standards Of Fundamental Astronomy Board,
134 ** the International Astronomical Union nor the names of its
135 ** contributors may be used to endorse or promote products derived
136 ** from this software without specific prior written permission.
137 **
138 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
139 ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
140 ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
141 ** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
142 ** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
143 ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
144 ** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
145 ** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
146 ** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
147 ** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
148 ** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
149 ** POSSIBILITY OF SUCH DAMAGE.
150 **
151 */
int i
Definition: db_dim_client.c:21
void eraFk5hip(double r5h[3][3], double s5h[3])
Definition: fk5hip.c:3
void 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)
Definition: fk52h.c:3
void eraPxp(double a[3], double b[3], double axb[3])
Definition: pxp.c:3
void eraRxp(double r[3][3], double p[3], double rp[3])
Definition: rxp.c:3
void eraPpp(double a[3], double b[3], double apb[3])
Definition: ppp.c:3
int eraPvstar(double pv[2][3], double *ra, double *dec, double *pmr, double *pmd, double *px, double *rv)
Definition: pvstar.c:3
int eraStarpv(double ra, double dec, double pmr, double pmd, double px, double rv, double pv[2][3])
Definition: starpv.c:3