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