source: trunk/FACT++/erfa/src/h2fk5.c@ 18350

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