File Coverage

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


line stmt bran cond sub pod time code
1             #include "erfa.h"
2              
3 0           void eraApcg(double date1, double date2,
4             double ebpv[2][3], double ehp[3],
5             eraASTROM *astrom)
6             /*
7             ** - - - - - - - -
8             ** e r a A p c g
9             ** - - - - - - - -
10             **
11             ** For a geocentric observer, prepare star-independent astrometry
12             ** parameters for transformations between ICRS and GCRS coordinates.
13             ** The Earth ephemeris is supplied by the caller.
14             **
15             ** The parameters produced by this function are required in the
16             ** parallax, light deflection and aberration parts of the astrometric
17             ** transformation chain.
18             **
19             ** Given:
20             ** date1 double TDB as a 2-part...
21             ** date2 double ...Julian Date (Note 1)
22             ** ebpv double[2][3] Earth barycentric pos/vel (au, au/day)
23             ** ehp double[3] Earth heliocentric position (au)
24             **
25             ** Returned:
26             ** astrom eraASTROM* star-independent astrometry parameters:
27             ** pmt double PM time interval (SSB, Julian years)
28             ** eb double[3] SSB to observer (vector, au)
29             ** eh double[3] Sun to observer (unit vector)
30             ** em double distance from Sun to observer (au)
31             ** v double[3] barycentric observer velocity (vector, c)
32             ** bm1 double sqrt(1-|v|^2): reciprocal of Lorenz factor
33             ** bpn double[3][3] bias-precession-nutation matrix
34             ** along double unchanged
35             ** xpl double unchanged
36             ** ypl double unchanged
37             ** sphi double unchanged
38             ** cphi double unchanged
39             ** diurab double unchanged
40             ** eral double unchanged
41             ** refa double unchanged
42             ** refb double unchanged
43             **
44             ** Notes:
45             **
46             ** 1) The TDB date date1+date2 is a Julian Date, apportioned in any
47             ** convenient way between the two arguments. For example,
48             ** JD(TDB)=2450123.7 could be expressed in any of these ways, among
49             ** others:
50             **
51             ** date1 date2
52             **
53             ** 2450123.7 0.0 (JD method)
54             ** 2451545.0 -1421.3 (J2000 method)
55             ** 2400000.5 50123.2 (MJD method)
56             ** 2450123.5 0.2 (date & time method)
57             **
58             ** The JD method is the most natural and convenient to use in cases
59             ** where the loss of several decimal digits of resolution is
60             ** acceptable. The J2000 method is best matched to the way the
61             ** argument is handled internally and will deliver the optimum
62             ** resolution. The MJD method and the date & time methods are both
63             ** good compromises between resolution and convenience. For most
64             ** applications of this function the choice will not be at all
65             ** critical.
66             **
67             ** TT can be used instead of TDB without any significant impact on
68             ** accuracy.
69             **
70             ** 2) All the vectors are with respect to BCRS axes.
71             **
72             ** 3) This is one of several functions that inserts into the astrom
73             ** structure star-independent parameters needed for the chain of
74             ** astrometric transformations ICRS <-> GCRS <-> CIRS <-> observed.
75             **
76             ** The various functions support different classes of observer and
77             ** portions of the transformation chain:
78             **
79             ** functions observer transformation
80             **
81             ** eraApcg eraApcg13 geocentric ICRS <-> GCRS
82             ** eraApci eraApci13 terrestrial ICRS <-> CIRS
83             ** eraApco eraApco13 terrestrial ICRS <-> observed
84             ** eraApcs eraApcs13 space ICRS <-> GCRS
85             ** eraAper eraAper13 terrestrial update Earth rotation
86             ** eraApio eraApio13 terrestrial CIRS <-> observed
87             **
88             ** Those with names ending in "13" use contemporary ERFA models to
89             ** compute the various ephemerides. The others accept ephemerides
90             ** supplied by the caller.
91             **
92             ** The transformation from ICRS to GCRS covers space motion,
93             ** parallax, light deflection, and aberration. From GCRS to CIRS
94             ** comprises frame bias and precession-nutation. From CIRS to
95             ** observed takes account of Earth rotation, polar motion, diurnal
96             ** aberration and parallax (unless subsumed into the ICRS <-> GCRS
97             ** transformation), and atmospheric refraction.
98             **
99             ** 4) The context structure astrom produced by this function is used by
100             ** eraAtciq* and eraAticq*.
101             **
102             ** Called:
103             ** eraApcs astrometry parameters, ICRS-GCRS, space observer
104             **
105             ** Copyright (C) 2013-2020, NumFOCUS Foundation.
106             ** Derived, with permission, from the SOFA library. See notes at end of file.
107             */
108             {
109             /* Geocentric observer */
110 0           double pv[2][3] = { { 0.0, 0.0, 0.0 },
111             { 0.0, 0.0, 0.0 } };
112              
113              
114             /* Compute the star-independent astrometry parameters. */
115 0           eraApcs(date1, date2, pv, ebpv, ehp, astrom);
116              
117             /* Finished. */
118              
119 0           }
120             /*----------------------------------------------------------------------
121             **
122             **
123             ** Copyright (C) 2013-2020, NumFOCUS Foundation.
124             ** All rights reserved.
125             **
126             ** This library is derived, with permission, from the International
127             ** Astronomical Union's "Standards of Fundamental Astronomy" library,
128             ** available from http://www.iausofa.org.
129             **
130             ** The ERFA version is intended to retain identical functionality to
131             ** the SOFA library, but made distinct through different function and
132             ** file names, as set out in the SOFA license conditions. The SOFA
133             ** original has a role as a reference standard for the IAU and IERS,
134             ** and consequently redistribution is permitted only in its unaltered
135             ** state. The ERFA version is not subject to this restriction and
136             ** therefore can be included in distributions which do not support the
137             ** concept of "read only" software.
138             **
139             ** Although the intent is to replicate the SOFA API (other than
140             ** replacement of prefix names) and results (with the exception of
141             ** bugs; any that are discovered will be fixed), SOFA is not
142             ** responsible for any errors found in this version of the library.
143             **
144             ** If you wish to acknowledge the SOFA heritage, please acknowledge
145             ** that you are using a library derived from SOFA, rather than SOFA
146             ** itself.
147             **
148             **
149             ** TERMS AND CONDITIONS
150             **
151             ** Redistribution and use in source and binary forms, with or without
152             ** modification, are permitted provided that the following conditions
153             ** are met:
154             **
155             ** 1 Redistributions of source code must retain the above copyright
156             ** notice, this list of conditions and the following disclaimer.
157             **
158             ** 2 Redistributions in binary form must reproduce the above copyright
159             ** notice, this list of conditions and the following disclaimer in
160             ** the documentation and/or other materials provided with the
161             ** distribution.
162             **
163             ** 3 Neither the name of the Standards Of Fundamental Astronomy Board,
164             ** the International Astronomical Union nor the names of its
165             ** contributors may be used to endorse or promote products derived
166             ** from this software without specific prior written permission.
167             **
168             ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
169             ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
170             ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
171             ** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
172             ** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
173             ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
174             ** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
175             ** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
176             ** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
177             ** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
178             ** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
179             ** POSSIBILITY OF SUCH DAMAGE.
180             **
181             */