celes 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +32 -0
- data/README.md +179 -0
- data/Rakefile +1 -0
- data/celes.gemspec +22 -0
- data/ext/celes/a2af.c +120 -0
- data/ext/celes/a2tf.c +116 -0
- data/ext/celes/af2a.c +107 -0
- data/ext/celes/anp.c +82 -0
- data/ext/celes/anpm.c +82 -0
- data/ext/celes/bi00.c +116 -0
- data/ext/celes/bp00.c +173 -0
- data/ext/celes/bp06.c +136 -0
- data/ext/celes/bpn2xy.c +100 -0
- data/ext/celes/c2i00a.c +139 -0
- data/ext/celes/c2i00b.c +139 -0
- data/ext/celes/c2i06a.c +136 -0
- data/ext/celes/c2ibpn.c +142 -0
- data/ext/celes/c2ixy.c +131 -0
- data/ext/celes/c2ixys.c +123 -0
- data/ext/celes/c2s.c +96 -0
- data/ext/celes/c2t00a.c +154 -0
- data/ext/celes/c2t00b.c +150 -0
- data/ext/celes/c2t06a.c +152 -0
- data/ext/celes/c2tcio.c +122 -0
- data/ext/celes/c2teqx.c +122 -0
- data/ext/celes/c2tpe.c +167 -0
- data/ext/celes/c2txy.c +159 -0
- data/ext/celes/cal2jd.c +139 -0
- data/ext/celes/celes_core.c +2522 -0
- data/ext/celes/cp.c +80 -0
- data/ext/celes/cpv.c +82 -0
- data/ext/celes/cr.c +83 -0
- data/ext/celes/d2dtf.c +206 -0
- data/ext/celes/d2tf.c +160 -0
- data/ext/celes/dat.c +289 -0
- data/ext/celes/depend +25 -0
- data/ext/celes/dtdb.c +1213 -0
- data/ext/celes/dtf2d.c +196 -0
- data/ext/celes/ee00.c +128 -0
- data/ext/celes/ee00a.c +135 -0
- data/ext/celes/ee00b.c +141 -0
- data/ext/celes/ee06a.c +122 -0
- data/ext/celes/eect00.c +282 -0
- data/ext/celes/eform.c +147 -0
- data/ext/celes/eo06a.c +131 -0
- data/ext/celes/eors.c +108 -0
- data/ext/celes/epb.c +96 -0
- data/ext/celes/epb2jd.c +91 -0
- data/ext/celes/epj.c +93 -0
- data/ext/celes/epj2jd.c +91 -0
- data/ext/celes/epv00.c +2589 -0
- data/ext/celes/eqeq94.c +131 -0
- data/ext/celes/era00.c +136 -0
- data/ext/celes/extconf.rb +4 -0
- data/ext/celes/fad03.c +103 -0
- data/ext/celes/fae03.c +102 -0
- data/ext/celes/faf03.c +106 -0
- data/ext/celes/faju03.c +102 -0
- data/ext/celes/fal03.c +103 -0
- data/ext/celes/falp03.c +103 -0
- data/ext/celes/fama03.c +102 -0
- data/ext/celes/fame03.c +102 -0
- data/ext/celes/fane03.c +99 -0
- data/ext/celes/faom03.c +104 -0
- data/ext/celes/fapa03.c +103 -0
- data/ext/celes/fasa03.c +102 -0
- data/ext/celes/faur03.c +99 -0
- data/ext/celes/fave03.c +102 -0
- data/ext/celes/fk52h.c +143 -0
- data/ext/celes/fk5hip.c +126 -0
- data/ext/celes/fk5hz.c +160 -0
- data/ext/celes/fw2m.c +134 -0
- data/ext/celes/fw2xy.c +120 -0
- data/ext/celes/gc2gd.c +134 -0
- data/ext/celes/gc2gde.c +200 -0
- data/ext/celes/gd2gc.c +134 -0
- data/ext/celes/gd2gce.c +138 -0
- data/ext/celes/gmst00.c +145 -0
- data/ext/celes/gmst06.c +136 -0
- data/ext/celes/gmst82.c +151 -0
- data/ext/celes/gst00a.c +138 -0
- data/ext/celes/gst00b.c +146 -0
- data/ext/celes/gst06.c +140 -0
- data/ext/celes/gst06a.c +131 -0
- data/ext/celes/gst94.c +131 -0
- data/ext/celes/h2fk5.c +148 -0
- data/ext/celes/hfk5z.c +175 -0
- data/ext/celes/ir.c +83 -0
- data/ext/celes/jd2cal.c +155 -0
- data/ext/celes/jdcalf.c +161 -0
- data/ext/celes/num00a.c +121 -0
- data/ext/celes/num00b.c +121 -0
- data/ext/celes/num06a.c +125 -0
- data/ext/celes/numat.c +109 -0
- data/ext/celes/nut00a.c +2047 -0
- data/ext/celes/nut00b.c +372 -0
- data/ext/celes/nut06a.c +153 -0
- data/ext/celes/nut80.c +325 -0
- data/ext/celes/nutm80.c +117 -0
- data/ext/celes/obl06.c +118 -0
- data/ext/celes/obl80.c +118 -0
- data/ext/celes/p06e.c +321 -0
- data/ext/celes/p2pv.c +83 -0
- data/ext/celes/p2s.c +91 -0
- data/ext/celes/pap.c +139 -0
- data/ext/celes/pas.c +96 -0
- data/ext/celes/pb06.c +144 -0
- data/ext/celes/pdp.c +84 -0
- data/ext/celes/pfw06.c +165 -0
- data/ext/celes/plan94.c +514 -0
- data/ext/celes/pm.c +83 -0
- data/ext/celes/pmat00.c +118 -0
- data/ext/celes/pmat06.c +122 -0
- data/ext/celes/pmat76.c +141 -0
- data/ext/celes/pmp.c +85 -0
- data/ext/celes/pn.c +109 -0
- data/ext/celes/pn00.c +177 -0
- data/ext/celes/pn00a.c +162 -0
- data/ext/celes/pn00b.c +162 -0
- data/ext/celes/pn06.c +187 -0
- data/ext/celes/pn06a.c +152 -0
- data/ext/celes/pnm00a.c +121 -0
- data/ext/celes/pnm00b.c +121 -0
- data/ext/celes/pnm06a.c +124 -0
- data/ext/celes/pnm80.c +126 -0
- data/ext/celes/pom00.c +115 -0
- data/ext/celes/ppp.c +85 -0
- data/ext/celes/ppsp.c +94 -0
- data/ext/celes/pr00.c +142 -0
- data/ext/celes/prec76.c +148 -0
- data/ext/celes/pv2p.c +81 -0
- data/ext/celes/pv2s.c +144 -0
- data/ext/celes/pvdpv.c +102 -0
- data/ext/celes/pvm.c +86 -0
- data/ext/celes/pvmpv.c +87 -0
- data/ext/celes/pvppv.c +87 -0
- data/ext/celes/pvstar.c +207 -0
- data/ext/celes/pvu.c +93 -0
- data/ext/celes/pvup.c +88 -0
- data/ext/celes/pvxpv.c +107 -0
- data/ext/celes/pxp.c +94 -0
- data/ext/celes/rm2v.c +111 -0
- data/ext/celes/rv2m.c +118 -0
- data/ext/celes/rx.c +110 -0
- data/ext/celes/rxp.c +99 -0
- data/ext/celes/rxpv.c +86 -0
- data/ext/celes/rxr.c +99 -0
- data/ext/celes/ry.c +110 -0
- data/ext/celes/rz.c +110 -0
- data/ext/celes/s00.c +371 -0
- data/ext/celes/s00a.c +143 -0
- data/ext/celes/s00b.c +143 -0
- data/ext/celes/s06.c +368 -0
- data/ext/celes/s06a.c +145 -0
- data/ext/celes/s2c.c +85 -0
- data/ext/celes/s2p.c +88 -0
- data/ext/celes/s2pv.c +103 -0
- data/ext/celes/s2xpv.c +87 -0
- data/ext/celes/sepp.c +105 -0
- data/ext/celes/seps.c +93 -0
- data/ext/celes/sofa.h +379 -0
- data/ext/celes/sofam.h +155 -0
- data/ext/celes/sp00.c +118 -0
- data/ext/celes/starpm.c +205 -0
- data/ext/celes/starpv.c +264 -0
- data/ext/celes/sxp.c +84 -0
- data/ext/celes/sxpv.c +85 -0
- data/ext/celes/taitt.c +110 -0
- data/ext/celes/taiut1.c +112 -0
- data/ext/celes/taiutc.c +182 -0
- data/ext/celes/tcbtdb.c +132 -0
- data/ext/celes/tcgtt.c +109 -0
- data/ext/celes/tdbtcb.c +137 -0
- data/ext/celes/tdbtt.c +122 -0
- data/ext/celes/tf2a.c +107 -0
- data/ext/celes/tf2d.c +107 -0
- data/ext/celes/tr.c +93 -0
- data/ext/celes/trxp.c +93 -0
- data/ext/celes/trxpv.c +93 -0
- data/ext/celes/tttai.c +110 -0
- data/ext/celes/tttcg.c +112 -0
- data/ext/celes/tttdb.c +121 -0
- data/ext/celes/ttut1.c +110 -0
- data/ext/celes/ut1tai.c +111 -0
- data/ext/celes/ut1tt.c +110 -0
- data/ext/celes/ut1utc.c +193 -0
- data/ext/celes/utctai.c +163 -0
- data/ext/celes/utcut1.c +151 -0
- data/ext/celes/xy06.c +2758 -0
- data/ext/celes/xys00a.c +133 -0
- data/ext/celes/xys00b.c +133 -0
- data/ext/celes/xys06a.c +133 -0
- data/ext/celes/zp.c +77 -0
- data/ext/celes/zpv.c +79 -0
- data/ext/celes/zr.c +83 -0
- data/lib/celes.rb +6 -0
- data/lib/celes/version.rb +3 -0
- data/sofa_20120301.diff +31384 -0
- data/test/t_sofa.rb +8228 -0
- metadata +251 -0
data/ext/celes/gmst00.c
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
#include "sofam.h"
|
|
2
|
+
|
|
3
|
+
double iauGmst00(double uta, double utb, double tta, double ttb)
|
|
4
|
+
/*
|
|
5
|
+
** - - - - - - - - - -
|
|
6
|
+
** i a u G m s t 0 0
|
|
7
|
+
** - - - - - - - - - -
|
|
8
|
+
**
|
|
9
|
+
** Greenwich mean sidereal time (model consistent with IAU 2000
|
|
10
|
+
** resolutions).
|
|
11
|
+
**
|
|
12
|
+
** Status: canonical model.
|
|
13
|
+
**
|
|
14
|
+
** Given:
|
|
15
|
+
** uta,utb double UT1 as a 2-part Julian Date (Notes 1,2)
|
|
16
|
+
** tta,ttb double TT as a 2-part Julian Date (Notes 1,2)
|
|
17
|
+
**
|
|
18
|
+
** Returned (function value):
|
|
19
|
+
** double Greenwich mean sidereal time (radians)
|
|
20
|
+
**
|
|
21
|
+
** Notes:
|
|
22
|
+
**
|
|
23
|
+
** 1) The UT1 and TT dates uta+utb and tta+ttb respectively, are both
|
|
24
|
+
** Julian Dates, apportioned in any convenient way between the
|
|
25
|
+
** argument pairs. For example, JD=2450123.7 could be expressed in
|
|
26
|
+
** any of these ways, among others:
|
|
27
|
+
**
|
|
28
|
+
** Part A Part B
|
|
29
|
+
**
|
|
30
|
+
** 2450123.7 0.0 (JD method)
|
|
31
|
+
** 2451545.0 -1421.3 (J2000 method)
|
|
32
|
+
** 2400000.5 50123.2 (MJD method)
|
|
33
|
+
** 2450123.5 0.2 (date & time method)
|
|
34
|
+
**
|
|
35
|
+
** The JD method is the most natural and convenient to use in
|
|
36
|
+
** cases where the loss of several decimal digits of resolution
|
|
37
|
+
** is acceptable (in the case of UT; the TT is not at all critical
|
|
38
|
+
** in this respect). The J2000 and MJD methods are good compromises
|
|
39
|
+
** between resolution and convenience. For UT, the date & time
|
|
40
|
+
** method is best matched to the algorithm that is used by the Earth
|
|
41
|
+
** Rotation Angle function, called internally: maximum precision is
|
|
42
|
+
** delivered when the uta argument is for 0hrs UT1 on the day in
|
|
43
|
+
** question and the utb argument lies in the range 0 to 1, or vice
|
|
44
|
+
** versa.
|
|
45
|
+
**
|
|
46
|
+
** 2) Both UT1 and TT are required, UT1 to predict the Earth rotation
|
|
47
|
+
** and TT to predict the effects of precession. If UT1 is used for
|
|
48
|
+
** both purposes, errors of order 100 microarcseconds result.
|
|
49
|
+
**
|
|
50
|
+
** 3) This GMST is compatible with the IAU 2000 resolutions and must be
|
|
51
|
+
** used only in conjunction with other IAU 2000 compatible
|
|
52
|
+
** components such as precession-nutation and equation of the
|
|
53
|
+
** equinoxes.
|
|
54
|
+
**
|
|
55
|
+
** 4) The result is returned in the range 0 to 2pi.
|
|
56
|
+
**
|
|
57
|
+
** 5) The algorithm is from Capitaine et al. (2003) and IERS
|
|
58
|
+
** Conventions 2003.
|
|
59
|
+
**
|
|
60
|
+
** Called:
|
|
61
|
+
** iauEra00 Earth rotation angle, IAU 2000
|
|
62
|
+
** iauAnp normalize angle into range 0 to 2pi
|
|
63
|
+
**
|
|
64
|
+
** References:
|
|
65
|
+
**
|
|
66
|
+
** Capitaine, N., Wallace, P.T. and McCarthy, D.D., "Expressions to
|
|
67
|
+
** implement the IAU 2000 definition of UT1", Astronomy &
|
|
68
|
+
** Astrophysics, 406, 1135-1149 (2003)
|
|
69
|
+
**
|
|
70
|
+
** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
|
|
71
|
+
** IERS Technical Note No. 32, BKG (2004)
|
|
72
|
+
**
|
|
73
|
+
** This revision: 2009 March 16
|
|
74
|
+
**
|
|
75
|
+
** Original version 2012-03-01
|
|
76
|
+
**
|
|
77
|
+
** Copyright (C) 2013 Naoki Arita. See notes at end.
|
|
78
|
+
*/
|
|
79
|
+
{
|
|
80
|
+
double t, gmst;
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
/* TT Julian centuries since J2000.0. */
|
|
84
|
+
t = ((tta - DJ00) + ttb) / DJC;
|
|
85
|
+
|
|
86
|
+
/* Greenwich Mean Sidereal Time, IAU 2000. */
|
|
87
|
+
gmst = iauAnp(iauEra00(uta, utb) +
|
|
88
|
+
( 0.014506 +
|
|
89
|
+
( 4612.15739966 +
|
|
90
|
+
( 1.39667721 +
|
|
91
|
+
( -0.00009344 +
|
|
92
|
+
( 0.00001882 )
|
|
93
|
+
* t) * t) * t) * t) * DAS2R);
|
|
94
|
+
|
|
95
|
+
return gmst;
|
|
96
|
+
|
|
97
|
+
/*----------------------------------------------------------------------
|
|
98
|
+
**
|
|
99
|
+
** Celes is a wrapper of the SOFA Library for Ruby.
|
|
100
|
+
**
|
|
101
|
+
** This file is redistributed and relicensed in accordance with
|
|
102
|
+
** the SOFA Software License (http://www.iausofa.org/tandc.html).
|
|
103
|
+
**
|
|
104
|
+
** The original library is available from IAU Standards of
|
|
105
|
+
** Fundamental Astronomy (http://www.iausofa.org/).
|
|
106
|
+
**
|
|
107
|
+
**
|
|
108
|
+
**
|
|
109
|
+
**
|
|
110
|
+
**
|
|
111
|
+
** Copyright (C) 2013, Naoki Arita
|
|
112
|
+
** All rights reserved.
|
|
113
|
+
**
|
|
114
|
+
** Redistribution and use in source and binary forms, with or without
|
|
115
|
+
** modification, are permitted provided that the following conditions
|
|
116
|
+
** are met:
|
|
117
|
+
**
|
|
118
|
+
** 1 Redistributions of source code must retain the above copyright
|
|
119
|
+
** notice, this list of conditions and the following disclaimer.
|
|
120
|
+
**
|
|
121
|
+
** 2 Redistributions in binary form must reproduce the above copyright
|
|
122
|
+
** notice, this list of conditions and the following disclaimer in
|
|
123
|
+
** the documentation and/or other materials provided with the
|
|
124
|
+
** distribution.
|
|
125
|
+
**
|
|
126
|
+
** 3 Neither the name of the Standards Of Fundamental Astronomy Board,
|
|
127
|
+
** the International Astronomical Union nor the names of its
|
|
128
|
+
** contributors may be used to endorse or promote products derived
|
|
129
|
+
** from this software without specific prior written permission.
|
|
130
|
+
**
|
|
131
|
+
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
132
|
+
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
133
|
+
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
|
134
|
+
** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
|
135
|
+
** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
136
|
+
** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
|
137
|
+
** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
138
|
+
** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
139
|
+
** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
140
|
+
** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
|
141
|
+
** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
142
|
+
** POSSIBILITY OF SUCH DAMAGE.
|
|
143
|
+
**
|
|
144
|
+
**--------------------------------------------------------------------*/
|
|
145
|
+
}
|
data/ext/celes/gmst06.c
ADDED
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
#include "sofam.h"
|
|
2
|
+
|
|
3
|
+
double iauGmst06(double uta, double utb, double tta, double ttb)
|
|
4
|
+
/*
|
|
5
|
+
** - - - - - - - - - -
|
|
6
|
+
** i a u G m s t 0 6
|
|
7
|
+
** - - - - - - - - - -
|
|
8
|
+
**
|
|
9
|
+
** Greenwich mean sidereal time (consistent with IAU 2006 precession).
|
|
10
|
+
**
|
|
11
|
+
** Status: canonical model.
|
|
12
|
+
**
|
|
13
|
+
** Given:
|
|
14
|
+
** uta,utb double UT1 as a 2-part Julian Date (Notes 1,2)
|
|
15
|
+
** tta,ttb double TT as a 2-part Julian Date (Notes 1,2)
|
|
16
|
+
**
|
|
17
|
+
** Returned (function value):
|
|
18
|
+
** double Greenwich mean sidereal time (radians)
|
|
19
|
+
**
|
|
20
|
+
** Notes:
|
|
21
|
+
**
|
|
22
|
+
** 1) The UT1 and TT dates uta+utb and tta+ttb respectively, are both
|
|
23
|
+
** Julian Dates, apportioned in any convenient way between the
|
|
24
|
+
** argument pairs. For example, JD=2450123.7 could be expressed in
|
|
25
|
+
** any of these ways, among others:
|
|
26
|
+
**
|
|
27
|
+
** Part A Part B
|
|
28
|
+
**
|
|
29
|
+
** 2450123.7 0.0 (JD method)
|
|
30
|
+
** 2451545.0 -1421.3 (J2000 method)
|
|
31
|
+
** 2400000.5 50123.2 (MJD method)
|
|
32
|
+
** 2450123.5 0.2 (date & time method)
|
|
33
|
+
**
|
|
34
|
+
** The JD method is the most natural and convenient to use in
|
|
35
|
+
** cases where the loss of several decimal digits of resolution
|
|
36
|
+
** is acceptable (in the case of UT; the TT is not at all critical
|
|
37
|
+
** in this respect). The J2000 and MJD methods are good compromises
|
|
38
|
+
** between resolution and convenience. For UT, the date & time
|
|
39
|
+
** method is best matched to the algorithm that is used by the Earth
|
|
40
|
+
** rotation angle function, called internally: maximum precision is
|
|
41
|
+
** delivered when the uta argument is for 0hrs UT1 on the day in
|
|
42
|
+
** question and the utb argument lies in the range 0 to 1, or vice
|
|
43
|
+
** versa.
|
|
44
|
+
**
|
|
45
|
+
** 2) Both UT1 and TT are required, UT1 to predict the Earth rotation
|
|
46
|
+
** and TT to predict the effects of precession. If UT1 is used for
|
|
47
|
+
** both purposes, errors of order 100 microarcseconds result.
|
|
48
|
+
**
|
|
49
|
+
** 3) This GMST is compatible with the IAU 2006 precession and must not
|
|
50
|
+
** be used with other precession models.
|
|
51
|
+
**
|
|
52
|
+
** 4) The result is returned in the range 0 to 2pi.
|
|
53
|
+
**
|
|
54
|
+
** Called:
|
|
55
|
+
** iauEra00 Earth rotation angle, IAU 2000
|
|
56
|
+
** iauAnp normalize angle into range 0 to 2pi
|
|
57
|
+
**
|
|
58
|
+
** Reference:
|
|
59
|
+
**
|
|
60
|
+
** Capitaine, N., Wallace, P.T. & Chapront, J., 2005,
|
|
61
|
+
** Astron.Astrophys. 432, 355
|
|
62
|
+
**
|
|
63
|
+
** This revision: 2008 May 24
|
|
64
|
+
**
|
|
65
|
+
** Original version 2012-03-01
|
|
66
|
+
**
|
|
67
|
+
** Copyright (C) 2013 Naoki Arita. See notes at end.
|
|
68
|
+
*/
|
|
69
|
+
{
|
|
70
|
+
double t, gmst;
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
/* TT Julian centuries since J2000.0. */
|
|
74
|
+
t = ((tta - DJ00) + ttb) / DJC;
|
|
75
|
+
|
|
76
|
+
/* Greenwich mean sidereal time, IAU 2006. */
|
|
77
|
+
gmst = iauAnp(iauEra00(uta, utb) +
|
|
78
|
+
( 0.014506 +
|
|
79
|
+
( 4612.156534 +
|
|
80
|
+
( 1.3915817 +
|
|
81
|
+
( -0.00000044 +
|
|
82
|
+
( -0.000029956 +
|
|
83
|
+
( -0.0000000368 )
|
|
84
|
+
* t) * t) * t) * t) * t) * DAS2R);
|
|
85
|
+
|
|
86
|
+
return gmst;
|
|
87
|
+
|
|
88
|
+
/*----------------------------------------------------------------------
|
|
89
|
+
**
|
|
90
|
+
** Celes is a wrapper of the SOFA Library for Ruby.
|
|
91
|
+
**
|
|
92
|
+
** This file is redistributed and relicensed in accordance with
|
|
93
|
+
** the SOFA Software License (http://www.iausofa.org/tandc.html).
|
|
94
|
+
**
|
|
95
|
+
** The original library is available from IAU Standards of
|
|
96
|
+
** Fundamental Astronomy (http://www.iausofa.org/).
|
|
97
|
+
**
|
|
98
|
+
**
|
|
99
|
+
**
|
|
100
|
+
**
|
|
101
|
+
**
|
|
102
|
+
** Copyright (C) 2013, Naoki Arita
|
|
103
|
+
** All rights reserved.
|
|
104
|
+
**
|
|
105
|
+
** Redistribution and use in source and binary forms, with or without
|
|
106
|
+
** modification, are permitted provided that the following conditions
|
|
107
|
+
** are met:
|
|
108
|
+
**
|
|
109
|
+
** 1 Redistributions of source code must retain the above copyright
|
|
110
|
+
** notice, this list of conditions and the following disclaimer.
|
|
111
|
+
**
|
|
112
|
+
** 2 Redistributions in binary form must reproduce the above copyright
|
|
113
|
+
** notice, this list of conditions and the following disclaimer in
|
|
114
|
+
** the documentation and/or other materials provided with the
|
|
115
|
+
** distribution.
|
|
116
|
+
**
|
|
117
|
+
** 3 Neither the name of the Standards Of Fundamental Astronomy Board,
|
|
118
|
+
** the International Astronomical Union nor the names of its
|
|
119
|
+
** contributors may be used to endorse or promote products derived
|
|
120
|
+
** from this software without specific prior written permission.
|
|
121
|
+
**
|
|
122
|
+
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
123
|
+
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
124
|
+
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
|
125
|
+
** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
|
126
|
+
** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
127
|
+
** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
|
128
|
+
** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
129
|
+
** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
130
|
+
** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
131
|
+
** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
|
132
|
+
** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
133
|
+
** POSSIBILITY OF SUCH DAMAGE.
|
|
134
|
+
**
|
|
135
|
+
**--------------------------------------------------------------------*/
|
|
136
|
+
}
|
data/ext/celes/gmst82.c
ADDED
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
#include "sofam.h"
|
|
2
|
+
|
|
3
|
+
double iauGmst82(double dj1, double dj2)
|
|
4
|
+
/*
|
|
5
|
+
** - - - - - - - - - -
|
|
6
|
+
** i a u G m s t 8 2
|
|
7
|
+
** - - - - - - - - - -
|
|
8
|
+
**
|
|
9
|
+
** Universal Time to Greenwich mean sidereal time (IAU 1982 model).
|
|
10
|
+
**
|
|
11
|
+
** Status: canonical model.
|
|
12
|
+
**
|
|
13
|
+
** Given:
|
|
14
|
+
** dj1,dj2 double UT1 Julian Date (see note)
|
|
15
|
+
**
|
|
16
|
+
** Returned (function value):
|
|
17
|
+
** double Greenwich mean sidereal time (radians)
|
|
18
|
+
**
|
|
19
|
+
** Notes:
|
|
20
|
+
**
|
|
21
|
+
** 1) The UT1 date dj1+dj2 is a Julian Date, apportioned in any
|
|
22
|
+
** convenient way between the arguments dj1 and dj2. For example,
|
|
23
|
+
** JD(UT1)=2450123.7 could be expressed in any of these ways,
|
|
24
|
+
** among others:
|
|
25
|
+
**
|
|
26
|
+
** dj1 dj2
|
|
27
|
+
**
|
|
28
|
+
** 2450123.7D0 0D0 (JD method)
|
|
29
|
+
** 2451545D0 -1421.3D0 (J2000 method)
|
|
30
|
+
** 2400000.5D0 50123.2D0 (MJD method)
|
|
31
|
+
** 2450123.5D0 0.2D0 (date & time method)
|
|
32
|
+
**
|
|
33
|
+
** The JD method is the most natural and convenient to use in
|
|
34
|
+
** cases where the loss of several decimal digits of resolution
|
|
35
|
+
** is acceptable. The J2000 and MJD methods are good compromises
|
|
36
|
+
** between resolution and convenience. The date & time method is
|
|
37
|
+
** best matched to the algorithm used: maximum accuracy (or, at
|
|
38
|
+
** least, minimum noise) is delivered when the dj1 argument is for
|
|
39
|
+
** 0hrs UT1 on the day in question and the dj2 argument lies in the
|
|
40
|
+
** range 0 to 1, or vice versa.
|
|
41
|
+
**
|
|
42
|
+
** 2) The algorithm is based on the IAU 1982 expression. This is
|
|
43
|
+
** always described as giving the GMST at 0 hours UT1. In fact, it
|
|
44
|
+
** gives the difference between the GMST and the UT, the steady
|
|
45
|
+
** 4-minutes-per-day drawing-ahead of ST with respect to UT. When
|
|
46
|
+
** whole days are ignored, the expression happens to equal the GMST
|
|
47
|
+
** at 0 hours UT1 each day.
|
|
48
|
+
**
|
|
49
|
+
** 3) In this function, the entire UT1 (the sum of the two arguments
|
|
50
|
+
** dj1 and dj2) is used directly as the argument for the standard
|
|
51
|
+
** formula, the constant term of which is adjusted by 12 hours to
|
|
52
|
+
** take account of the noon phasing of Julian Date. The UT1 is then
|
|
53
|
+
** added, but omitting whole days to conserve accuracy.
|
|
54
|
+
**
|
|
55
|
+
** Called:
|
|
56
|
+
** iauAnp normalize angle into range 0 to 2pi
|
|
57
|
+
**
|
|
58
|
+
** References:
|
|
59
|
+
**
|
|
60
|
+
** Transactions of the International Astronomical Union,
|
|
61
|
+
** XVIII B, 67 (1983).
|
|
62
|
+
**
|
|
63
|
+
** Aoki et al., Astron. Astrophys. 105, 359-361 (1982).
|
|
64
|
+
**
|
|
65
|
+
** This revision: 2008 May 24
|
|
66
|
+
**
|
|
67
|
+
** Original version 2012-03-01
|
|
68
|
+
**
|
|
69
|
+
** Copyright (C) 2013 Naoki Arita. See notes at end.
|
|
70
|
+
*/
|
|
71
|
+
{
|
|
72
|
+
/* Coefficients of IAU 1982 GMST-UT1 model */
|
|
73
|
+
double A = 24110.54841 - DAYSEC / 2.0;
|
|
74
|
+
double B = 8640184.812866;
|
|
75
|
+
double C = 0.093104;
|
|
76
|
+
double D = -6.2e-6;
|
|
77
|
+
|
|
78
|
+
/* Note: the first constant, A, has to be adjusted by 12 hours */
|
|
79
|
+
/* because the UT1 is supplied as a Julian date, which begins */
|
|
80
|
+
/* at noon. */
|
|
81
|
+
|
|
82
|
+
double d1, d2, t, f, gmst;
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
/* Julian centuries since fundamental epoch. */
|
|
86
|
+
if (dj1 < dj2) {
|
|
87
|
+
d1 = dj1;
|
|
88
|
+
d2 = dj2;
|
|
89
|
+
} else {
|
|
90
|
+
d1 = dj2;
|
|
91
|
+
d2 = dj1;
|
|
92
|
+
}
|
|
93
|
+
t = (d1 + (d2 - DJ00)) / DJC;
|
|
94
|
+
|
|
95
|
+
/* Fractional part of JD(UT1), in seconds. */
|
|
96
|
+
f = DAYSEC * (fmod(d1, 1.0) + fmod(d2, 1.0));
|
|
97
|
+
|
|
98
|
+
/* GMST at this UT1. */
|
|
99
|
+
gmst = iauAnp(DS2R * ((A + (B + (C + D * t) * t) * t) + f));
|
|
100
|
+
|
|
101
|
+
return gmst;
|
|
102
|
+
|
|
103
|
+
/*----------------------------------------------------------------------
|
|
104
|
+
**
|
|
105
|
+
** Celes is a wrapper of the SOFA Library for Ruby.
|
|
106
|
+
**
|
|
107
|
+
** This file is redistributed and relicensed in accordance with
|
|
108
|
+
** the SOFA Software License (http://www.iausofa.org/tandc.html).
|
|
109
|
+
**
|
|
110
|
+
** The original library is available from IAU Standards of
|
|
111
|
+
** Fundamental Astronomy (http://www.iausofa.org/).
|
|
112
|
+
**
|
|
113
|
+
**
|
|
114
|
+
**
|
|
115
|
+
**
|
|
116
|
+
**
|
|
117
|
+
** Copyright (C) 2013, Naoki Arita
|
|
118
|
+
** All rights reserved.
|
|
119
|
+
**
|
|
120
|
+
** Redistribution and use in source and binary forms, with or without
|
|
121
|
+
** modification, are permitted provided that the following conditions
|
|
122
|
+
** are met:
|
|
123
|
+
**
|
|
124
|
+
** 1 Redistributions of source code must retain the above copyright
|
|
125
|
+
** notice, this list of conditions and the following disclaimer.
|
|
126
|
+
**
|
|
127
|
+
** 2 Redistributions in binary form must reproduce the above copyright
|
|
128
|
+
** notice, this list of conditions and the following disclaimer in
|
|
129
|
+
** the documentation and/or other materials provided with the
|
|
130
|
+
** distribution.
|
|
131
|
+
**
|
|
132
|
+
** 3 Neither the name of the Standards Of Fundamental Astronomy Board,
|
|
133
|
+
** the International Astronomical Union nor the names of its
|
|
134
|
+
** contributors may be used to endorse or promote products derived
|
|
135
|
+
** from this software without specific prior written permission.
|
|
136
|
+
**
|
|
137
|
+
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
138
|
+
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
139
|
+
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
|
140
|
+
** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
|
141
|
+
** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
142
|
+
** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
|
143
|
+
** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
144
|
+
** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
145
|
+
** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
146
|
+
** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
|
147
|
+
** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
148
|
+
** POSSIBILITY OF SUCH DAMAGE.
|
|
149
|
+
**
|
|
150
|
+
**--------------------------------------------------------------------*/
|
|
151
|
+
}
|
data/ext/celes/gst00a.c
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
#include "sofam.h"
|
|
2
|
+
|
|
3
|
+
double iauGst00a(double uta, double utb, double tta, double ttb)
|
|
4
|
+
/*
|
|
5
|
+
** - - - - - - - - - -
|
|
6
|
+
** i a u G s t 0 0 a
|
|
7
|
+
** - - - - - - - - - -
|
|
8
|
+
**
|
|
9
|
+
** Greenwich apparent sidereal time (consistent with IAU 2000
|
|
10
|
+
** resolutions).
|
|
11
|
+
**
|
|
12
|
+
** Status: canonical model.
|
|
13
|
+
**
|
|
14
|
+
** Given:
|
|
15
|
+
** uta,utb double UT1 as a 2-part Julian Date (Notes 1,2)
|
|
16
|
+
** tta,ttb double TT as a 2-part Julian Date (Notes 1,2)
|
|
17
|
+
**
|
|
18
|
+
** Returned (function value):
|
|
19
|
+
** double Greenwich apparent sidereal time (radians)
|
|
20
|
+
**
|
|
21
|
+
** Notes:
|
|
22
|
+
**
|
|
23
|
+
** 1) The UT1 and TT dates uta+utb and tta+ttb respectively, are both
|
|
24
|
+
** Julian Dates, apportioned in any convenient way between the
|
|
25
|
+
** argument pairs. For example, JD=2450123.7 could be expressed in
|
|
26
|
+
** any of these ways, among others:
|
|
27
|
+
**
|
|
28
|
+
** Part A Part B
|
|
29
|
+
**
|
|
30
|
+
** 2450123.7 0.0 (JD method)
|
|
31
|
+
** 2451545.0 -1421.3 (J2000 method)
|
|
32
|
+
** 2400000.5 50123.2 (MJD method)
|
|
33
|
+
** 2450123.5 0.2 (date & time method)
|
|
34
|
+
**
|
|
35
|
+
** The JD method is the most natural and convenient to use in
|
|
36
|
+
** cases where the loss of several decimal digits of resolution
|
|
37
|
+
** is acceptable (in the case of UT; the TT is not at all critical
|
|
38
|
+
** in this respect). The J2000 and MJD methods are good compromises
|
|
39
|
+
** between resolution and convenience. For UT, the date & time
|
|
40
|
+
** method is best matched to the algorithm that is used by the Earth
|
|
41
|
+
** Rotation Angle function, called internally: maximum precision is
|
|
42
|
+
** delivered when the uta argument is for 0hrs UT1 on the day in
|
|
43
|
+
** question and the utb argument lies in the range 0 to 1, or vice
|
|
44
|
+
** versa.
|
|
45
|
+
**
|
|
46
|
+
** 2) Both UT1 and TT are required, UT1 to predict the Earth rotation
|
|
47
|
+
** and TT to predict the effects of precession-nutation. If UT1 is
|
|
48
|
+
** used for both purposes, errors of order 100 microarcseconds
|
|
49
|
+
** result.
|
|
50
|
+
**
|
|
51
|
+
** 3) This GAST is compatible with the IAU 2000 resolutions and must be
|
|
52
|
+
** used only in conjunction with other IAU 2000 compatible
|
|
53
|
+
** components such as precession-nutation.
|
|
54
|
+
**
|
|
55
|
+
** 4) The result is returned in the range 0 to 2pi.
|
|
56
|
+
**
|
|
57
|
+
** 5) The algorithm is from Capitaine et al. (2003) and IERS
|
|
58
|
+
** Conventions 2003.
|
|
59
|
+
**
|
|
60
|
+
** Called:
|
|
61
|
+
** iauGmst00 Greenwich mean sidereal time, IAU 2000
|
|
62
|
+
** iauEe00a equation of the equinoxes, IAU 2000A
|
|
63
|
+
** iauAnp normalize angle into range 0 to 2pi
|
|
64
|
+
**
|
|
65
|
+
** References:
|
|
66
|
+
**
|
|
67
|
+
** Capitaine, N., Wallace, P.T. and McCarthy, D.D., "Expressions to
|
|
68
|
+
** implement the IAU 2000 definition of UT1", Astronomy &
|
|
69
|
+
** Astrophysics, 406, 1135-1149 (2003)
|
|
70
|
+
**
|
|
71
|
+
** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
|
|
72
|
+
** IERS Technical Note No. 32, BKG (2004)
|
|
73
|
+
**
|
|
74
|
+
** This revision: 2008 May 16
|
|
75
|
+
**
|
|
76
|
+
** Original version 2012-03-01
|
|
77
|
+
**
|
|
78
|
+
** Copyright (C) 2013 Naoki Arita. See notes at end.
|
|
79
|
+
*/
|
|
80
|
+
{
|
|
81
|
+
double gmst00, ee00a, gst;
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
gmst00 = iauGmst00(uta, utb, tta, ttb);
|
|
85
|
+
ee00a = iauEe00a(tta, ttb);
|
|
86
|
+
gst = iauAnp(gmst00 + ee00a);
|
|
87
|
+
|
|
88
|
+
return gst;
|
|
89
|
+
|
|
90
|
+
/*----------------------------------------------------------------------
|
|
91
|
+
**
|
|
92
|
+
** Celes is a wrapper of the SOFA Library for Ruby.
|
|
93
|
+
**
|
|
94
|
+
** This file is redistributed and relicensed in accordance with
|
|
95
|
+
** the SOFA Software License (http://www.iausofa.org/tandc.html).
|
|
96
|
+
**
|
|
97
|
+
** The original library is available from IAU Standards of
|
|
98
|
+
** Fundamental Astronomy (http://www.iausofa.org/).
|
|
99
|
+
**
|
|
100
|
+
**
|
|
101
|
+
**
|
|
102
|
+
**
|
|
103
|
+
**
|
|
104
|
+
** Copyright (C) 2013, Naoki Arita
|
|
105
|
+
** All rights reserved.
|
|
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
|
+
**--------------------------------------------------------------------*/
|
|
138
|
+
}
|