source: trunk/FACT++/sofa/src/ab.c@ 18355

Last change on this file since 18355 was 18346, checked in by tbretz, 11 years ago
File size: 6.5 KB
Line 
1#include "sofa.h"
2
3void iauAb(double pnat[3], double v[3], double s, double bm1,
4 double ppr[3])
5/*
6** - - - - - -
7** i a u A b
8** - - - - - -
9**
10** Apply aberration to transform natural direction into proper
11** direction.
12**
13** This function is part of the International Astronomical Union's
14** SOFA (Standards of Fundamental Astronomy) software collection.
15**
16** Status: support function.
17**
18** Given:
19** pnat double[3] natural direction to the source (unit vector)
20** v double[3] observer barycentric velocity in units of c
21** s double distance between the Sun and the observer (au)
22** bm1 double sqrt(1-|v|^2): reciprocal of Lorenz factor
23**
24** Returned:
25** ppr double[3] proper direction to source (unit vector)
26**
27** Notes:
28**
29** 1) The algorithm is based on Expr. (7.40) in the Explanatory
30** Supplement (Urban & Seidelmann 2013), but with the following
31** changes:
32**
33** o Rigorous rather than approximate normalization is applied.
34**
35** o The gravitational potential term from Expr. (7) in
36** Klioner (2003) is added, taking into account only the Sun's
37** contribution. This has a maximum effect of about
38** 0.4 microarcsecond.
39**
40** 2) In almost all cases, the maximum accuracy will be limited by the
41** supplied velocity. For example, if the SOFA iauEpv00 function is
42** used, errors of up to 5 microarcseconds could occur.
43**
44** References:
45**
46** Urban, S. & Seidelmann, P. K. (eds), Explanatory Supplement to
47** the Astronomical Almanac, 3rd ed., University Science Books
48** (2013).
49**
50** Klioner, Sergei A., "A practical relativistic model for micro-
51** arcsecond astrometry in space", Astr. J. 125, 1580-1597 (2003).
52**
53** Called:
54** iauPdp scalar product of two p-vectors
55**
56** This revision: 2013 October 9
57**
58** SOFA release 2015-02-09
59**
60** Copyright (C) 2015 IAU SOFA Board. See notes at end.
61*/
62{
63 int i;
64 double pdv, w1, w2, r2, w, p[3], r;
65
66 pdv = iauPdp(pnat, v);
67 w1 = 1.0 + pdv/(1.0 + bm1);
68 w2 = SRS/s;
69 r2 = 0.0;
70 for (i = 0; i < 3; i++) {
71 w = pnat[i]*bm1 + w1*v[i] + w2*(v[i] - pdv*pnat[i]);
72 p[i] = w;
73 r2 = r2 + w*w;
74 }
75 r = sqrt(r2);
76 for (i = 0; i < 3; i++) {
77 ppr[i] = p[i]/r;
78 }
79
80/* Finished. */
81
82/*----------------------------------------------------------------------
83**
84** Copyright (C) 2015
85** Standards Of Fundamental Astronomy Board
86** of the International Astronomical Union.
87**
88** =====================
89** SOFA Software License
90** =====================
91**
92** NOTICE TO USER:
93**
94** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
95** CONDITIONS WHICH APPLY TO ITS USE.
96**
97** 1. The Software is owned by the IAU SOFA Board ("SOFA").
98**
99** 2. Permission is granted to anyone to use the SOFA software for any
100** purpose, including commercial applications, free of charge and
101** without payment of royalties, subject to the conditions and
102** restrictions listed below.
103**
104** 3. You (the user) may copy and distribute SOFA source code to others,
105** and use and adapt its code and algorithms in your own software,
106** on a world-wide, royalty-free basis. That portion of your
107** distribution that does not consist of intact and unchanged copies
108** of SOFA source code files is a "derived work" that must comply
109** with the following requirements:
110**
111** a) Your work shall be marked or carry a statement that it
112** (i) uses routines and computations derived by you from
113** software provided by SOFA under license to you; and
114** (ii) does not itself constitute software provided by and/or
115** endorsed by SOFA.
116**
117** b) The source code of your derived work must contain descriptions
118** of how the derived work is based upon, contains and/or differs
119** from the original SOFA software.
120**
121** c) The names of all routines in your derived work shall not
122** include the prefix "iau" or "sofa" or trivial modifications
123** thereof such as changes of case.
124**
125** d) The origin of the SOFA components of your derived work must
126** not be misrepresented; you must not claim that you wrote the
127** original software, nor file a patent application for SOFA
128** software or algorithms embedded in the SOFA software.
129**
130** e) These requirements must be reproduced intact in any source
131** distribution and shall apply to anyone to whom you have
132** granted a further right to modify the source code of your
133** derived work.
134**
135** Note that, as originally distributed, the SOFA software is
136** intended to be a definitive implementation of the IAU standards,
137** and consequently third-party modifications are discouraged. All
138** variations, no matter how minor, must be explicitly marked as
139** such, as explained above.
140**
141** 4. You shall not cause the SOFA software to be brought into
142** disrepute, either by misuse, or use for inappropriate tasks, or
143** by inappropriate modification.
144**
145** 5. The SOFA software is provided "as is" and SOFA makes no warranty
146** as to its use or performance. SOFA does not and cannot warrant
147** the performance or results which the user may obtain by using the
148** SOFA software. SOFA makes no warranties, express or implied, as
149** to non-infringement of third party rights, merchantability, or
150** fitness for any particular purpose. In no event will SOFA be
151** liable to the user for any consequential, incidental, or special
152** damages, including any lost profits or lost savings, even if a
153** SOFA representative has been advised of such damages, or for any
154** claim by any third party.
155**
156** 6. The provision of any version of the SOFA software under the terms
157** and conditions specified herein does not imply that future
158** versions will also be made available under the same terms and
159** conditions.
160*
161** In any published work or commercial product which uses the SOFA
162** software directly, acknowledgement (see www.iausofa.org) is
163** appreciated.
164**
165** Correspondence concerning SOFA software should be addressed as
166** follows:
167**
168** By email: sofa@ukho.gov.uk
169** By post: IAU SOFA Center
170** HM Nautical Almanac Office
171** UK Hydrographic Office
172** Admiralty Way, Taunton
173** Somerset, TA1 2DN
174** United Kingdom
175**
176**--------------------------------------------------------------------*/
177
178}
Note: See TracBrowser for help on using the repository browser.