equationoftime 4.0.0 → 4.1.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 (265) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +8 -3
  3. data/Gemfile.lock +48 -0
  4. data/README.md +22 -19
  5. data/Rakefile +14 -7
  6. data/equationoftime.gemspec +9 -6
  7. data/ext/ceot/ceot.c +52 -0
  8. data/ext/ceot/eot.c +79 -0
  9. data/ext/ceot/eot.h +8 -0
  10. data/ext/ceot/extconf.rb +5 -0
  11. data/lib/eot.rb +2 -1
  12. data/lib/eot/angles.rb +44 -43
  13. data/lib/eot/init.rb +13 -6
  14. data/lib/eot/version.rb +1 -1
  15. data/wiki.md +6 -7
  16. metadata +26 -255
  17. data/.settings/org.eclipse.ltk.core.refactoring.prefs +0 -2
  18. data/Makefile +0 -238
  19. data/analemma_data.yml +0 -2925
  20. data/examples/Equation_of_Time.jpg +0 -0
  21. data/examples/analemma_data_generator.rb +0 -53
  22. data/examples/celes_parts/.RUBYARCHDIR.time +0 -0
  23. data/examples/celes_parts/.cproject +0 -56
  24. data/examples/celes_parts/.project +0 -78
  25. data/examples/celes_parts/a2af.c +0 -120
  26. data/examples/celes_parts/a2tf.c +0 -116
  27. data/examples/celes_parts/af2a.c +0 -107
  28. data/examples/celes_parts/anp.c +0 -82
  29. data/examples/celes_parts/anpm.c +0 -82
  30. data/examples/celes_parts/bi00.c +0 -116
  31. data/examples/celes_parts/bp00.c +0 -173
  32. data/examples/celes_parts/bp06.c +0 -136
  33. data/examples/celes_parts/bpn2xy.c +0 -100
  34. data/examples/celes_parts/c2i00a.c +0 -139
  35. data/examples/celes_parts/c2i00b.c +0 -139
  36. data/examples/celes_parts/c2i06a.c +0 -136
  37. data/examples/celes_parts/c2ibpn.c +0 -142
  38. data/examples/celes_parts/c2ixy.c +0 -131
  39. data/examples/celes_parts/c2ixys.c +0 -123
  40. data/examples/celes_parts/c2s.c +0 -96
  41. data/examples/celes_parts/c2t00a.c +0 -154
  42. data/examples/celes_parts/c2t00b.c +0 -150
  43. data/examples/celes_parts/c2t06a.c +0 -152
  44. data/examples/celes_parts/c2tcio.c +0 -122
  45. data/examples/celes_parts/c2teqx.c +0 -122
  46. data/examples/celes_parts/c2tpe.c +0 -167
  47. data/examples/celes_parts/c2txy.c +0 -159
  48. data/examples/celes_parts/cal2jd.c +0 -139
  49. data/examples/celes_parts/celes_core.c +0 -2522
  50. data/examples/celes_parts/cp.c +0 -80
  51. data/examples/celes_parts/cpv.c +0 -82
  52. data/examples/celes_parts/cr.c +0 -83
  53. data/examples/celes_parts/d2dtf.c +0 -206
  54. data/examples/celes_parts/d2tf.c +0 -160
  55. data/examples/celes_parts/dat.c +0 -289
  56. data/examples/celes_parts/depend +0 -25
  57. data/examples/celes_parts/dtdb.c +0 -1213
  58. data/examples/celes_parts/dtf2d.c +0 -196
  59. data/examples/celes_parts/ee00.c +0 -128
  60. data/examples/celes_parts/ee00a.c +0 -135
  61. data/examples/celes_parts/ee00b.c +0 -141
  62. data/examples/celes_parts/ee06a.c +0 -122
  63. data/examples/celes_parts/eect00.c +0 -282
  64. data/examples/celes_parts/eform.c +0 -147
  65. data/examples/celes_parts/eo06a.c +0 -131
  66. data/examples/celes_parts/eors.c +0 -108
  67. data/examples/celes_parts/epb.c +0 -96
  68. data/examples/celes_parts/epb2jd.c +0 -91
  69. data/examples/celes_parts/epj.c +0 -93
  70. data/examples/celes_parts/epj2jd.c +0 -91
  71. data/examples/celes_parts/epv00.c +0 -2589
  72. data/examples/celes_parts/eqeq94.c +0 -131
  73. data/examples/celes_parts/era00.c +0 -136
  74. data/examples/celes_parts/extconf.rb +0 -4
  75. data/examples/celes_parts/fad03.c +0 -103
  76. data/examples/celes_parts/fae03.c +0 -102
  77. data/examples/celes_parts/faf03.c +0 -106
  78. data/examples/celes_parts/faju03.c +0 -102
  79. data/examples/celes_parts/fal03.c +0 -103
  80. data/examples/celes_parts/falp03.c +0 -103
  81. data/examples/celes_parts/fama03.c +0 -102
  82. data/examples/celes_parts/fame03.c +0 -102
  83. data/examples/celes_parts/fane03.c +0 -99
  84. data/examples/celes_parts/faom03.c +0 -104
  85. data/examples/celes_parts/fapa03.c +0 -103
  86. data/examples/celes_parts/fasa03.c +0 -102
  87. data/examples/celes_parts/faur03.c +0 -99
  88. data/examples/celes_parts/fave03.c +0 -102
  89. data/examples/celes_parts/fk52h.c +0 -143
  90. data/examples/celes_parts/fk5hip.c +0 -126
  91. data/examples/celes_parts/fk5hz.c +0 -160
  92. data/examples/celes_parts/fw2m.c +0 -134
  93. data/examples/celes_parts/fw2xy.c +0 -120
  94. data/examples/celes_parts/gc2gd.c +0 -134
  95. data/examples/celes_parts/gc2gde.c +0 -200
  96. data/examples/celes_parts/gd2gc.c +0 -134
  97. data/examples/celes_parts/gd2gce.c +0 -138
  98. data/examples/celes_parts/gmst00.c +0 -145
  99. data/examples/celes_parts/gmst06.c +0 -136
  100. data/examples/celes_parts/gmst82.c +0 -151
  101. data/examples/celes_parts/gst00a.c +0 -138
  102. data/examples/celes_parts/gst00b.c +0 -146
  103. data/examples/celes_parts/gst06.c +0 -140
  104. data/examples/celes_parts/gst06a.c +0 -131
  105. data/examples/celes_parts/gst94.c +0 -131
  106. data/examples/celes_parts/h2fk5.c +0 -148
  107. data/examples/celes_parts/hfk5z.c +0 -175
  108. data/examples/celes_parts/ir.c +0 -83
  109. data/examples/celes_parts/jd2cal.c +0 -155
  110. data/examples/celes_parts/jdcalf.c +0 -161
  111. data/examples/celes_parts/num00a.c +0 -121
  112. data/examples/celes_parts/num00b.c +0 -121
  113. data/examples/celes_parts/num06a.c +0 -125
  114. data/examples/celes_parts/numat.c +0 -109
  115. data/examples/celes_parts/nut00a.c +0 -2047
  116. data/examples/celes_parts/nut00b.c +0 -372
  117. data/examples/celes_parts/nut06a.c +0 -153
  118. data/examples/celes_parts/nut80.c +0 -325
  119. data/examples/celes_parts/nutm80.c +0 -117
  120. data/examples/celes_parts/obl06.c +0 -118
  121. data/examples/celes_parts/obl80.c +0 -118
  122. data/examples/celes_parts/p06e.c +0 -321
  123. data/examples/celes_parts/p2pv.c +0 -83
  124. data/examples/celes_parts/p2s.c +0 -91
  125. data/examples/celes_parts/pap.c +0 -139
  126. data/examples/celes_parts/pas.c +0 -96
  127. data/examples/celes_parts/pb06.c +0 -144
  128. data/examples/celes_parts/pdp.c +0 -84
  129. data/examples/celes_parts/pfw06.c +0 -165
  130. data/examples/celes_parts/plan94.c +0 -514
  131. data/examples/celes_parts/pm.c +0 -83
  132. data/examples/celes_parts/pmat00.c +0 -118
  133. data/examples/celes_parts/pmat06.c +0 -122
  134. data/examples/celes_parts/pmat76.c +0 -141
  135. data/examples/celes_parts/pmp.c +0 -85
  136. data/examples/celes_parts/pn.c +0 -109
  137. data/examples/celes_parts/pn00.c +0 -177
  138. data/examples/celes_parts/pn00a.c +0 -162
  139. data/examples/celes_parts/pn00b.c +0 -162
  140. data/examples/celes_parts/pn06.c +0 -187
  141. data/examples/celes_parts/pn06a.c +0 -152
  142. data/examples/celes_parts/pnm00a.c +0 -121
  143. data/examples/celes_parts/pnm00b.c +0 -121
  144. data/examples/celes_parts/pnm06a.c +0 -124
  145. data/examples/celes_parts/pnm80.c +0 -126
  146. data/examples/celes_parts/pom00.c +0 -115
  147. data/examples/celes_parts/ppp.c +0 -85
  148. data/examples/celes_parts/ppsp.c +0 -94
  149. data/examples/celes_parts/pr00.c +0 -142
  150. data/examples/celes_parts/prec76.c +0 -148
  151. data/examples/celes_parts/pv2p.c +0 -81
  152. data/examples/celes_parts/pv2s.c +0 -144
  153. data/examples/celes_parts/pvdpv.c +0 -102
  154. data/examples/celes_parts/pvm.c +0 -86
  155. data/examples/celes_parts/pvmpv.c +0 -87
  156. data/examples/celes_parts/pvppv.c +0 -87
  157. data/examples/celes_parts/pvstar.c +0 -207
  158. data/examples/celes_parts/pvu.c +0 -93
  159. data/examples/celes_parts/pvup.c +0 -88
  160. data/examples/celes_parts/pvxpv.c +0 -107
  161. data/examples/celes_parts/pxp.c +0 -94
  162. data/examples/celes_parts/rm2v.c +0 -111
  163. data/examples/celes_parts/rv2m.c +0 -118
  164. data/examples/celes_parts/rx.c +0 -110
  165. data/examples/celes_parts/rxp.c +0 -99
  166. data/examples/celes_parts/rxpv.c +0 -86
  167. data/examples/celes_parts/rxr.c +0 -99
  168. data/examples/celes_parts/ry.c +0 -110
  169. data/examples/celes_parts/rz.c +0 -110
  170. data/examples/celes_parts/s00.c +0 -371
  171. data/examples/celes_parts/s00a.c +0 -143
  172. data/examples/celes_parts/s00b.c +0 -143
  173. data/examples/celes_parts/s06.c +0 -368
  174. data/examples/celes_parts/s06a.c +0 -145
  175. data/examples/celes_parts/s2c.c +0 -85
  176. data/examples/celes_parts/s2p.c +0 -88
  177. data/examples/celes_parts/s2pv.c +0 -103
  178. data/examples/celes_parts/s2xpv.c +0 -87
  179. data/examples/celes_parts/sepp.c +0 -105
  180. data/examples/celes_parts/seps.c +0 -93
  181. data/examples/celes_parts/sofa.h +0 -379
  182. data/examples/celes_parts/sofam.h +0 -155
  183. data/examples/celes_parts/sp00.c +0 -118
  184. data/examples/celes_parts/starpm.c +0 -205
  185. data/examples/celes_parts/starpv.c +0 -264
  186. data/examples/celes_parts/sxp.c +0 -84
  187. data/examples/celes_parts/sxpv.c +0 -85
  188. data/examples/celes_parts/taitt.c +0 -110
  189. data/examples/celes_parts/taiut1.c +0 -112
  190. data/examples/celes_parts/taiutc.c +0 -182
  191. data/examples/celes_parts/tcbtdb.c +0 -132
  192. data/examples/celes_parts/tcgtt.c +0 -109
  193. data/examples/celes_parts/tdbtcb.c +0 -137
  194. data/examples/celes_parts/tdbtt.c +0 -122
  195. data/examples/celes_parts/test_celes.rb +0 -48
  196. data/examples/celes_parts/tf2a.c +0 -107
  197. data/examples/celes_parts/tf2d.c +0 -107
  198. data/examples/celes_parts/tr.c +0 -93
  199. data/examples/celes_parts/trxp.c +0 -93
  200. data/examples/celes_parts/trxpv.c +0 -93
  201. data/examples/celes_parts/tttai.c +0 -110
  202. data/examples/celes_parts/tttcg.c +0 -112
  203. data/examples/celes_parts/tttdb.c +0 -121
  204. data/examples/celes_parts/ttut1.c +0 -110
  205. data/examples/celes_parts/ut1tai.c +0 -111
  206. data/examples/celes_parts/ut1tt.c +0 -110
  207. data/examples/celes_parts/ut1utc.c +0 -193
  208. data/examples/celes_parts/utctai.c +0 -163
  209. data/examples/celes_parts/utcut1.c +0 -151
  210. data/examples/celes_parts/xy06.c +0 -2758
  211. data/examples/celes_parts/xys00a.c +0 -133
  212. data/examples/celes_parts/xys00b.c +0 -133
  213. data/examples/celes_parts/xys06a.c +0 -133
  214. data/examples/celes_parts/zp.c +0 -77
  215. data/examples/celes_parts/zpv.c +0 -79
  216. data/examples/celes_parts/zr.c +0 -83
  217. data/examples/check_date_type.rb +0 -55
  218. data/examples/compare_geoc_long_ra.rb +0 -39
  219. data/examples/data_table_for_astro_dog.rb +0 -40
  220. data/examples/earth_rotation.rb +0 -38
  221. data/examples/eot.c +0 -15
  222. data/examples/eot.h +0 -2
  223. data/examples/eot_methods_list.rb +0 -43
  224. data/examples/eot_plot.r +0 -57
  225. data/examples/eot_suntimes.rb +0 -144
  226. data/examples/equation_of_time.py +0 -186
  227. data/examples/extconf.rb +0 -2
  228. data/examples/figure_1.jpg +0 -0
  229. data/examples/file_converter.rb +0 -31
  230. data/examples/from_readme.rb +0 -10
  231. data/examples/geo_locator.rb +0 -12
  232. data/examples/getjd.rb +0 -45
  233. data/examples/gmst_gast_non_sofa.rb +0 -404
  234. data/examples/input_suntimes.rb +0 -21
  235. data/examples/julian_day_formula.rb +0 -29
  236. data/examples/julian_day_formula.txt +0 -12
  237. data/examples/my_time_conversion.rb +0 -21
  238. data/examples/nutation_series.txt +0 -678
  239. data/examples/nutation_series.yaml +0 -14239
  240. data/examples/nutation_table5_3a.txt +0 -682
  241. data/examples/nutation_table5_3a.yaml +0 -9532
  242. data/examples/ptime.rb +0 -162
  243. data/examples/rbeot.c +0 -24
  244. data/examples/suntimes.rb +0 -28
  245. data/examples/suntimes_test.rb +0 -47
  246. data/examples/test_eot.rb +0 -17
  247. data/examples/test_poly_eval.rb +0 -27
  248. data/examples/time_scales.rb +0 -26
  249. data/examples/times_year.rb +0 -50
  250. data/examples/usage_example.rb +0 -23
  251. data/examples/use_angles.rb +0 -219
  252. data/rise_set_data.yml +0 -1461
  253. data/tests/minitest/aliased_angles_spec.rb +0 -241
  254. data/tests/minitest/aliased_displays_spec.rb +0 -108
  255. data/tests/minitest/aliased_utilities_spec.rb +0 -38
  256. data/tests/minitest/angles_spec.rb +0 -266
  257. data/tests/minitest/constants_spec.rb +0 -21
  258. data/tests/minitest/delta_epsilon_spec.rb +0 -32
  259. data/tests/minitest/displays_spec.rb +0 -113
  260. data/tests/minitest/geo_spec.rb +0 -40
  261. data/tests/minitest/init_spec.rb +0 -46
  262. data/tests/minitest/nutation_spec.rb +0 -39
  263. data/tests/minitest/times_spec.rb +0 -139
  264. data/tests/minitest/utilities_spec.rb +0 -37
  265. data/tests/spec_config.rb +0 -3
@@ -1,160 +0,0 @@
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
- }
@@ -1,289 +0,0 @@
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
- }
@@ -1,25 +0,0 @@
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