File Coverage

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