line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#include "erfa.h" |
2
|
|
|
|
|
|
|
|
3
|
0
|
|
|
|
|
|
void eraLteceq(double epj, double dl, double db, double *dr, double *dd) |
4
|
|
|
|
|
|
|
/* |
5
|
|
|
|
|
|
|
** - - - - - - - - - - |
6
|
|
|
|
|
|
|
** e r a L t e c e q |
7
|
|
|
|
|
|
|
** - - - - - - - - - - |
8
|
|
|
|
|
|
|
** |
9
|
|
|
|
|
|
|
** Transformation from ecliptic coordinates (mean equinox and ecliptic |
10
|
|
|
|
|
|
|
** of date) to ICRS RA,Dec, using a long-term precession model. |
11
|
|
|
|
|
|
|
** |
12
|
|
|
|
|
|
|
** Given: |
13
|
|
|
|
|
|
|
** epj double Julian epoch (TT) |
14
|
|
|
|
|
|
|
** dl,db double ecliptic longitude and latitude (radians) |
15
|
|
|
|
|
|
|
** |
16
|
|
|
|
|
|
|
** Returned: |
17
|
|
|
|
|
|
|
** dr,dd double ICRS right ascension and declination (radians) |
18
|
|
|
|
|
|
|
** |
19
|
|
|
|
|
|
|
** 1) No assumptions are made about whether the coordinates represent |
20
|
|
|
|
|
|
|
** starlight and embody astrometric effects such as parallax or |
21
|
|
|
|
|
|
|
** aberration. |
22
|
|
|
|
|
|
|
** |
23
|
|
|
|
|
|
|
** 2) The transformation is approximately that from ecliptic longitude |
24
|
|
|
|
|
|
|
** and latitude (mean equinox and ecliptic of date) to mean J2000.0 |
25
|
|
|
|
|
|
|
** right ascension and declination, with only frame bias (always |
26
|
|
|
|
|
|
|
** less than 25 mas) to disturb this classical picture. |
27
|
|
|
|
|
|
|
** |
28
|
|
|
|
|
|
|
** 3) The Vondrak et al. (2011, 2012) 400 millennia precession model |
29
|
|
|
|
|
|
|
** agrees with the IAU 2006 precession at J2000.0 and stays within |
30
|
|
|
|
|
|
|
** 100 microarcseconds during the 20th and 21st centuries. It is |
31
|
|
|
|
|
|
|
** accurate to a few arcseconds throughout the historical period, |
32
|
|
|
|
|
|
|
** worsening to a few tenths of a degree at the end of the |
33
|
|
|
|
|
|
|
** +/- 200,000 year time span. |
34
|
|
|
|
|
|
|
** |
35
|
|
|
|
|
|
|
** Called: |
36
|
|
|
|
|
|
|
** eraS2c spherical coordinates to unit vector |
37
|
|
|
|
|
|
|
** eraLtecm J2000.0 to ecliptic rotation matrix, long term |
38
|
|
|
|
|
|
|
** eraTrxp product of transpose of r-matrix and p-vector |
39
|
|
|
|
|
|
|
** eraC2s unit vector to spherical coordinates |
40
|
|
|
|
|
|
|
** eraAnp normalize angle into range 0 to 2pi |
41
|
|
|
|
|
|
|
** eraAnpm normalize angle into range +/- pi |
42
|
|
|
|
|
|
|
** |
43
|
|
|
|
|
|
|
** References: |
44
|
|
|
|
|
|
|
** |
45
|
|
|
|
|
|
|
** Vondrak, J., Capitaine, N. and Wallace, P., 2011, New precession |
46
|
|
|
|
|
|
|
** expressions, valid for long time intervals, Astron.Astrophys. 534, |
47
|
|
|
|
|
|
|
** A22 |
48
|
|
|
|
|
|
|
** |
49
|
|
|
|
|
|
|
** Vondrak, J., Capitaine, N. and Wallace, P., 2012, New precession |
50
|
|
|
|
|
|
|
** expressions, valid for long time intervals (Corrigendum), |
51
|
|
|
|
|
|
|
** Astron.Astrophys. 541, C1 |
52
|
|
|
|
|
|
|
** |
53
|
|
|
|
|
|
|
** Copyright (C) 2013-2020, NumFOCUS Foundation. |
54
|
|
|
|
|
|
|
** Derived, with permission, from the SOFA library. See notes at end of file. |
55
|
|
|
|
|
|
|
*/ |
56
|
|
|
|
|
|
|
{ |
57
|
|
|
|
|
|
|
double rm[3][3], v1[3], v2[3], a, b; |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
/* Spherical to Cartesian. */ |
61
|
0
|
|
|
|
|
|
eraS2c(dl, db, v1); |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
/* Rotation matrix, ICRS equatorial to ecliptic. */ |
64
|
0
|
|
|
|
|
|
eraLtecm(epj, rm); |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
/* The transformation from ecliptic to ICRS. */ |
67
|
0
|
|
|
|
|
|
eraTrxp(rm, v1, v2); |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
/* Cartesian to spherical. */ |
70
|
0
|
|
|
|
|
|
eraC2s(v2, &a, &b); |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
/* Express in conventional ranges. */ |
73
|
0
|
|
|
|
|
|
*dr = eraAnp(a); |
74
|
0
|
|
|
|
|
|
*dd = eraAnpm(b); |
75
|
|
|
|
|
|
|
|
76
|
0
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
/*---------------------------------------------------------------------- |
78
|
|
|
|
|
|
|
** |
79
|
|
|
|
|
|
|
** |
80
|
|
|
|
|
|
|
** Copyright (C) 2013-2020, NumFOCUS Foundation. |
81
|
|
|
|
|
|
|
** All rights reserved. |
82
|
|
|
|
|
|
|
** |
83
|
|
|
|
|
|
|
** This library is derived, with permission, from the International |
84
|
|
|
|
|
|
|
** Astronomical Union's "Standards of Fundamental Astronomy" library, |
85
|
|
|
|
|
|
|
** available from http://www.iausofa.org. |
86
|
|
|
|
|
|
|
** |
87
|
|
|
|
|
|
|
** The ERFA version is intended to retain identical functionality to |
88
|
|
|
|
|
|
|
** the SOFA library, but made distinct through different function and |
89
|
|
|
|
|
|
|
** file names, as set out in the SOFA license conditions. The SOFA |
90
|
|
|
|
|
|
|
** original has a role as a reference standard for the IAU and IERS, |
91
|
|
|
|
|
|
|
** and consequently redistribution is permitted only in its unaltered |
92
|
|
|
|
|
|
|
** state. The ERFA version is not subject to this restriction and |
93
|
|
|
|
|
|
|
** therefore can be included in distributions which do not support the |
94
|
|
|
|
|
|
|
** concept of "read only" software. |
95
|
|
|
|
|
|
|
** |
96
|
|
|
|
|
|
|
** Although the intent is to replicate the SOFA API (other than |
97
|
|
|
|
|
|
|
** replacement of prefix names) and results (with the exception of |
98
|
|
|
|
|
|
|
** bugs; any that are discovered will be fixed), SOFA is not |
99
|
|
|
|
|
|
|
** responsible for any errors found in this version of the library. |
100
|
|
|
|
|
|
|
** |
101
|
|
|
|
|
|
|
** If you wish to acknowledge the SOFA heritage, please acknowledge |
102
|
|
|
|
|
|
|
** that you are using a library derived from SOFA, rather than SOFA |
103
|
|
|
|
|
|
|
** itself. |
104
|
|
|
|
|
|
|
** |
105
|
|
|
|
|
|
|
** |
106
|
|
|
|
|
|
|
** TERMS AND CONDITIONS |
107
|
|
|
|
|
|
|
** |
108
|
|
|
|
|
|
|
** Redistribution and use in source and binary forms, with or without |
109
|
|
|
|
|
|
|
** modification, are permitted provided that the following conditions |
110
|
|
|
|
|
|
|
** are met: |
111
|
|
|
|
|
|
|
** |
112
|
|
|
|
|
|
|
** 1 Redistributions of source code must retain the above copyright |
113
|
|
|
|
|
|
|
** notice, this list of conditions and the following disclaimer. |
114
|
|
|
|
|
|
|
** |
115
|
|
|
|
|
|
|
** 2 Redistributions in binary form must reproduce the above copyright |
116
|
|
|
|
|
|
|
** notice, this list of conditions and the following disclaimer in |
117
|
|
|
|
|
|
|
** the documentation and/or other materials provided with the |
118
|
|
|
|
|
|
|
** distribution. |
119
|
|
|
|
|
|
|
** |
120
|
|
|
|
|
|
|
** 3 Neither the name of the Standards Of Fundamental Astronomy Board, |
121
|
|
|
|
|
|
|
** the International Astronomical Union nor the names of its |
122
|
|
|
|
|
|
|
** contributors may be used to endorse or promote products derived |
123
|
|
|
|
|
|
|
** from this software without specific prior written permission. |
124
|
|
|
|
|
|
|
** |
125
|
|
|
|
|
|
|
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
126
|
|
|
|
|
|
|
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
127
|
|
|
|
|
|
|
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
128
|
|
|
|
|
|
|
** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE |
129
|
|
|
|
|
|
|
** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, |
130
|
|
|
|
|
|
|
** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
131
|
|
|
|
|
|
|
** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
132
|
|
|
|
|
|
|
** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
133
|
|
|
|
|
|
|
** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
134
|
|
|
|
|
|
|
** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN |
135
|
|
|
|
|
|
|
** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
136
|
|
|
|
|
|
|
** POSSIBILITY OF SUCH DAMAGE. |
137
|
|
|
|
|
|
|
** |
138
|
|
|
|
|
|
|
*/ |