source: trunk/FACT++/erfa/src/apci13.c@ 19813

Last change on this file since 19813 was 18921, checked in by tbretz, 7 years ago
Updated to ERFA 1.4.0
File size: 8.3 KB
Line 
1#include "erfa.h"
2
3void 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-2017, 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
120/* Earth barycentric & heliocentric position/velocity (au, au/d). */
121 (void) eraEpv00(date1, date2, ehpv, ebpv);
122
123/* Form the equinox based BPN matrix, IAU 2006/2000A. */
124 eraPnm06a(date1, date2, r);
125
126/* Extract CIP X,Y. */
127 eraBpn2xy(r, &x, &y);
128
129/* Obtain CIO locator s. */
130 s = eraS06(date1, date2, x, y);
131
132/* Compute the star-independent astrometry parameters. */
133 eraApci(date1, date2, ebpv, ehpv[0], x, y, s, astrom);
134
135/* Equation of the origins. */
136 *eo = eraEors(r, s);
137
138/* Finished. */
139
140}
141/*----------------------------------------------------------------------
142**
143**
144** Copyright (C) 2013-2017, NumFOCUS Foundation.
145** All rights reserved.
146**
147** This library is derived, with permission, from the International
148** Astronomical Union's "Standards of Fundamental Astronomy" library,
149** available from http://www.iausofa.org.
150**
151** The ERFA version is intended to retain identical functionality to
152** the SOFA library, but made distinct through different function and
153** file names, as set out in the SOFA license conditions. The SOFA
154** original has a role as a reference standard for the IAU and IERS,
155** and consequently redistribution is permitted only in its unaltered
156** state. The ERFA version is not subject to this restriction and
157** therefore can be included in distributions which do not support the
158** concept of "read only" software.
159**
160** Although the intent is to replicate the SOFA API (other than
161** replacement of prefix names) and results (with the exception of
162** bugs; any that are discovered will be fixed), SOFA is not
163** responsible for any errors found in this version of the library.
164**
165** If you wish to acknowledge the SOFA heritage, please acknowledge
166** that you are using a library derived from SOFA, rather than SOFA
167** itself.
168**
169**
170** TERMS AND CONDITIONS
171**
172** Redistribution and use in source and binary forms, with or without
173** modification, are permitted provided that the following conditions
174** are met:
175**
176** 1 Redistributions of source code must retain the above copyright
177** notice, this list of conditions and the following disclaimer.
178**
179** 2 Redistributions in binary form must reproduce the above copyright
180** notice, this list of conditions and the following disclaimer in
181** the documentation and/or other materials provided with the
182** distribution.
183**
184** 3 Neither the name of the Standards Of Fundamental Astronomy Board,
185** the International Astronomical Union nor the names of its
186** contributors may be used to endorse or promote products derived
187** from this software without specific prior written permission.
188**
189** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
190** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
191** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
192** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
193** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
194** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
195** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
196** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
197** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
198** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
199** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
200** POSSIBILITY OF SUCH DAMAGE.
201**
202*/
Note: See TracBrowser for help on using the repository browser.