File Coverage

erfasrc/src/fk54z.c
Criterion Covered Total %
statement 0 14 0.0
branch 0 2 0.0
condition n/a
subroutine n/a
pod n/a
total 0 16 0.0


line stmt bran cond sub pod time code
1             #include "erfa.h"
2              
3 0           void eraFk54z(double r2000, double d2000, double bepoch,
4             double *r1950, double *d1950,
5             double *dr1950, double *dd1950)
6             /*
7             ** - - - - - - - - -
8             ** e r a F k 5 4 z
9             ** - - - - - - - - -
10             **
11             ** Convert a J2000.0 FK5 star position to B1950.0 FK4, assuming zero
12             ** proper motion in FK5 and parallax.
13             **
14             ** Given:
15             ** r2000,d2000 double J2000.0 FK5 RA,Dec (rad)
16             ** bepoch double Besselian epoch (e.g. 1950.0)
17             **
18             ** Returned:
19             ** r1950,d1950 double B1950.0 FK4 RA,Dec (rad) at epoch BEPOCH
20             ** dr1950,dd1950 double B1950.0 FK4 proper motions (rad/trop.yr)
21             **
22             ** Notes:
23             **
24             ** 1) In contrast to the eraFk524 routine, here the FK5 proper
25             ** motions, the parallax and the radial velocity are presumed zero.
26             **
27             ** 2) This function converts a star position from the IAU 1976 FK5
28             ** (Fricke) system to the former FK4 (Bessel-Newcomb) system, for
29             ** cases such as distant radio sources where it is presumed there is
30             ** zero parallax and no proper motion. Because of the E-terms of
31             ** aberration, such objects have (in general) non-zero proper motion
32             ** in FK4, and the present routine returns those fictitious proper
33             ** motions.
34             **
35             ** 3) Conversion from B1950.0 FK4 to J2000.0 FK5 only is provided for.
36             ** Conversions involving other equinoxes would require additional
37             ** treatment for precession.
38             **
39             ** 4) The position returned by this routine is in the B1950.0 FK4
40             ** reference system but at Besselian epoch BEPOCH. For comparison
41             ** with catalogs the BEPOCH argument will frequently be 1950.0. (In
42             ** this context the distinction between Besselian and Julian epoch
43             ** is insignificant.)
44             **
45             ** 5) The RA component of the returned (fictitious) proper motion is
46             ** dRA/dt rather than cos(Dec)*dRA/dt.
47             **
48             ** Called:
49             ** eraAnp normalize angle into range 0 to 2pi
50             ** eraC2s p-vector to spherical
51             ** eraFk524 FK4 to FK5
52             ** eraS2c spherical to p-vector
53             **
54             ** Copyright (C) 2013-2020, NumFOCUS Foundation.
55             ** Derived, with permission, from the SOFA library. See notes at end of file.
56             */
57             {
58             double r, d, pr, pd, px, rv, p[3], w, v[3];
59             int i;
60              
61              
62             /* FK5 equinox J2000.0 to FK4 equinox B1950.0. */
63 0           eraFk524(r2000, d2000, 0.0, 0.0, 0.0, 0.0,
64             &r, &d, &pr, &pd, &px, &rv);
65              
66             /* Spherical to Cartesian. */
67 0           eraS2c(r, d, p);
68              
69             /* Fictitious proper motion (radians per year). */
70 0           v[0] = - pr*p[1] - pd*cos(r)*sin(d);
71 0           v[1] = pr*p[0] - pd*sin(r)*sin(d);
72 0           v[2] = pd*cos(d);
73              
74             /* Apply the motion. */
75 0           w = bepoch - 1950.0;
76 0 0         for ( i = 0; i < 3; i++ ) {
77 0           p[i] += w*v[i];
78             }
79              
80             /* Cartesian to spherical. */
81 0           eraC2s(p, &w, d1950);
82 0           *r1950 = eraAnp(w);
83              
84             /* Fictitious proper motion. */
85 0           *dr1950 = pr;
86 0           *dd1950 = pd;
87              
88             /* Finished. */
89              
90 0           }
91             /*----------------------------------------------------------------------
92             **
93             **
94             ** Copyright (C) 2013-2020, NumFOCUS Foundation.
95             ** All rights reserved.
96             **
97             ** This library is derived, with permission, from the International
98             ** Astronomical Union's "Standards of Fundamental Astronomy" library,
99             ** available from http://www.iausofa.org.
100             **
101             ** The ERFA version is intended to retain identical functionality to
102             ** the SOFA library, but made distinct through different function and
103             ** file names, as set out in the SOFA license conditions. The SOFA
104             ** original has a role as a reference standard for the IAU and IERS,
105             ** and consequently redistribution is permitted only in its unaltered
106             ** state. The ERFA version is not subject to this restriction and
107             ** therefore can be included in distributions which do not support the
108             ** concept of "read only" software.
109             **
110             ** Although the intent is to replicate the SOFA API (other than
111             ** replacement of prefix names) and results (with the exception of
112             ** bugs; any that are discovered will be fixed), SOFA is not
113             ** responsible for any errors found in this version of the library.
114             **
115             ** If you wish to acknowledge the SOFA heritage, please acknowledge
116             ** that you are using a library derived from SOFA, rather than SOFA
117             ** itself.
118             **
119             **
120             ** TERMS AND CONDITIONS
121             **
122             ** Redistribution and use in source and binary forms, with or without
123             ** modification, are permitted provided that the following conditions
124             ** are met:
125             **
126             ** 1 Redistributions of source code must retain the above copyright
127             ** notice, this list of conditions and the following disclaimer.
128             **
129             ** 2 Redistributions in binary form must reproduce the above copyright
130             ** notice, this list of conditions and the following disclaimer in
131             ** the documentation and/or other materials provided with the
132             ** distribution.
133             **
134             ** 3 Neither the name of the Standards Of Fundamental Astronomy Board,
135             ** the International Astronomical Union nor the names of its
136             ** contributors may be used to endorse or promote products derived
137             ** from this software without specific prior written permission.
138             **
139             ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
140             ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
141             ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
142             ** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
143             ** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
144             ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
145             ** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
146             ** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
147             ** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
148             ** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
149             ** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
150             ** POSSIBILITY OF SUCH DAMAGE.
151             **
152             */