File Coverage

erfasrc/src/tpsts.c
Criterion Covered Total %
statement 0 7 0.0
branch n/a
condition n/a
subroutine n/a
pod n/a
total 0 7 0.0


line stmt bran cond sub pod time code
1             #include "erfa.h"
2              
3 0           void eraTpsts(double xi, double eta, double a0, double b0,
4             double *a, double *b)
5             /*
6             ** - - - - - - - - -
7             ** e r a T p s t s
8             ** - - - - - - - - -
9             **
10             ** In the tangent plane projection, given the star's rectangular
11             ** coordinates and the spherical coordinates of the tangent point,
12             ** solve for the spherical coordinates of the star.
13             **
14             ** Given:
15             ** xi,eta double rectangular coordinates of star image (Note 2)
16             ** a0,b0 double tangent point's spherical coordinates
17             **
18             ** Returned:
19             ** *a,*b double star's spherical coordinates
20             **
21             ** 1) The tangent plane projection is also called the "gnomonic
22             ** projection" and the "central projection".
23             **
24             ** 2) The eta axis points due north in the adopted coordinate system.
25             ** If the spherical coordinates are observed (RA,Dec), the tangent
26             ** plane coordinates (xi,eta) are conventionally called the
27             ** "standard coordinates". If the spherical coordinates are with
28             ** respect to a right-handed triad, (xi,eta) are also right-handed.
29             ** The units of (xi,eta) are, effectively, radians at the tangent
30             ** point.
31             **
32             ** 3) All angular arguments are in radians.
33             **
34             ** 4) This function is a member of the following set:
35             **
36             ** spherical vector solve for
37             **
38             ** eraTpxes eraTpxev xi,eta
39             ** > eraTpsts < eraTpstv star
40             ** eraTpors eraTporv origin
41             **
42             ** Called:
43             ** eraAnp normalize angle into range 0 to 2pi
44             **
45             ** References:
46             **
47             ** Calabretta M.R. & Greisen, E.W., 2002, "Representations of
48             ** celestial coordinates in FITS", Astron.Astrophys. 395, 1077
49             **
50             ** Green, R.M., "Spherical Astronomy", Cambridge University Press,
51             ** 1987, Chapter 13.
52             **
53             ** Copyright (C) 2013-2019, NumFOCUS Foundation.
54             ** Derived, with permission, from the SOFA library. See notes at end of file.
55             */
56             {
57             double sb0, cb0, d;
58              
59 0           sb0 = sin(b0);
60 0           cb0 = cos(b0);
61 0           d = cb0 - eta*sb0;
62 0           *a = eraAnp(atan2(xi,d) + a0);
63 0           *b = atan2(sb0+eta*cb0, sqrt(xi*xi+d*d));
64              
65             /* Finished. */
66              
67 0           }
68             /*----------------------------------------------------------------------
69             **
70             **
71             ** Copyright (C) 2013-2019, NumFOCUS Foundation.
72             ** All rights reserved.
73             **
74             ** This library is derived, with permission, from the International
75             ** Astronomical Union's "Standards of Fundamental Astronomy" library,
76             ** available from http://www.iausofa.org.
77             **
78             ** The ERFA version is intended to retain identical functionality to
79             ** the SOFA library, but made distinct through different function and
80             ** file names, as set out in the SOFA license conditions. The SOFA
81             ** original has a role as a reference standard for the IAU and IERS,
82             ** and consequently redistribution is permitted only in its unaltered
83             ** state. The ERFA version is not subject to this restriction and
84             ** therefore can be included in distributions which do not support the
85             ** concept of "read only" software.
86             **
87             ** Although the intent is to replicate the SOFA API (other than
88             ** replacement of prefix names) and results (with the exception of
89             ** bugs; any that are discovered will be fixed), SOFA is not
90             ** responsible for any errors found in this version of the library.
91             **
92             ** If you wish to acknowledge the SOFA heritage, please acknowledge
93             ** that you are using a library derived from SOFA, rather than SOFA
94             ** itself.
95             **
96             **
97             ** TERMS AND CONDITIONS
98             **
99             ** Redistribution and use in source and binary forms, with or without
100             ** modification, are permitted provided that the following conditions
101             ** are met:
102             **
103             ** 1 Redistributions of source code must retain the above copyright
104             ** notice, this list of conditions and the following disclaimer.
105             **
106             ** 2 Redistributions in binary form must reproduce the above copyright
107             ** notice, this list of conditions and the following disclaimer in
108             ** the documentation and/or other materials provided with the
109             ** distribution.
110             **
111             ** 3 Neither the name of the Standards Of Fundamental Astronomy Board,
112             ** the International Astronomical Union nor the names of its
113             ** contributors may be used to endorse or promote products derived
114             ** from this software without specific prior written permission.
115             **
116             ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
117             ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
118             ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
119             ** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
120             ** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
121             ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
122             ** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
123             ** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
124             ** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
125             ** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
126             ** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
127             ** POSSIBILITY OF SUCH DAMAGE.
128             **
129             */