source: branches/FACT++_part_filenames/erfa/src/atciqn.c@ 19365

Last change on this file since 19365 was 18711, checked in by tbretz, 8 years ago
Updated to ERFA 1.3.0 (no relevant code change except the leap second at the beginning of 2017)
File size: 8.2 KB
Line 
1#include "erfa.h"
2
3void eraAtciqn(double rc, double dc, double pr, double pd,
4 double px, double rv, eraASTROM *astrom,
5 int n, eraLDBODY b[], double *ri, double *di)
6/*
7** - - - - - - - - - -
8** e r a A t c i q n
9** - - - - - - - - - -
10**
11** Quick ICRS, epoch J2000.0, to CIRS transformation, given precomputed
12** star-independent astrometry parameters plus a list of light-
13** deflecting bodies.
14**
15** Use of this function is appropriate when efficiency is important and
16** where many star positions are to be transformed for one date. The
17** star-independent parameters can be obtained by calling one of the
18** functions eraApci[13], eraApcg[13], eraApco[13] or eraApcs[13].
19**
20**
21** If the only light-deflecting body to be taken into account is the
22** Sun, the eraAtciq function can be used instead. If in addition the
23** parallax and proper motions are zero, the eraAtciqz function can be
24** used.
25**
26** Given:
27** rc,dc double ICRS RA,Dec at J2000.0 (radians)
28** pr double RA proper motion (radians/year; Note 3)
29** pd double Dec proper motion (radians/year)
30** px double parallax (arcsec)
31** rv double radial velocity (km/s, +ve if receding)
32** astrom eraASTROM* star-independent astrometry parameters:
33** pmt double PM time interval (SSB, Julian years)
34** eb double[3] SSB to observer (vector, au)
35** eh double[3] Sun to observer (unit vector)
36** em double distance from Sun to observer (au)
37** v double[3] barycentric observer velocity (vector, c)
38** bm1 double sqrt(1-|v|^2): reciprocal of Lorenz factor
39** bpn double[3][3] bias-precession-nutation matrix
40** along double longitude + s' (radians)
41** xpl double polar motion xp wrt local meridian (radians)
42** ypl double polar motion yp wrt local meridian (radians)
43** sphi double sine of geodetic latitude
44** cphi double cosine of geodetic latitude
45** diurab double magnitude of diurnal aberration vector
46** eral double "local" Earth rotation angle (radians)
47** refa double refraction constant A (radians)
48** refb double refraction constant B (radians)
49** n int number of bodies (Note 3)
50** b eraLDBODY[n] data for each of the n bodies (Notes 3,4):
51** bm double mass of the body (solar masses, Note 5)
52** dl double deflection limiter (Note 6)
53** pv [2][3] barycentric PV of the body (au, au/day)
54**
55** Returned:
56** ri,di double CIRS RA,Dec (radians)
57**
58** Notes:
59**
60** 1) Star data for an epoch other than J2000.0 (for example from the
61** Hipparcos catalog, which has an epoch of J1991.25) will require a
62** preliminary call to eraPmsafe before use.
63**
64** 2) The proper motion in RA is dRA/dt rather than cos(Dec)*dRA/dt.
65**
66** 3) The struct b contains n entries, one for each body to be
67** considered. If n = 0, no gravitational light deflection will be
68** applied, not even for the Sun.
69**
70** 4) The struct b should include an entry for the Sun as well as for
71** any planet or other body to be taken into account. The entries
72** should be in the order in which the light passes the body.
73**
74** 5) In the entry in the b struct for body i, the mass parameter
75** b[i].bm can, as required, be adjusted in order to allow for such
76** effects as quadrupole field.
77**
78** 6) The deflection limiter parameter b[i].dl is phi^2/2, where phi is
79** the angular separation (in radians) between star and body at
80** which limiting is applied. As phi shrinks below the chosen
81** threshold, the deflection is artificially reduced, reaching zero
82** for phi = 0. Example values suitable for a terrestrial
83** observer, together with masses, are as follows:
84**
85** body i b[i].bm b[i].dl
86**
87** Sun 1.0 6e-6
88** Jupiter 0.00095435 3e-9
89** Saturn 0.00028574 3e-10
90**
91** 7) For efficiency, validation of the contents of the b array is
92** omitted. The supplied masses must be greater than zero, the
93** position and velocity vectors must be right, and the deflection
94** limiter greater than zero.
95**
96** Called:
97** eraPmpx proper motion and parallax
98** eraLdn light deflection by n bodies
99** eraAb stellar aberration
100** eraRxp product of r-matrix and pv-vector
101** eraC2s p-vector to spherical
102** eraAnp normalize angle into range 0 to 2pi
103**
104** Copyright (C) 2013-2016, NumFOCUS Foundation.
105** Derived, with permission, from the SOFA library. See notes at end of file.
106*/
107{
108 double pco[3], pnat[3], ppr[3], pi[3], w;
109
110
111/* Proper motion and parallax, giving BCRS coordinate direction. */
112 eraPmpx(rc, dc, pr, pd, px, rv, astrom->pmt, astrom->eb, pco);
113
114/* Light deflection, giving BCRS natural direction. */
115 eraLdn(n, b, astrom->eb, pco, pnat);
116
117/* Aberration, giving GCRS proper direction. */
118 eraAb(pnat, astrom->v, astrom->em, astrom->bm1, ppr);
119
120/* Bias-precession-nutation, giving CIRS proper direction. */
121 eraRxp(astrom->bpn, ppr, pi);
122
123/* CIRS RA,Dec. */
124 eraC2s(pi, &w, di);
125 *ri = eraAnp(w);
126
127/* Finished. */
128
129}
130/*----------------------------------------------------------------------
131**
132**
133** Copyright (C) 2013-2016, NumFOCUS Foundation.
134** All rights reserved.
135**
136** This library is derived, with permission, from the International
137** Astronomical Union's "Standards of Fundamental Astronomy" library,
138** available from http://www.iausofa.org.
139**
140** The ERFA version is intended to retain identical functionality to
141** the SOFA library, but made distinct through different function and
142** file names, as set out in the SOFA license conditions. The SOFA
143** original has a role as a reference standard for the IAU and IERS,
144** and consequently redistribution is permitted only in its unaltered
145** state. The ERFA version is not subject to this restriction and
146** therefore can be included in distributions which do not support the
147** concept of "read only" software.
148**
149** Although the intent is to replicate the SOFA API (other than
150** replacement of prefix names) and results (with the exception of
151** bugs; any that are discovered will be fixed), SOFA is not
152** responsible for any errors found in this version of the library.
153**
154** If you wish to acknowledge the SOFA heritage, please acknowledge
155** that you are using a library derived from SOFA, rather than SOFA
156** itself.
157**
158**
159** TERMS AND CONDITIONS
160**
161** Redistribution and use in source and binary forms, with or without
162** modification, are permitted provided that the following conditions
163** are met:
164**
165** 1 Redistributions of source code must retain the above copyright
166** notice, this list of conditions and the following disclaimer.
167**
168** 2 Redistributions in binary form must reproduce the above copyright
169** notice, this list of conditions and the following disclaimer in
170** the documentation and/or other materials provided with the
171** distribution.
172**
173** 3 Neither the name of the Standards Of Fundamental Astronomy Board,
174** the International Astronomical Union nor the names of its
175** contributors may be used to endorse or promote products derived
176** from this software without specific prior written permission.
177**
178** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
179** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
180** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
181** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
182** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
183** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
184** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
185** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
186** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
187** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
188** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
189** POSSIBILITY OF SUCH DAMAGE.
190**
191*/
Note: See TracBrowser for help on using the repository browser.