| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | #include "erfa.h" | 
| 2 |  |  |  |  |  |  |  | 
| 3 | 0 |  |  |  |  |  | void 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-2019, 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 |  |  |  |  |  |  |  | 
| 59 | 0 |  |  |  |  |  | pdv = eraPdp(pnat, v); | 
| 60 | 0 |  |  |  |  |  | w1 = 1.0 + pdv/(1.0 + bm1); | 
| 61 | 0 |  |  |  |  |  | w2 = ERFA_SRS/s; | 
| 62 |  |  |  |  |  |  | r2 = 0.0; | 
| 63 | 0 | 0 |  |  |  |  | for (i = 0; i < 3; i++) { | 
| 64 | 0 |  |  |  |  |  | w = pnat[i]*bm1 + w1*v[i] + w2*(v[i] - pdv*pnat[i]); | 
| 65 | 0 |  |  |  |  |  | p[i] = w; | 
| 66 | 0 |  |  |  |  |  | r2 = r2 + w*w; | 
| 67 |  |  |  |  |  |  | } | 
| 68 | 0 |  |  |  |  |  | r = sqrt(r2); | 
| 69 | 0 | 0 |  |  |  |  | for (i = 0; i < 3; i++) { | 
| 70 | 0 |  |  |  |  |  | ppr[i] = p[i]/r; | 
| 71 |  |  |  |  |  |  | } | 
| 72 |  |  |  |  |  |  |  | 
| 73 |  |  |  |  |  |  | /* Finished. */ | 
| 74 |  |  |  |  |  |  |  | 
| 75 | 0 |  |  |  |  |  | } | 
| 76 |  |  |  |  |  |  | /*---------------------------------------------------------------------- | 
| 77 |  |  |  |  |  |  | ** | 
| 78 |  |  |  |  |  |  | ** | 
| 79 |  |  |  |  |  |  | **  Copyright (C) 2013-2019, NumFOCUS Foundation. | 
| 80 |  |  |  |  |  |  | **  All rights reserved. | 
| 81 |  |  |  |  |  |  | ** | 
| 82 |  |  |  |  |  |  | **  This library is derived, with permission, from the International | 
| 83 |  |  |  |  |  |  | **  Astronomical Union's "Standards of Fundamental Astronomy" library, | 
| 84 |  |  |  |  |  |  | **  available from http://www.iausofa.org. | 
| 85 |  |  |  |  |  |  | ** | 
| 86 |  |  |  |  |  |  | **  The ERFA version is intended to retain identical functionality to | 
| 87 |  |  |  |  |  |  | **  the SOFA library, but made distinct through different function and | 
| 88 |  |  |  |  |  |  | **  file names, as set out in the SOFA license conditions.  The SOFA | 
| 89 |  |  |  |  |  |  | **  original has a role as a reference standard for the IAU and IERS, | 
| 90 |  |  |  |  |  |  | **  and consequently redistribution is permitted only in its unaltered | 
| 91 |  |  |  |  |  |  | **  state.  The ERFA version is not subject to this restriction and | 
| 92 |  |  |  |  |  |  | **  therefore can be included in distributions which do not support the | 
| 93 |  |  |  |  |  |  | **  concept of "read only" software. | 
| 94 |  |  |  |  |  |  | ** | 
| 95 |  |  |  |  |  |  | **  Although the intent is to replicate the SOFA API (other than | 
| 96 |  |  |  |  |  |  | **  replacement of prefix names) and results (with the exception of | 
| 97 |  |  |  |  |  |  | **  bugs;  any that are discovered will be fixed), SOFA is not | 
| 98 |  |  |  |  |  |  | **  responsible for any errors found in this version of the library. | 
| 99 |  |  |  |  |  |  | ** | 
| 100 |  |  |  |  |  |  | **  If you wish to acknowledge the SOFA heritage, please acknowledge | 
| 101 |  |  |  |  |  |  | **  that you are using a library derived from SOFA, rather than SOFA | 
| 102 |  |  |  |  |  |  | **  itself. | 
| 103 |  |  |  |  |  |  | ** | 
| 104 |  |  |  |  |  |  | ** | 
| 105 |  |  |  |  |  |  | **  TERMS AND CONDITIONS | 
| 106 |  |  |  |  |  |  | ** | 
| 107 |  |  |  |  |  |  | **  Redistribution and use in source and binary forms, with or without | 
| 108 |  |  |  |  |  |  | **  modification, are permitted provided that the following conditions | 
| 109 |  |  |  |  |  |  | **  are met: | 
| 110 |  |  |  |  |  |  | ** | 
| 111 |  |  |  |  |  |  | **  1 Redistributions of source code must retain the above copyright | 
| 112 |  |  |  |  |  |  | **    notice, this list of conditions and the following disclaimer. | 
| 113 |  |  |  |  |  |  | ** | 
| 114 |  |  |  |  |  |  | **  2 Redistributions in binary form must reproduce the above copyright | 
| 115 |  |  |  |  |  |  | **    notice, this list of conditions and the following disclaimer in | 
| 116 |  |  |  |  |  |  | **    the documentation and/or other materials provided with the | 
| 117 |  |  |  |  |  |  | **    distribution. | 
| 118 |  |  |  |  |  |  | ** | 
| 119 |  |  |  |  |  |  | **  3 Neither the name of the Standards Of Fundamental Astronomy Board, | 
| 120 |  |  |  |  |  |  | **    the International Astronomical Union nor the names of its | 
| 121 |  |  |  |  |  |  | **    contributors may be used to endorse or promote products derived | 
| 122 |  |  |  |  |  |  | **    from this software without specific prior written permission. | 
| 123 |  |  |  |  |  |  | ** | 
| 124 |  |  |  |  |  |  | **  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | 
| 125 |  |  |  |  |  |  | **  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | 
| 126 |  |  |  |  |  |  | **  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | 
| 127 |  |  |  |  |  |  | **  FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE | 
| 128 |  |  |  |  |  |  | **  COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, | 
| 129 |  |  |  |  |  |  | **  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | 
| 130 |  |  |  |  |  |  | **  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 
| 131 |  |  |  |  |  |  | **  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | 
| 132 |  |  |  |  |  |  | **  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 
| 133 |  |  |  |  |  |  | **  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN | 
| 134 |  |  |  |  |  |  | **  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 
| 135 |  |  |  |  |  |  | **  POSSIBILITY OF SUCH DAMAGE. | 
| 136 |  |  |  |  |  |  | ** | 
| 137 |  |  |  |  |  |  | */ |