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.
Files changed (202) hide show
  1. data/.gitignore +17 -0
  2. data/Gemfile +4 -0
  3. data/LICENSE.txt +32 -0
  4. data/README.md +179 -0
  5. data/Rakefile +1 -0
  6. data/celes.gemspec +22 -0
  7. data/ext/celes/a2af.c +120 -0
  8. data/ext/celes/a2tf.c +116 -0
  9. data/ext/celes/af2a.c +107 -0
  10. data/ext/celes/anp.c +82 -0
  11. data/ext/celes/anpm.c +82 -0
  12. data/ext/celes/bi00.c +116 -0
  13. data/ext/celes/bp00.c +173 -0
  14. data/ext/celes/bp06.c +136 -0
  15. data/ext/celes/bpn2xy.c +100 -0
  16. data/ext/celes/c2i00a.c +139 -0
  17. data/ext/celes/c2i00b.c +139 -0
  18. data/ext/celes/c2i06a.c +136 -0
  19. data/ext/celes/c2ibpn.c +142 -0
  20. data/ext/celes/c2ixy.c +131 -0
  21. data/ext/celes/c2ixys.c +123 -0
  22. data/ext/celes/c2s.c +96 -0
  23. data/ext/celes/c2t00a.c +154 -0
  24. data/ext/celes/c2t00b.c +150 -0
  25. data/ext/celes/c2t06a.c +152 -0
  26. data/ext/celes/c2tcio.c +122 -0
  27. data/ext/celes/c2teqx.c +122 -0
  28. data/ext/celes/c2tpe.c +167 -0
  29. data/ext/celes/c2txy.c +159 -0
  30. data/ext/celes/cal2jd.c +139 -0
  31. data/ext/celes/celes_core.c +2522 -0
  32. data/ext/celes/cp.c +80 -0
  33. data/ext/celes/cpv.c +82 -0
  34. data/ext/celes/cr.c +83 -0
  35. data/ext/celes/d2dtf.c +206 -0
  36. data/ext/celes/d2tf.c +160 -0
  37. data/ext/celes/dat.c +289 -0
  38. data/ext/celes/depend +25 -0
  39. data/ext/celes/dtdb.c +1213 -0
  40. data/ext/celes/dtf2d.c +196 -0
  41. data/ext/celes/ee00.c +128 -0
  42. data/ext/celes/ee00a.c +135 -0
  43. data/ext/celes/ee00b.c +141 -0
  44. data/ext/celes/ee06a.c +122 -0
  45. data/ext/celes/eect00.c +282 -0
  46. data/ext/celes/eform.c +147 -0
  47. data/ext/celes/eo06a.c +131 -0
  48. data/ext/celes/eors.c +108 -0
  49. data/ext/celes/epb.c +96 -0
  50. data/ext/celes/epb2jd.c +91 -0
  51. data/ext/celes/epj.c +93 -0
  52. data/ext/celes/epj2jd.c +91 -0
  53. data/ext/celes/epv00.c +2589 -0
  54. data/ext/celes/eqeq94.c +131 -0
  55. data/ext/celes/era00.c +136 -0
  56. data/ext/celes/extconf.rb +4 -0
  57. data/ext/celes/fad03.c +103 -0
  58. data/ext/celes/fae03.c +102 -0
  59. data/ext/celes/faf03.c +106 -0
  60. data/ext/celes/faju03.c +102 -0
  61. data/ext/celes/fal03.c +103 -0
  62. data/ext/celes/falp03.c +103 -0
  63. data/ext/celes/fama03.c +102 -0
  64. data/ext/celes/fame03.c +102 -0
  65. data/ext/celes/fane03.c +99 -0
  66. data/ext/celes/faom03.c +104 -0
  67. data/ext/celes/fapa03.c +103 -0
  68. data/ext/celes/fasa03.c +102 -0
  69. data/ext/celes/faur03.c +99 -0
  70. data/ext/celes/fave03.c +102 -0
  71. data/ext/celes/fk52h.c +143 -0
  72. data/ext/celes/fk5hip.c +126 -0
  73. data/ext/celes/fk5hz.c +160 -0
  74. data/ext/celes/fw2m.c +134 -0
  75. data/ext/celes/fw2xy.c +120 -0
  76. data/ext/celes/gc2gd.c +134 -0
  77. data/ext/celes/gc2gde.c +200 -0
  78. data/ext/celes/gd2gc.c +134 -0
  79. data/ext/celes/gd2gce.c +138 -0
  80. data/ext/celes/gmst00.c +145 -0
  81. data/ext/celes/gmst06.c +136 -0
  82. data/ext/celes/gmst82.c +151 -0
  83. data/ext/celes/gst00a.c +138 -0
  84. data/ext/celes/gst00b.c +146 -0
  85. data/ext/celes/gst06.c +140 -0
  86. data/ext/celes/gst06a.c +131 -0
  87. data/ext/celes/gst94.c +131 -0
  88. data/ext/celes/h2fk5.c +148 -0
  89. data/ext/celes/hfk5z.c +175 -0
  90. data/ext/celes/ir.c +83 -0
  91. data/ext/celes/jd2cal.c +155 -0
  92. data/ext/celes/jdcalf.c +161 -0
  93. data/ext/celes/num00a.c +121 -0
  94. data/ext/celes/num00b.c +121 -0
  95. data/ext/celes/num06a.c +125 -0
  96. data/ext/celes/numat.c +109 -0
  97. data/ext/celes/nut00a.c +2047 -0
  98. data/ext/celes/nut00b.c +372 -0
  99. data/ext/celes/nut06a.c +153 -0
  100. data/ext/celes/nut80.c +325 -0
  101. data/ext/celes/nutm80.c +117 -0
  102. data/ext/celes/obl06.c +118 -0
  103. data/ext/celes/obl80.c +118 -0
  104. data/ext/celes/p06e.c +321 -0
  105. data/ext/celes/p2pv.c +83 -0
  106. data/ext/celes/p2s.c +91 -0
  107. data/ext/celes/pap.c +139 -0
  108. data/ext/celes/pas.c +96 -0
  109. data/ext/celes/pb06.c +144 -0
  110. data/ext/celes/pdp.c +84 -0
  111. data/ext/celes/pfw06.c +165 -0
  112. data/ext/celes/plan94.c +514 -0
  113. data/ext/celes/pm.c +83 -0
  114. data/ext/celes/pmat00.c +118 -0
  115. data/ext/celes/pmat06.c +122 -0
  116. data/ext/celes/pmat76.c +141 -0
  117. data/ext/celes/pmp.c +85 -0
  118. data/ext/celes/pn.c +109 -0
  119. data/ext/celes/pn00.c +177 -0
  120. data/ext/celes/pn00a.c +162 -0
  121. data/ext/celes/pn00b.c +162 -0
  122. data/ext/celes/pn06.c +187 -0
  123. data/ext/celes/pn06a.c +152 -0
  124. data/ext/celes/pnm00a.c +121 -0
  125. data/ext/celes/pnm00b.c +121 -0
  126. data/ext/celes/pnm06a.c +124 -0
  127. data/ext/celes/pnm80.c +126 -0
  128. data/ext/celes/pom00.c +115 -0
  129. data/ext/celes/ppp.c +85 -0
  130. data/ext/celes/ppsp.c +94 -0
  131. data/ext/celes/pr00.c +142 -0
  132. data/ext/celes/prec76.c +148 -0
  133. data/ext/celes/pv2p.c +81 -0
  134. data/ext/celes/pv2s.c +144 -0
  135. data/ext/celes/pvdpv.c +102 -0
  136. data/ext/celes/pvm.c +86 -0
  137. data/ext/celes/pvmpv.c +87 -0
  138. data/ext/celes/pvppv.c +87 -0
  139. data/ext/celes/pvstar.c +207 -0
  140. data/ext/celes/pvu.c +93 -0
  141. data/ext/celes/pvup.c +88 -0
  142. data/ext/celes/pvxpv.c +107 -0
  143. data/ext/celes/pxp.c +94 -0
  144. data/ext/celes/rm2v.c +111 -0
  145. data/ext/celes/rv2m.c +118 -0
  146. data/ext/celes/rx.c +110 -0
  147. data/ext/celes/rxp.c +99 -0
  148. data/ext/celes/rxpv.c +86 -0
  149. data/ext/celes/rxr.c +99 -0
  150. data/ext/celes/ry.c +110 -0
  151. data/ext/celes/rz.c +110 -0
  152. data/ext/celes/s00.c +371 -0
  153. data/ext/celes/s00a.c +143 -0
  154. data/ext/celes/s00b.c +143 -0
  155. data/ext/celes/s06.c +368 -0
  156. data/ext/celes/s06a.c +145 -0
  157. data/ext/celes/s2c.c +85 -0
  158. data/ext/celes/s2p.c +88 -0
  159. data/ext/celes/s2pv.c +103 -0
  160. data/ext/celes/s2xpv.c +87 -0
  161. data/ext/celes/sepp.c +105 -0
  162. data/ext/celes/seps.c +93 -0
  163. data/ext/celes/sofa.h +379 -0
  164. data/ext/celes/sofam.h +155 -0
  165. data/ext/celes/sp00.c +118 -0
  166. data/ext/celes/starpm.c +205 -0
  167. data/ext/celes/starpv.c +264 -0
  168. data/ext/celes/sxp.c +84 -0
  169. data/ext/celes/sxpv.c +85 -0
  170. data/ext/celes/taitt.c +110 -0
  171. data/ext/celes/taiut1.c +112 -0
  172. data/ext/celes/taiutc.c +182 -0
  173. data/ext/celes/tcbtdb.c +132 -0
  174. data/ext/celes/tcgtt.c +109 -0
  175. data/ext/celes/tdbtcb.c +137 -0
  176. data/ext/celes/tdbtt.c +122 -0
  177. data/ext/celes/tf2a.c +107 -0
  178. data/ext/celes/tf2d.c +107 -0
  179. data/ext/celes/tr.c +93 -0
  180. data/ext/celes/trxp.c +93 -0
  181. data/ext/celes/trxpv.c +93 -0
  182. data/ext/celes/tttai.c +110 -0
  183. data/ext/celes/tttcg.c +112 -0
  184. data/ext/celes/tttdb.c +121 -0
  185. data/ext/celes/ttut1.c +110 -0
  186. data/ext/celes/ut1tai.c +111 -0
  187. data/ext/celes/ut1tt.c +110 -0
  188. data/ext/celes/ut1utc.c +193 -0
  189. data/ext/celes/utctai.c +163 -0
  190. data/ext/celes/utcut1.c +151 -0
  191. data/ext/celes/xy06.c +2758 -0
  192. data/ext/celes/xys00a.c +133 -0
  193. data/ext/celes/xys00b.c +133 -0
  194. data/ext/celes/xys06a.c +133 -0
  195. data/ext/celes/zp.c +77 -0
  196. data/ext/celes/zpv.c +79 -0
  197. data/ext/celes/zr.c +83 -0
  198. data/lib/celes.rb +6 -0
  199. data/lib/celes/version.rb +3 -0
  200. data/sofa_20120301.diff +31384 -0
  201. data/test/t_sofa.rb +8228 -0
  202. metadata +251 -0
