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