source: trunk/FACT++/erfa/src/atciqn.c@ 18614

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