@@ -0,0 +1,160 @@
1
+ #include "sofam.h"
2
+
3
+ void iauD2tf(int ndp, double days, char *sign, int ihmsf[4])
4
+ /*
5
+ ** - - - - - - - -
6
+ ** i a u D 2 t f
7
+ ** - - - - - - - -
8
+ **
9
+ ** Decompose days to hours, minutes, seconds, fraction.
10
+ **
11
+ ** Status: vector/matrix support function.
12
+ **
13
+ ** Given:
14
+ ** ndp int resolution (Note 1)
15
+ ** days double interval in days
16
+ **
17
+ ** Returned:
18
+ ** sign char '+' or '-'
19
+ ** ihmsf int[4] hours, minutes, seconds, fraction
20
+ **
21
+ ** Notes:
22
+ **
23
+ ** 1) The argument ndp is interpreted as follows:
24
+ **
25
+ ** ndp resolution
26
+ ** : ...0000 00 00
27
+ ** -7 1000 00 00
28
+ ** -6 100 00 00
29
+ ** -5 10 00 00
30
+ ** -4 1 00 00
31
+ ** -3 0 10 00
32
+ ** -2 0 01 00
33
+ ** -1 0 00 10
34
+ ** 0 0 00 01
35
+ ** 1 0 00 00.1
36
+ ** 2 0 00 00.01
37
+ ** 3 0 00 00.001
38
+ ** : 0 00 00.000...
39
+ **
40
+ ** 2) The largest positive useful value for ndp is determined by the
41
+ ** size of days, the format of double on the target platform, and
42
+ ** the risk of overflowing ihmsf[3]. On a typical platform, for
43
+ ** days up to 1.0, the available floating-point precision might
44
+ ** correspond to ndp=12. However, the practical limit is typically
45
+ ** ndp=9, set by the capacity of a 32-bit int, or ndp=4 if int is
46
+ ** only 16 bits.
47
+ **
48
+ ** 3) The absolute value of days may exceed 1.0. In cases where it
49
+ ** does not, it is up to the caller to test for and handle the
50
+ ** case where days is very nearly 1.0 and rounds up to 24 hours,
51
+ ** by testing for ihmsf[0]=24 and setting ihmsf[0-3] to zero.
52
+ **
53
+ ** This revision: 2008 May 17
54
+ **
55
+ ** Original version 2012-03-01
56
+ **
57
+ ** Copyright (C) 2013 Naoki Arita. See notes at end.
58
+ */
59
+ {
60
+ int nrs, n;
61
+ double rs, rm, rh, a, w, ah, am, as, af;
62
+
63
+
64
+ /* Handle sign. */
65
+ *sign = (char) ( ( days >= 0.0 ) ? '+' : '-' );
66
+
67
+ /* Interval in seconds. */
68
+ a = DAYSEC * fabs(days);
69
+
70
+ /* Pre-round if resolution coarser than 1s (then pretend ndp=1). */
71
+ if (ndp < 0) {
72
+ nrs = 1;
73
+ for (n = 1; n <= -ndp; n++) {
74
+ nrs *= (n == 2 || n == 4) ? 6 : 10;
75
+ }
76
+ rs = (double) nrs;
77
+ w = a / rs;
78
+ a = rs * dnint(w);
79
+ }
80
+
81
+ /* Express the unit of each field in resolution units. */
82
+ nrs = 1;
83
+ for (n = 1; n <= ndp; n++) {
84
+ nrs *= 10;
85
+ }
86
+ rs = (double) nrs;
87
+ rm = rs * 60.0;
88
+ rh = rm * 60.0;
89
+
90
+ /* Round the interval and express in resolution units. */
91
+ a = dnint(rs * a);
92
+
93
+ /* Break into fields. */
94
+ ah = a / rh;
95
+ ah = dint(ah);
96
+ a -= ah * rh;
97
+ am = a / rm;
98
+ am = dint(am);
99
+ a -= am * rm;
100
+ as = a / rs;
101
+ as = dint(as);
102
+ af = a - as * rs;
103
+
104
+ /* Return results. */
105
+ ihmsf[0] = (int) ah;
106
+ ihmsf[1] = (int) am;
107
+ ihmsf[2] = (int) as;
108
+ ihmsf[3] = (int) af;
109
+
110
+ return;
111
+
112
+ /*----------------------------------------------------------------------
113
+ **
114
+ ** Celes is a wrapper of the SOFA Library for Ruby.
115
+ **
116
+ ** This file is redistributed and relicensed in accordance with
117
+ ** the SOFA Software License (http://www.iausofa.org/tandc.html).
118
+ **
119
+ ** The original library is available from IAU Standards of
120
+ ** Fundamental Astronomy (http://www.iausofa.org/).
121
+ **
122
+ **
123
+ **
124
+ **
125
+ **
126
+ ** Copyright (C) 2013, Naoki Arita
127
+ ** All rights reserved.
128
+ **
129
+ ** Redistribution and use in source and binary forms, with or without
130
+ ** modification, are permitted provided that the following conditions
131
+ ** are met:
132
+ **
133
+ ** 1 Redistributions of source code must retain the above copyright
134
+ ** notice, this list of conditions and the following disclaimer.
135
+ **
136
+ ** 2 Redistributions in binary form must reproduce the above copyright
137
+ ** notice, this list of conditions and the following disclaimer in
138
+ ** the documentation and/or other materials provided with the
139
+ ** distribution.
140
+ **
141
+ ** 3 Neither the name of the Standards Of Fundamental Astronomy Board,
142
+ ** the International Astronomical Union nor the names of its
143
+ ** contributors may be used to endorse or promote products derived
144
+ ** from this software without specific prior written permission.
145
+ **
146
+ ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
147
+ ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
148
+ ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
149
+ ** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
150
+ ** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
151
+ ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
152
+ ** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
153
+ ** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
154
+ ** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
155
+ ** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
156
+ ** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
157
+ ** POSSIBILITY OF SUCH DAMAGE.
158
+ **
159
+ **--------------------------------------------------------------------*/
160
+ }
@@ -0,0 +1,289 @@
1
+ #include "sofam.h"
2
+
3
+ int iauDat(int iy, int im, int id, double fd, double *deltat )
4
+ /*
5
+ ** - - - - - - -
6
+ ** i a u D a t
7
+ ** - - - - - - -
8
+ **
9
+ ** For a given UTC date, calculate delta(AT) = TAI-UTC.
10
+ **
11
+ ** :------------------------------------------:
12
+ ** : :
13
+ ** : IMPORTANT :
14
+ ** : :
15
+ ** : A new version of this function must be :
16
+ ** : produced whenever a new leap second is :
17
+ ** : announced. There are four items to :
18
+ ** : change on each such occasion: :
19
+ ** : :
20
+ ** : 1) A new line must be added to the set :
21
+ ** : of statements that initialize the :
22
+ ** : array "changes". :
23
+ ** : :
24
+ ** : 2) The parameter IYV must be set to :
25
+ ** : the current year. :
26
+ ** : :
27
+ ** : 3) The "Latest leap second" comment :
28
+ ** : below must be set to the new leap :
29
+ ** : second date. :
30
+ ** : :
31
+ ** : 4) The "This revision" comment, later, :
32
+ ** : must be set to the current date. :
33
+ ** : :
34
+ ** : Change (2) must also be carried out :
35
+ ** : whenever the function is re-issued, :
36
+ ** : even if no leap seconds have been :
37
+ ** : added. :
38
+ ** : :
39
+ ** : Latest leap second: 2012 June 30 :
40
+ ** : :
41
+ ** :__________________________________________:
42
+ **
43
+ ** Status: support function.
44
+ **
45
+ ** Given:
46
+ ** iy int UTC: year (Notes 1 and 2)
47
+ ** im int month (Note 2)
48
+ ** id int day (Notes 2 and 3)
49
+ ** fd double fraction of day (Note 4)
50
+ **
51
+ ** Returned:
52
+ ** deltat double TAI minus UTC, seconds
53
+ **
54
+ ** Returned (function value):
55
+ ** int status (Note 5):
56
+ ** 1 = dubious year (Note 1)
57
+ ** 0 = OK
58
+ ** -1 = bad year
59
+ ** -2 = bad month
60
+ ** -3 = bad day (Note 3)
61
+ ** -4 = bad fraction (Note 4)
62
+ **
63
+ ** Notes:
64
+ **
65
+ ** 1) UTC began at 1960 January 1.0 (JD 2436934.5) and it is improper
66
+ ** to call the function with an earlier date. If this is attempted,
67
+ ** zero is returned together with a warning status.
68
+ **
69
+ ** Because leap seconds cannot, in principle, be predicted in
70
+ ** advance, a reliable check for dates beyond the valid range is
71
+ ** impossible. To guard against gross errors, a year five or more
72
+ ** after the release year of the present function (see parameter
73
+ ** IYV) is considered dubious. In this case a warning status is
74
+ ** returned but the result is computed in the normal way.
75
+ **
76
+ ** For both too-early and too-late years, the warning status is
77
+ ** j=+1. This is distinct from the error status j=-1, which
78
+ ** signifies a year so early that JD could not be computed.
79
+ **
80
+ ** 2) If the specified date is for a day which ends with a leap second,
81
+ ** the UTC-TAI value returned is for the period leading up to the
82
+ ** leap second. If the date is for a day which begins as a leap
83
+ ** second ends, the UTC-TAI returned is for the period following the
84
+ ** leap second.
85
+ **
86
+ ** 3) The day number must be in the normal calendar range, for example
87
+ ** 1 through 30 for April. The "almanac" convention of allowing
88
+ ** such dates as January 0 and December 32 is not supported in this
89
+ ** function, in order to avoid confusion near leap seconds.
90
+ **
91
+ ** 4) The fraction of day is used only for dates before the
92
+ ** introduction of leap seconds, the first of which occurred at the
93
+ ** end of 1971. It is tested for validity (0 to 1 is the valid
94
+ ** range) even if not used; if invalid, zero is used and status
95
+ ** j=-4 is returned. For many applications, setting fd to zero is
96
+ ** acceptable; the resulting error is always less than 3 ms (and
97
+ ** occurs only pre-1972).
98
+ **
99
+ ** 5) The status value returned in the case where there are multiple
100
+ ** errors refers to the first error detected. For example, if the
101
+ ** month and day are 13 and 32 respectively, j=-2 (bad month)
102
+ ** will be returned.
103
+ **
104
+ ** 6) In cases where a valid result is not available, zero is returned.
105
+ **
106
+ ** References:
107
+ **
108
+ ** 1) For dates from 1961 January 1 onwards, the expressions from the
109
+ ** file ftp://maia.usno.navy.mil/ser7/tai-utc.dat are used.
110
+ **
111
+ ** 2) The 5ms timestep at 1961 January 1 is taken from 2.58.1 (p87) of
112
+ ** the 1992 Explanatory Supplement.
113
+ **
114
+ ** Called:
115
+ ** iauCal2jd Gregorian calendar to Julian Day number
116
+ **
117
+ ** This revision: 2012 June 14
118
+ **
119
+ ** Original version 2012-03-01
120
+ **
121
+ ** Copyright (C) 2013 Naoki Arita. See notes at end.
122
+ */
123
+ {
124
+ /* Release year for this version of iauDat */
125
+ #define IYV (2012)
126
+
127
+ /* Reference dates (MJD) and drift rates (s/day), pre leap seconds */
128
+ static const double drift[][2] = {
129
+ { 37300.0, 0.0012960 },
130
+ { 37300.0, 0.0012960 },
131
+ { 37300.0, 0.0012960 },
132
+ { 37665.0, 0.0011232 },
133
+ { 37665.0, 0.0011232 },
134
+ { 38761.0, 0.0012960 },
135
+ { 38761.0, 0.0012960 },
136
+ { 38761.0, 0.0012960 },
137
+ { 38761.0, 0.0012960 },
138
+ { 38761.0, 0.0012960 },
139
+ { 38761.0, 0.0012960 },
140
+ { 38761.0, 0.0012960 },
141
+ { 39126.0, 0.0025920 },
142
+ { 39126.0, 0.0025920 }
143
+ };
144
+
145
+ /* Number of Delta(AT) expressions before leap seconds were introduced */
146
+ #define NERA1 ((int) (sizeof drift / sizeof (double) / 2))
147
+
148
+ /* Dates and Delta(AT)s */
149
+ static const struct {
150
+ int iyear, month;
151
+ double delat;
152
+ } changes[] = {
153
+ { 1960, 1, 1.4178180 },
154
+ { 1961, 1, 1.4228180 },
155
+ { 1961, 8, 1.3728180 },
156
+ { 1962, 1, 1.8458580 },
157
+ { 1963, 11, 1.9458580 },
158
+ { 1964, 1, 3.2401300 },
159
+ { 1964, 4, 3.3401300 },
160
+ { 1964, 9, 3.4401300 },
161
+ { 1965, 1, 3.5401300 },
162
+ { 1965, 3, 3.6401300 },
163
+ { 1965, 7, 3.7401300 },
164
+ { 1965, 9, 3.8401300 },
165
+ { 1966, 1, 4.3131700 },
166
+ { 1968, 2, 4.2131700 },
167
+ { 1972, 1, 10.0 },
168
+ { 1972, 7, 11.0 },
169
+ { 1973, 1, 12.0 },
170
+ { 1974, 1, 13.0 },
171
+ { 1975, 1, 14.0 },
172
+ { 1976, 1, 15.0 },
173
+ { 1977, 1, 16.0 },
174
+ { 1978, 1, 17.0 },
175
+ { 1979, 1, 18.0 },
176
+ { 1980, 1, 19.0 },
177
+ { 1981, 7, 20.0 },
178
+ { 1982, 7, 21.0 },
179
+ { 1983, 7, 22.0 },
180
+ { 1985, 7, 23.0 },
181
+ { 1988, 1, 24.0 },
182
+ { 1990, 1, 25.0 },
183
+ { 1991, 1, 26.0 },
184
+ { 1992, 7, 27.0 },
185
+ { 1993, 7, 28.0 },
186
+ { 1994, 7, 29.0 },
187
+ { 1996, 1, 30.0 },
188
+ { 1997, 7, 31.0 },
189
+ { 1999, 1, 32.0 },
190
+ { 2006, 1, 33.0 },
191
+ { 2009, 1, 34.0 },
192
+ { 2012, 7, 35.0 }
193
+ };
194
+
195
+ /* Number of Delta(AT) changes */
196
+ const int NDAT = sizeof changes / sizeof changes[0];
197
+
198
+ /* Miscellaneous local variables */
199
+ int j, i, m;
200
+ double da, djm0, djm;
201
+
202
+
203
+ /* Initialize the result to zero. */
204
+ *deltat = da = 0.0;
205
+
206
+ /* If invalid fraction of a day, set error status and give up. */
207
+ if (fd < 0.0 || fd > 1.0) return -4;
208
+
209
+ /* Convert the date into an MJD. */
210
+ j = iauCal2jd(iy, im, id, &djm0, &djm);
211
+
212
+ /* If invalid year, month, or day, give up. */
213
+ if (j < 0) return j;
214
+
215
+ /* If pre-UTC year, set warning status and give up. */
216
+ if (iy < changes[0].iyear) return 1;
217
+
218
+ /* If suspiciously late year, set warning status but proceed. */
219
+ if (iy > IYV + 5) j = 1;
220
+
221
+ /* Combine year and month to form a date-ordered integer... */
222
+ m = 12*iy + im;
223
+
224
+ /* ...and use it to find the preceding table entry. */
225
+ for (i = NDAT-1; i >=0; i--) {
226
+ if (m >= (12 * changes[i].iyear + changes[i].month)) break;
227
+ }
228
+
229
+ /* Get the Delta(AT). */
230
+ da = changes[i].delat;
231
+
232
+ /* If pre-1972, adjust for drift. */
233
+ if (i < NERA1) da += (djm + fd - drift[i][0]) * drift[i][1];
234
+
235
+ /* Return the Delta(AT) value. */
236
+ *deltat = da;
237
+
238
+ /* Return the status. */
239
+ return j;
240
+
241
+ /*----------------------------------------------------------------------
242
+ **
243
+ ** Celes is a wrapper of the SOFA Library for Ruby.
244
+ **
245
+ ** This file is redistributed and relicensed in accordance with
246
+ ** the SOFA Software License (http://www.iausofa.org/tandc.html).
247
+ **
248
+ ** The original library is available from IAU Standards of
249
+ ** Fundamental Astronomy (http://www.iausofa.org/).
250
+ **
251
+ **
252
+ **
253
+ **
254
+ **
255
+ ** Copyright (C) 2013, Naoki Arita
256
+ ** All rights reserved.
257
+ **
258
+ ** Redistribution and use in source and binary forms, with or without
259
+ ** modification, are permitted provided that the following conditions
260
+ ** are met:
261
+ **
262
+ ** 1 Redistributions of source code must retain the above copyright
263
+ ** notice, this list of conditions and the following disclaimer.
264
+ **
265
+ ** 2 Redistributions in binary form must reproduce the above copyright
266
+ ** notice, this list of conditions and the following disclaimer in
267
+ ** the documentation and/or other materials provided with the
268
+ ** distribution.
269
+ **
270
+ ** 3 Neither the name of the Standards Of Fundamental Astronomy Board,
271
+ ** the International Astronomical Union nor the names of its
272
+ ** contributors may be used to endorse or promote products derived
273
+ ** from this software without specific prior written permission.
274
+ **
275
+ ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
276
+ ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
277
+ ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
278
+ ** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
279
+ ** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
280
+ ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
281
+ ** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
282
+ ** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
283
+ ** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
284
+ ** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
285
+ ** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
286
+ ** POSSIBILITY OF SUCH DAMAGE.
287
+ **
288
+ **--------------------------------------------------------------------*/
289
+ }
@@ -0,0 +1,25 @@
1
+ celes_core.o: celes_core.c sofa.h sofam.h a2af.c a2tf.c af2a.c \
2
+ anp.c anpm.c bi00.c bp00.c bp06.c bpn2xy.c c2i00a.c c2i00b.c \
3
+ c2i06a.c c2ibpn.c c2ixy.c c2ixys.c c2s.c c2t00a.c c2t00b.c \
4
+ c2t06a.c c2tcio.c c2teqx.c c2tpe.c c2txy.c cal2jd.c cp.c cpv.c \
5
+ cr.c d2dtf.c d2tf.c dat.c dtdb.c dtf2d.c ee00.c ee00a.c ee00b.c \
6
+ ee06a.c eect00.c eform.c eo06a.c eors.c epb.c epb2jd.c epj.c \
7
+ epj2jd.c epv00.c eqeq94.c era00.c fad03.c fae03.c faf03.c \
8
+ faju03.c fal03.c falp03.c fama03.c fame03.c fane03.c faom03.c \
9
+ fapa03.c fasa03.c faur03.c fave03.c fk52h.c fk5hip.c fk5hz.c \
10
+ fw2m.c fw2xy.c gc2gd.c gc2gde.c gd2gc.c gd2gce.c gmst00.c \
11
+ gmst06.c gmst82.c gst00a.c gst00b.c gst06.c gst06a.c gst94.c \
12
+ h2fk5.c hfk5z.c ir.c jd2cal.c jdcalf.c num00a.c num00b.c \
13
+ num06a.c numat.c nut00a.c nut00b.c nut06a.c nut80.c nutm80.c \
14
+ obl06.c obl80.c p06e.c p2pv.c p2s.c pap.c pas.c pb06.c pdp.c \
15
+ pfw06.c plan94.c pm.c pmat00.c pmat06.c pmat76.c pmp.c pn.c \
16
+ pn00.c pn00a.c pn00b.c pn06.c pn06a.c pnm00a.c pnm00b.c \
17
+ pnm06a.c pnm80.c pom00.c ppp.c ppsp.c pr00.c prec76.c pv2p.c \
18
+ pv2s.c pvdpv.c pvm.c pvmpv.c pvppv.c pvstar.c pvu.c pvup.c \
19
+ pvxpv.c pxp.c rm2v.c rv2m.c rx.c rxp.c rxpv.c rxr.c ry.c \
20
+ rz.c s00.c s00a.c s00b.c s06.c s06a.c s2c.c s2p.c s2pv.c \
21
+ s2xpv.c sepp.c seps.c sp00.c starpm.c starpv.c sxp.c sxpv.c \
22
+ taitt.c taiut1.c taiutc.c tcbtdb.c tcgtt.c tdbtcb.c tdbtt.c \
23
+ tf2a.c tf2d.c tr.c trxp.c trxpv.c tttai.c tttcg.c tttdb.c \
24
+ ttut1.c ut1tai.c ut1tt.c ut1utc.c utctai.c utcut1.c xy06.c \
25
+ xys00a.c xys00b.c xys06a.c zp.c zpv.c zr.c