source: trunk/FACT++/erfa/src/ab.c@ 18679

Last change on this file since 18679 was 18348, checked in by tbretz, 9 years ago
File size: 5.0 KB
Line 
1#include "erfa.h"
2
3void eraAb(double pnat[3], double v[3], double s, double bm1,
4 double ppr[3])
5/*
6** - - - - - -
7** e r a A b
8** - - - - - -
9**
10** Apply aberration to transform natural direction into proper
11** direction.
12**
13** Given:
14** pnat double[3] natural direction to the source (unit vector)
15** v double[3] observer barycentric velocity in units of c
16** s double distance between the Sun and the observer (au)
17** bm1 double sqrt(1-|v|^2): reciprocal of Lorenz factor
18**
19** Returned:
20** ppr double[3] proper direction to source (unit vector)
21**
22** Notes:
23**
24** 1) The algorithm is based on Expr. (7.40) in the Explanatory
25** Supplement (Urban & Seidelmann 2013), but with the following
26** changes:
27**
28** o Rigorous rather than approximate normalization is applied.
29**
30** o The gravitational potential term from Expr. (7) in
31** Klioner (2003) is added, taking into account only the Sun's
32** contribution. This has a maximum effect of about
33** 0.4 microarcsecond.
34**
35** 2) In almost all cases, the maximum accuracy will be limited by the
36** supplied velocity. For example, if the ERFA eraEpv00 function is
37** used, errors of up to 5 microarcseconds could occur.
38**
39** References:
40**
41** Urban, S. & Seidelmann, P. K. (eds), Explanatory Supplement to
42** the Astronomical Almanac, 3rd ed., University Science Books
43** (2013).
44**
45** Klioner, Sergei A., "A practical relativistic model for micro-
46** arcsecond astrometry in space", Astr. J. 125, 1580-1597 (2003).
47**
48** Called:
49** eraPdp scalar product of two p-vectors
50**
51** Copyright (C) 2013-2015, NumFOCUS Foundation.
52** Derived, with permission, from the SOFA library. See notes at end of file.
53*/
54{
55 int i;
56 double pdv, w1, w2, r2, w, p[3], r;
57
58 pdv = eraPdp(pnat, v);
59 w1 = 1.0 + pdv/(1.0 + bm1);
60 w2 = ERFA_SRS/s;
61 r2 = 0.0;
62 for (i = 0; i < 3; i++) {
63 w = pnat[i]*bm1 + w1*v[i] + w2*(v[i] - pdv*pnat[i]);
64 p[i] = w;
65 r2 = r2 + w*w;
66 }
67 r = sqrt(r2);
68 for (i = 0; i < 3; i++) {
69 ppr[i] = p[i]/r;
70 }
71
72/* Finished. */
73
74}
75/*----------------------------------------------------------------------
76**
77**
78** Copyright (C) 2013-2015, NumFOCUS Foundation.
79** All rights reserved.
80**
81** This library is derived, with permission, from the International
82** Astronomical Union's "Standards of Fundamental Astronomy" library,
83** available from http://www.iausofa.org.
84**
85** The ERFA version is intended to retain identical functionality to
86** the SOFA library, but made distinct through different function and
87** file names, as set out in the SOFA license conditions. The SOFA
88** original has a role as a reference standard for the IAU and IERS,
89** and consequently redistribution is permitted only in its unaltered
90** state. The ERFA version is not subject to this restriction and
91** therefore can be included in distributions which do not support the
92** concept of "read only" software.
93**
94** Although the intent is to replicate the SOFA API (other than
95** replacement of prefix names) and results (with the exception of
96** bugs; any that are discovered will be fixed), SOFA is not
97** responsible for any errors found in this version of the library.
98**
99** If you wish to acknowledge the SOFA heritage, please acknowledge
100** that you are using a library derived from SOFA, rather than SOFA
101** itself.
102**
103**
104** TERMS AND CONDITIONS
105**
106** Redistribution and use in source and binary forms, with or without
107** modification, are permitted provided that the following conditions
108** are met:
109**
110** 1 Redistributions of source code must retain the above copyright
111** notice, this list of conditions and the following disclaimer.
112**
113** 2 Redistributions in binary form must reproduce the above copyright
114** notice, this list of conditions and the following disclaimer in
115** the documentation and/or other materials provided with the
116** distribution.
117**
118** 3 Neither the name of the Standards Of Fundamental Astronomy Board,
119** the International Astronomical Union nor the names of its
120** contributors may be used to endorse or promote products derived
121** from this software without specific prior written permission.
122**
123** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
124** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
125** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
126** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
127** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
128** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
129** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
130** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
131** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
132** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
133** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
134** POSSIBILITY OF SUCH DAMAGE.
135**
136*/
Note: See TracBrowser for help on using the repository browser.