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,144 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # eot_suntimes.rb leftover from building the parts in the gem so just left it here.
3
- #
4
- lib = File.expand_path('../../lib', __FILE__)
5
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
6
-
7
- #def sunrise_jd(arg)
8
- #
9
- # arg.date.nil? ? result = "date parameter not set" : result = "date parameter OK"
10
- #
11
- # arg.longitude.nil? ? result = "longitude parameter not set" : result = "longitude parameter OK"
12
- #
13
- # arg.latitude.nil? ? result = "latitude parameter not set" : result = "latitude parameter OK"
14
- #
15
- # utc_noon_jd = arg.date.jd
16
- #
17
- # lng_jd = arg.longitude / 360.0
18
- #
19
- # mean_utc_noon_jd = utc_noon_jd - lng_jd
20
- #
21
- # tjc_mean_local_noon_array = arg.time_julian_century(mean_utc_noon_jd)
22
- #
23
- # eot = arg.equation_of_time(tjc_mean_local_noon_array)
24
- #
25
- # eot_jd = eot / 1440.0
26
- #
27
- # true_utc_noon_jd = mean_utc_noon_jd - eot_jd
28
- #
29
- # tjc_true_local_noon_array = arg.time_julian_century(true_utc_noon_jd)
30
- #
31
- # mean_anomaly = arg.ma_Sun(tjc_true_local_noon_array)
32
- #
33
- # lha = arg.ha_Sun(tjc_true_local_noon_array, mean_anomaly)
34
- #
35
- # lha_jd = lha / 360.0
36
- #
37
- # # rise_jd
38
- # true_utc_noon_jd - lha_jd
39
- #
40
- #end
41
- #
42
- #def sunset_jd(arg)
43
- #
44
- # arg.date.nil? ? result = "date parameter not set" : result = "date parameter OK"
45
- #
46
- # arg.longitude.nil? ? result = "longitude parameter not set" : result = "longitude parameter OK"
47
- #
48
- # arg.latitude.nil? ? result = "latitude parameter not set" : result = "latitude parameter OK"
49
- #
50
- # utc_noon_jd = arg.date.jd
51
- #
52
- # lng_jd = arg.longitude / 360.0
53
- #
54
- # mean_utc_noon_jd = utc_noon_jd - lng_jd
55
- #
56
- # tjc_mean_local_noon = arg.time_julian_century(mean_utc_noon_jd)
57
- #
58
- # eot_jd = arg.equation_of_time(tjc_mean_local_noon) / 1440.0
59
- #
60
- # true_utc_noon_jd = mean_utc_noon_jd - eot_jd
61
- #
62
- # tjc_true_local_noon = arg.time_julian_century(true_utc_noon_jd)
63
- #
64
- # mean_anomaly = arg.ma_Sun(tjc_true_local_noon)
65
- #
66
- # lha_jd = arg.ha_Sun(tjc_true_local_noon, mean_anomaly) / 360.0
67
- #
68
- # # sunset jd
69
- # true_utc_noon_jd + lha_jd
70
- #
71
- #end
72
-
73
-
74
- require 'eot'
75
-
76
- addr = "8000 South Michigan Ave., Chicago, IL"
77
- #loc = GeoLatLng.new
78
- #loc.addr = addr
79
- #loc.get_coordinates_from_address
80
- #puts loc.lat, loc.lng
81
-
82
- eot = Eot.new(addr)
83
- #eot.longitude = loc.lng
84
- #eot.ajd = Date.today.jd
85
- #eot.latitude = loc.lat
86
-
87
- #puts "Using this files methods"
88
- #puts sunrise_jd(Date.today)
89
-
90
- ## Note: DateTime.jd() renders time from midnight not noon
91
- ## so 12 hours need to be added for correct time.
92
- #puts DateTime.jd(sunrise_jd() + 0.5)
93
- #puts DateTime.jd(sunrise_jd() + 0.5).to_time.utc
94
- #
95
- #puts
96
- #puts sunset_jd()
97
- #
98
- #puts DateTime.jd(sunset_jd() + 0.5)
99
- #puts DateTime.jd(sunset_jd() + 0.5).to_time.utc
100
-
101
- OUT =<<EOS
102
-
103
- Using eot gem methods
104
-
105
- #{eot.latitude}
106
- #{eot.longitude}
107
-
108
- #{eot.sunrise_jd()}
109
- #{eot.ajd_to_datetime(eot.sunrise_jd())}
110
- #{eot.ajd_to_datetime(eot.sunrise_jd()).to_time}
111
-
112
- #{eot.sunset_jd()}
113
- #{eot.ajd_to_datetime(eot.sunset_jd())}
114
- #{eot.ajd_to_datetime(eot.sunset_jd()).to_time}
115
-
116
- #{Date.jd(Date.today.jd)}
117
- #{Date.today.jd}
118
-
119
- #{DateTime.jd(Date.today.jd)}
120
- #{DateTime.jd(Date.today.jd + 0.5)}
121
-
122
- #{DateTime.jd(Date.today.jd).to_time.utc}
123
- #{DateTime.jd(Date.today.jd + 0.5).to_time.utc}
124
-
125
- #{Time.now.to_datetime}
126
- #{Time.now.to_datetime.jd}
127
-
128
- #{Time.now.utc.to_datetime}
129
- #{Time.now.utc.to_date.jd}
130
-
131
- #{Date.jd(Time.now.to_date.jd)}
132
- #{Date.jd(Time.now.utc.to_date.jd)}
133
-
134
- #{DateTime.jd(Time.now.to_datetime.jd)}
135
- #{DateTime.jd(Time.now.utc.to_datetime.jd)}
136
-
137
- #{DateTime.jd(Time.now.to_datetime.jd).to_time}
138
- #{DateTime.jd(Time.now.utc.to_datetime.jd).to_time}
139
-
140
- #{DateTime.jd(Time.now.to_datetime.jd + 0.5).to_time}
141
- #{DateTime.jd(Time.now.utc.to_datetime.jd + 0.5).to_time}
142
- EOS
143
-
144
- puts OUT
@@ -1,186 +0,0 @@
1
- #!/usr/bin/env python
2
- """
3
- https://bitbucket.org/cmcqueen1975/sundials/src/26a0f54a7c18?at=default
4
- Calculation of "equation of time".
5
-
6
- References:
7
- http://en.wikipedia.org/wiki/Equation_of_time
8
- http://www.sundials.co.uk/equation.htm
9
-
10
- Calculations have been done according to the Wikipedia reference.
11
-
12
- Dependencies:
13
- - Python 2.x
14
- - NumPy
15
- - SciPy (only strictly needed for the more accurate calculation)
16
- - matplotlib to plot the graph
17
- """
18
-
19
- import datetime
20
- from collections import namedtuple
21
-
22
- import numpy as np
23
- import scipy # only strictly needed for the more accurate calculation in equation_of_time_accurate()
24
- import scipy.optimize
25
-
26
- # Named tuple to hold geographic location
27
- Location = namedtuple('Location', 'latitude, longitude')
28
-
29
-
30
- # If a location is given, a longitude correction is calculated and included in the graph.
31
- # If the sundial itself includes the longitude correction, just use the 0 value here.
32
- LOCATION = Location(0, 0)
33
- #LOCATION = Location(51.3809, -2.3603) # Bath, England
34
- #LOCATION = Location(35.10, 138.86) # Numazu, Japan
35
- #LOCATION = Location(-37.81, 144.96) # Melbourne, Victoria, Australia
36
-
37
-
38
- DAYS_PER_TROPICAL_YEAR = 365.242
39
- SUN_ECCENTRICITY = 0.01671
40
-
41
- # The angle from the vernal equinox to the periapsis in the plane of the ecliptic.
42
- SUN_ANGLE_OFFSET = 4.9358
43
-
44
- # Angle of tilt of earth's axis--about 23.44 degrees
45
- SUN_OBLIQUITY = 0.40910
46
-
47
-
48
- # Date range for drawing a graph.
49
- DATE_START = datetime.date(2009, 1, 1)
50
- DATE_END = datetime.date(2010, 1, 1)
51
- # Periapsis occurs on a slightly different date each year--varying by a couple
52
- # of days. 4th of January is about the average.
53
- DATE_PERIAPSIS = datetime.date(2009, 1, 4)
54
-
55
-
56
- def longitude_offset(location):
57
- """Given a location, return the offset due to longitude, in degrees
58
- Location's longitude is used. Latitude isn't needed.
59
- """
60
- longitude = location.longitude
61
- longitude_per_hour = (360. / 24)
62
- longitude_offset = longitude % longitude_per_hour
63
- if longitude_offset > longitude_per_hour / 2:
64
- longitude_offset -= longitude_per_hour
65
- return longitude_offset
66
-
67
-
68
- def longitude_offset_min(location):
69
- minute_per_longitude = 24 * 60 / 360.
70
- return longitude_offset(location) * minute_per_longitude
71
-
72
-
73
- def mean_anomaly(day_number_n):
74
- """day_number_n is the number of days from periapsis."""
75
- return day_number_n * (2 * np.pi / DAYS_PER_TROPICAL_YEAR)
76
-
77
-
78
- @np.vectorize
79
- def eccentric_anomaly(mean_anomaly_value):
80
- local_sun_eccentricity = SUN_ECCENTRICITY
81
-
82
- def eccentric_anomaly_function(eccentric_anomaly_value):
83
- return eccentric_anomaly_value - local_sun_eccentricity * np.sin(eccentric_anomaly_value) - mean_anomaly_value
84
-
85
- # eccentric_anomaly_value = scipy.optimize.brentq(eccentric_anomaly_function, 0 - 0.0001, 2 * np.pi + 0.0001)
86
- eccentric_anomaly_value = scipy.optimize.fsolve(eccentric_anomaly_function, mean_anomaly_value)
87
- return eccentric_anomaly_value
88
-
89
-
90
- def true_anomaly(eccentric_anomaly_value):
91
- local_sun_eccentricity = SUN_ECCENTRICITY
92
-
93
- half_eccentric_anomaly = eccentric_anomaly_value / 2
94
- a_x = np.cos(half_eccentric_anomaly)
95
- a_y = np.sin(half_eccentric_anomaly)
96
- a_y *= np.sqrt((1 + local_sun_eccentricity) / (1 - local_sun_eccentricity))
97
- return 2 * np.arctan2(a_y, a_x)
98
-
99
-
100
- def right_ascension(sun_angle):
101
- """sun_angle is the angle from the vernal equinox to the Sun in the plane of the ecliptic.
102
- It is the true_anomaly value plus the SUN_ANGLE_OFFSET."""
103
- a_x = np.cos(sun_angle)
104
- a_y = np.sin(sun_angle)
105
- return np.arctan2(a_y * np.cos(SUN_OBLIQUITY), a_x)
106
-
107
-
108
- def equation_of_time_accurate(day_number_n):
109
- """Calculate the equation of time (in min), given a day number.
110
-
111
- day_number_n is the number of days from periapsis.
112
- Returns the difference between solar time and clock time, in minutes.
113
- This uses a more accurate calculation.
114
- """
115
- mean_anomaly_value = mean_anomaly(day_number_n)
116
- eccentric_anomaly_value = eccentric_anomaly(mean_anomaly_value)
117
- true_anomaly_value = true_anomaly(eccentric_anomaly_value)
118
- right_ascension_value = right_ascension(true_anomaly_value + SUN_ANGLE_OFFSET)
119
- eot = mean_anomaly_value + SUN_ANGLE_OFFSET - right_ascension_value
120
- # Get the angles into the range we want--that is, -pi to +pi
121
- eot = (eot + np.pi) % (2 * np.pi) - np.pi
122
- return eot * (24 * 60 / 2 / np.pi)
123
-
124
-
125
- def equation_of_time_simple(day_number_n):
126
- """Calculate the equation of time (in min), given a day number.
127
-
128
- day_number_n is the number of days from periapsis.
129
- Returns the difference between solar time and clock time, in minutes.
130
- This uses a simple, approximate calculation.
131
- """
132
- mean_anomaly_value = mean_anomaly(day_number_n)
133
- return -7.655 * np.sin(mean_anomaly_value) + 9.873 * np.sin(2 * mean_anomaly_value + 3.588)
134
-
135
-
136
- #equation_of_time = equation_of_time_simple
137
- equation_of_time = equation_of_time_accurate
138
-
139
-
140
- def main():
141
- import matplotlib
142
- #matplotlib.use('pdf')
143
- #matplotlib.use('svg')
144
- from matplotlib import pyplot as plt
145
-
146
-
147
- date_range = np.arange(matplotlib.dates.date2num(DATE_START), matplotlib.dates.date2num(DATE_END), 0.1)
148
- day_numbers = date_range - matplotlib.dates.date2num(DATE_PERIAPSIS)
149
-
150
- # Calculate the accurate and simple calculations of equation of time.
151
- solar_offset_accurate_min = equation_of_time_accurate(day_numbers) + longitude_offset_min(LOCATION)
152
- solar_offset_simple_min = equation_of_time_simple(day_numbers) + longitude_offset_min(LOCATION)
153
-
154
- # Plot the graph, either solar vs clock, or vice-versa.
155
- if 1:
156
- # Solar time vs clock time
157
- plt.plot_date(date_range, solar_offset_accurate_min, '-')
158
- # plt.plot_date(date_range, solar_offset_simple_min, '--')
159
- plt.ylabel('solar time - clock time (min)')
160
- else:
161
- # Clock time vs solar time
162
- plt.plot_date(date_range, -solar_offset_accurate_min, '-')
163
- # plt.plot_date(date_range, -solar_offset_simple_min, '--')
164
- plt.ylabel('clock time - solar time (min)')
165
-
166
- # Set month lines
167
- ax = plt.subplot(111)
168
- ax.xaxis.set_major_locator(matplotlib.dates.MonthLocator())
169
- ax.xaxis.set_major_formatter(matplotlib.ticker.NullFormatter())
170
- # Set month labels centred in the middle (actually on day 15) of each month.
171
- ax.xaxis.set_minor_locator(matplotlib.dates.MonthLocator(bymonthday=15))
172
- ax.xaxis.set_minor_formatter(matplotlib.dates.DateFormatter('%b'))
173
- for tick in ax.xaxis.get_minor_ticks():
174
- tick.tick1line.set_markersize(0)
175
- tick.tick2line.set_markersize(0)
176
-
177
- plt.grid(True)
178
-
179
- plt.show()
180
- # plt.savefig('equation_of_time.pdf')
181
- # plt.savefig('equation_of_time.svg')
182
- # plt.savefig('equation_of_time.png')
183
-
184
-
185
- if __name__ == '__main__':
186
- main()
data/examples/extconf.rb DELETED
@@ -1,2 +0,0 @@
1
- require 'mkmf'
2
- create_makefile("rbeot")
Binary file
@@ -1,31 +0,0 @@
1
- # the file this data comes from 'Circular_179.pdf' IAU 2000A Nutation Series
2
- # the first 678 lines are for lunisolar data
3
-
4
- require 'safe_yaml'
5
-
6
- # make array elements from each line of the file
7
- filename = "nutation_table5_3a.txt"
8
- temp_array = []
9
- data = File.readlines(filename)
10
-
11
- # clean out whitespace and new line breaks
12
- data.each {|i| temp_array << i.strip}
13
-
14
- # make new muti-dimensional data array
15
- data = []
16
- temp_array.each {|i| data << i.split}
17
-
18
- # save the array in a yaml file
19
- File::open( "nutation_table5_3a.yaml", "w" ) do |f|
20
- YAML.dump( data, f )
21
- end
22
-
23
- # show the new data file contents as an array.
24
- data = []
25
- File.open( "nutation_table5_3a.yaml" ) do |f|
26
- YAML.load_documents( f ) do |doc|
27
- data = doc
28
- p data
29
- end
30
- p f
31
- end
@@ -1,10 +0,0 @@
1
- # from_readme.rb
2
-
3
- lib = File.expand_path('../../lib', __FILE__)
4
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
-
6
- require 'eot'
7
-
8
- eot = Eot.new
9
-
10
- puts eot.string_eot()
@@ -1,12 +0,0 @@
1
- # geo_locator.rb
2
-
3
- lib = File.expand_path('../../lib', __FILE__)
4
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
-
6
- require 'eot'
7
-
8
- geo = GeoLatLng.new
9
- geo.addr = "8000 South Michigan Ave., Chicago, IL"
10
- geo.get_coordinates_from_address
11
- p geo.lat
12
- p geo.lng
data/examples/getjd.rb DELETED
@@ -1,45 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require 'date'
4
- include Math
5
-
6
- def calc_time_julian_centurey(t)
7
- # Julian Day Number j(2000) subtracted
8
- (t - 2451545.0) / 36525.0
9
- # Time in fractional centurey
10
- end
11
-
12
- # Truncate large angles
13
- def mod_360(x)
14
- 360.0 * ( x / 360.0 - Integer( x / 360.0))
15
- end
16
-
17
- def calc_mean_long_aries(t)
18
-
19
- mod_360(280.46061666 + t * 36525.0 * 360.98564736629 + t * (t * 0.000387933 - t * (t / 38710000.0)))
20
-
21
- end
22
-
23
- puts "outputs data every 5 seconds"
24
- loop do
25
- time = Time.now.utc
26
- theDate = Date.new(time.year, time.month, time.day)
27
- # puts time
28
- # puts theDate
29
- # puts "#{theDate.ajd} = Astronomical Julian Day"
30
- # puts "#{theDate.jd - 0.5} = Astronomical Julian Day"
31
- # puts "#{theDate.jd} = Julian Day"
32
- t = time
33
- theDayFraction = (t.usec / (1000000.0 * 3600.0) + t.min / 60.0 + t.hour + t.sec / 3600.0) / 24.0
34
- # puts "#{theDayFraction} = Day Fraction time now"
35
-
36
- theTotal = theDate.ajd + theDayFraction
37
- # puts "#{theTotal} = Astronomical Julian Day + Day Fraction time now"
38
-
39
- tjc = calc_time_julian_centurey(theTotal)
40
- gmst = calc_mean_long_aries(tjc)
41
-
42
- puts "#{gmst.round 3} = (GHA) Mean Hour Angle First Point of Aries (Vernal Equinox)"
43
- puts "#{(gmst/15.0).round 3} = Mean Greenwich Siderial Time (GMST)"
44
- sleep 5
45
- end
@@ -1,404 +0,0 @@
1
- # read_nutation_data.rb is a leftover from building it so I just left it in examples.
2
-
3
- lib = File.expand_path('../../lib', __FILE__)
4
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
-
6
- require 'eot'
7
-
8
- eot = Eot.new
9
-
10
- now = DateTime.now.to_time.utc.to_datetime
11
-
12
- =begin
13
-
14
- The file this data comes from is 'Circular_179.pdf' IAU 2000A Nutation Series.
15
- The first 678 lines are for lunisolar data.
16
-
17
- # Try to make an array using each line of the file
18
- filename = 'nutation_series.txt'
19
- temp_array = []
20
- data = File.readlines(filename)
21
- # Clean out whitespace and new line breaks.
22
- data.each {|i| temp_array << i.strip}
23
- # Make new muti-dimensional data array.
24
- data = []
25
- temp_array.each {|i| data << i.split}
26
- # Save the array in a file.
27
- File::open( "nutation_series.data", "w" ) do |f|
28
- f << data
29
- end
30
-
31
- # Make new muti-dimensional data array using yaml
32
- data = []
33
- temp_array.each {|i| data << i.split}
34
- # Save the array in a yaml file.
35
- File::open( "nutation_series.yaml", "w" ) do |f|
36
- f << data.to_yaml
37
- end
38
-
39
-
40
- # $:.unshift(File.expand_path(File.dirname(__FILE__)))
41
- # require 'nutation_series_data'
42
- # or for => Ruby 1.9.2
43
- require_relative 'nutation_series_data'
44
- # I manually added @data = to the beginning of the new array file nutation_series.rb so we may use it
45
- # data = @data
46
-
47
- # load in the yaml data
48
- data = []
49
- File.open( "nutation_series2.yaml" ) do |f|
50
- YAML.load_documents( f ) do |doc|
51
- data = doc
52
- end
53
- end
54
-
55
- =end
56
-
57
- ## data was initialized when the class instance was via nutation_series2.yaml file.
58
- #data = eot.data
59
- #file_path = File.expand_path( File.dirname( __FILE__ ) + "/nutation_table5_3a.yaml" )
60
- #data = YAML::load( File.open( file_path, 'r'), :safe => true ).freeze
61
- ## Arc seconds to radians formula
62
- #ARCSEC = 3600.0
63
- #dtr = Math::PI / 180.0 / ARCSEC # adjusted for working in the arc seconds values
64
-
65
- ## sine degrees
66
- #def sind(dtr, x)
67
- # Math::sin(dtr*x)
68
- #end
69
- ## cod degrees
70
- #def cosd(dtr, x)
71
- # Math::cos(dtr*x)
72
- #end
73
-
74
-
75
- ## The JD is at Noon 12:00 UTC for today
76
- ## In all of these expressions, T is the number of Julian centuries of TDB since 2000 Jan 1, 12h TDB (or,
77
- ## with negligible error, the number of Julian centuries of TT since J2000.0).
78
- #jd2000 = 2451545.0 # the J2000 Julian Day Number
79
- #
80
- #ajd = DateTime.now.to_time.utc.to_datetime.ajd.to_f
81
- #
82
- ## calculate time to julian centuries
83
- #t = eot.time_julian_century()
84
-
85
- ## Values are in arc seconds see below for definitions of terms
86
- #ma_moon = 485868.249036 + 1717915923.2178 * t[0] + 31.8792 * t[1] + 0.051635 * t[2] - 0.00024470 * t[3]
87
- #ma_sun = 1287104.79305 + 129596581.0481 * t[0] - 0.5532 * t[1] + 0.000136 * t[2] - 0.00001149 * t[3]
88
- #md_moon = 335779.526232 + 1739527262.8478 * t[0] - 12.7512 * t[1] - 0.001037 * t[2] + 0.00000417 * t[3]
89
- #me_moon = 1072260.70369 + 1602961601.2090 * t[0] - 6.3706 * t[1] + 0.006593 * t[2] - 0.00003169 * t[3]
90
- #omega = 450160.398036 - 6962890.5431 * t[0] + 7.4722 * t[1] + 0.007702 * t[2] - 0.00005939 * t[3]
91
-
92
- ## declare and clear these two variables for the sigma loop
93
- #delta_psi, delta_eps = 0, 0
94
- #
95
- #lines = data.size - 1
96
- #for i in 0..lines
97
- # fma_sun = data[i][0].to_i
98
- # fma_moon = data[i][1].to_i
99
- # fmd_moon = data[i][2].to_i
100
- # fme_moon = data[i][3].to_i
101
- # fomega = data[i][4].to_i
102
- # sine = sind(dtr, fma_moon * ma_moon +
103
- # fma_sun * ma_sun +
104
- # fmd_moon * md_moon +
105
- # fme_moon * me_moon +
106
- # fomega * omega)
107
- # cosine = cosd(dtr, fma_moon * ma_moon +
108
- # fma_sun * ma_sun +
109
- # fmd_moon * md_moon +
110
- # fme_moon * me_moon +
111
- # fomega * omega)
112
- # delta_psi += (data[i][6].to_f +
113
- # data[i][7].to_f * t[0]) * sine +
114
- # data[i][10].to_f * cosine
115
- #
116
- # delta_eps += (data[i][8].to_f +
117
- # data[i][9].to_f * t[0]) * cosine +
118
- # data[i][12].to_f * sine
119
- #
120
- #end
121
- #
122
- ## convert arc seconds to degree
123
- #def to_deg( arc_secs )
124
- # arc_secs / ARCSEC
125
- #end
126
- #
127
- #delta_eps = to_deg( delta_eps ) / 1000.0
128
- #delta_eps = eot.delta_epsilon(t)
129
- #
130
- #delta_psi = to_deg( delta_psi ) / 1000.0
131
- #delta_psi = eot.delta_psi(t)
132
-
133
- #Delta epsilon degrees decimal = #{to_deg(delta_eps)}
134
-
135
-
136
-
137
- ##Delta psi needs to be degrees and eps is degrees but dtr uses ARCSEC constant also we need the result back in ARCSEC / 15 to get time in secs.
138
- ## eoe = delta_psi / ARCSEC * cosd( dtr * ARCSEC, eps ) * ARCSEC / 15.0
139
- #eoe = eot.eq_of_equinox() / 15.0
140
- ##p eot.ml_Aries()
141
- #gmst = eot.ml_Aries() / 15.0 # make angle to time.
142
- ## eoe is ARCSEC so convert it to hours.
143
- #gast = gmst + eoe
144
-
145
-
146
-
147
- ##Mean Obliquity of Ecliptic degrees = #{eot.display_degrees(eps0)}
148
- #eot.mo_Earth()
149
- ##True Obliquity of Ecliptic degrees = #{eot.display_degrees(eps)}
150
- #eps = eot.to_Earth()
151
-
152
- #eoe = eot.eq_of_equinox() / 15.0
153
- #gmst = eot.ml_Aries() / 15.0 # make angle to time.
154
- #gast = gmst + eoe
155
- run = <<EOS
156
- #{now}
157
-
158
- #{now.to_time}
159
-
160
- The JD = #{eot.ajd = now.ajd.to_f}
161
-
162
- Mean Obliquity of Ecliptic = #{eot.degrees_to_s(eot.mo_Earth())}
163
-
164
- Delta epsilon in arc seconds = #{eot.delta_epsilon() * Eot::R2D * 3600.0}
165
-
166
- True Obliquity of Ecliptic degrees = #{eot.degrees_to_s(eot.to_Earth())}
167
-
168
- Delta psi in arc seconds = #{eot.delta_psi * Eot::R2D * 3600}
169
-
170
- Equation of equinox in seconds = Delta psi * cos epsilon = #{eot.eq_of_equinox() * Eot::R2D / 15.0 * 3600}
171
-
172
- Greenwich Mean Sidereal Time = #{eot.string_time(eot.ml_Aries() * Eot::R2D / 15.0)}
173
-
174
- Greenwich Apparent Sideral Time = #{eot.string_time(eot.ml_Aries() * Eot::R2D / 15.0 + eot.eq_of_equinox() * Eot::R2D / 15.0)}
175
-
176
- To compare results enter the date and time into http://www.celnav.de/longterm.htm
177
-
178
- You can use the methods in EOT instead of this example as this just shows how it works.
179
-
180
- EOS
181
-
182
- puts run
183
-
184
- # Helpful info
185
- =begin
186
- these values are in arc seconds
187
-
188
- Mean anomaly of the moon
189
- ma_moon = 485868.249036 + 1717915923.2178 * t + 31.8792 * t2 + 0.051635 * t3 - 0.00024470 * t4
190
-
191
- Mean anomaly of the sun
192
- ma_sun = 1287104.79305 + 129596581.0481 * t - 0.5532 * t2 + 0.000136 * t3 - 0.00001149 * t4
193
-
194
-
195
- Mean distance of the moon from the ascending node
196
- md_moon = 335779.526232 + 1739527262.8478 * t - 12.7512 * t2 - 0.001037 * t3 + 0.00000417 * t4
197
-
198
-
199
- Mean elongation of the moon
200
- me_moon = 1072260.70369 + 1602961601.2090 * t - 6.3706 * t2 + 0.006593 * t3 - 0.00003169 * t4
201
-
202
-
203
- Longitude of the ascending node of the moon
204
- omega = 450160.398036 - 6962890.5431 * t + 7.4722 * t2 + 0.007702 * t3 - 0.00005939 * t4
205
-
206
- =end
207
-
208
- =begin
209
-
210
- Manualy converted values from arc seconds to dergrees(not used here)
211
-
212
- ma_moon = 134.96340251 + 477198.8675605 * t + t2 / 112.92629677 + t3 / 69720.15106 - t4 / 14711892.112791
213
- ma_sun = 357.52910918 + 35999.0502911389 * t - t2 / 6507.592191 + t3 / 26470588.2353 - t4 / 313315926.89295
214
- md_moon = 93.27209062 + 483202.01745772 * t - t2 / 282.3264 - t3 / 3471552.555 + t4 / 863309352.5179856
215
- me_moon = 297.8501954694 + 445267.11144694 * t - t2 / 565.0959 + t3 / 546033.672 - t4 / 113600504.891
216
- omega = 125.04455501 - 1934.136261972 * t + t2 / 481.78582 + 0.007702 * t3 / 467411.062 - t4 / 60616265.3645
217
-
218
- =end
219
-
220
-
221
- =begin
222
-
223
- An example of usage for 'Circular_179.pdf' IAU 2000A Nutation Series
224
- The JavaScript from: view-source:http://www.celnav.de/longterm.htm
225
- //Nutation, obliquity of the ecliptic
226
- function Nutation()
227
- {
228
- //IAU 1980 nutation theory:
229
-
230
- //Mean anomaly of the moon
231
- var Mm = 134.962981389+198.867398056*TE+trunc(477000*TE)+0.008697222222*TE2+TE3/56250;
232
-
233
- //Mean anomaly of the sun
234
- var M = 357.527723333+359.05034*TE+trunc(35640*TE)-0.0001602777778*TE2-TE3/300000;
235
-
236
- //Mean distance of the moon from the ascending node
237
- var F = 93.271910277+82.017538055*TE+trunc(483120*TE)-0.0036825*TE2+TE3/327272.7273;
238
-
239
- //Mean elongation of the moon
240
- var D = 297.850363055+307.11148*TE+trunc(444960*TE)-0.001914166667*TE2+TE3/189473.6842;
241
-
242
- //Longitude of the ascending node of the moon
243
- var omega = 125.044522222-134.136260833*TE-trunc(1800*TE)+0.002070833333*TE2+TE3/450000;
244
-
245
- //Periodic terms for nutation
246
- var nut = new Array(106);
247
- nut[0] = " 0 0 0 0 1-171996-174.2 92025 8.9 ";
248
- nut[1] = " 0 0 2-2 2 -13187 -1.6 5736-3.1 ";
249
- nut[2] = " 0 0 2 0 2 -2274 -0.2 977-0.5 ";
250
- nut[3] = " 0 0 0 0 2 2062 0.2 -895 0.5 ";
251
- nut[4] = " 0-1 0 0 0 -1426 3.4 54-0.1 ";
252
- nut[5] = " 1 0 0 0 0 712 0.1 -7 0.0 ";
253
- nut[6] = " 0 1 2-2 2 -517 1.2 224-0.6 ";
254
- nut[7] = " 0 0 2 0 1 -386 -0.4 200 0.0 ";
255
- nut[8] = " 1 0 2 0 2 -301 0.0 129-0.1 ";
256
- nut[9] = " 0-1 2-2 2 217 -0.5 -95 0.3 ";
257
- nut[10] = "-1 0 0 2 0 158 0.0 -1 0.0 ";
258
- nut[11] = " 0 0 2-2 1 129 0.1 -70 0.0 ";
259
- nut[12] = "-1 0 2 0 2 123 0.0 -53 0.0 ";
260
- nut[13] = " 1 0 0 0 1 63 0.1 -33 0.0 ";
261
- nut[14] = " 0 0 0 2 0 63 0.0 -2 0.0 ";
262
- nut[15] = "-1 0 2 2 2 -59 0.0 26 0.0 ";
263
- nut[16] = "-1 0 0 0 1 -58 -0.1 32 0.0 ";
264
- nut[17] = " 1 0 2 0 1 -51 0.0 27 0.0 ";
265
- nut[18] = "-2 0 0 2 0 -48 0.0 1 0.0 ";
266
- nut[19] = "-2 0 2 0 1 46 0.0 -24 0.0 ";
267
- nut[20] = " 0 0 2 2 2 -38 0.0 16 0.0 ";
268
- nut[21] = " 2 0 2 0 2 -31 0.0 13 0.0 ";
269
- nut[22] = " 2 0 0 0 0 29 0.0 -1 0.0 ";
270
- nut[23] = " 1 0 2-2 2 29 0.0 -12 0.0 ";
271
- nut[24] = " 0 0 2 0 0 26 0.0 -1 0.0 ";
272
- nut[25] = " 0 0 2-2 0 -22 0.0 0 0.0 ";
273
- nut[26] = "-1 0 2 0 1 21 0.0 -10 0.0 ";
274
- nut[27] = " 0 2 0 0 0 17 -0.1 0 0.0 ";
275
- nut[28] = " 0 2 2-2 2 -16 0.1 7 0.0 ";
276
- nut[29] = "-1 0 0 2 1 16 0.0 -8 0.0 ";
277
- nut[30] = " 0 1 0 0 1 -15 0.0 9 0.0 ";
278
- nut[31] = " 1 0 0-2 1 -13 0.0 7 0.0 ";
279
- nut[32] = " 0-1 0 0 1 -12 0.0 6 0.0 ";
280
- nut[33] = " 2 0-2 0 0 11 0.0 0 0.0 ";
281
- nut[34] = "-1 0 2 2 1 -10 0.0 5 0.0 ";
282
- nut[35] = " 1 0 2 2 2 -8 0.0 3 0.0 ";
283
- nut[36] = " 0-1 2 0 2 -7 0.0 3 0.0 ";
284
- nut[37] = " 0 0 2 2 1 -7 0.0 3 0.0 ";
285
- nut[38] = " 1 1 0-2 0 -7 0.0 0 0.0 ";
286
- nut[39] = " 0 1 2 0 2 7 0.0 -3 0.0 ";
287
- nut[40] = "-2 0 0 2 1 -6 0.0 3 0.0 ";
288
- nut[41] = " 0 0 0 2 1 -6 0.0 3 0.0 ";
289
- nut[42] = " 2 0 2-2 2 6 0.0 -3 0.0 ";
290
- nut[43] = " 1 0 0 2 0 6 0.0 0 0.0 ";
291
- nut[44] = " 1 0 2-2 1 6 0.0 -3 0.0 ";
292
- nut[45] = " 0 0 0-2 1 -5 0.0 3 0.0 ";
293
- nut[46] = " 0-1 2-2 1 -5 0.0 3 0.0 ";
294
- nut[47] = " 2 0 2 0 1 -5 0.0 3 0.0 ";
295
- nut[48] = " 1-1 0 0 0 5 0.0 0 0.0 ";
296
- nut[49] = " 1 0 0-1 0 -4 0.0 0 0.0 ";
297
- nut[50] = " 0 0 0 1 0 -4 0.0 0 0.0 ";
298
- nut[51] = " 0 1 0-2 0 -4 0.0 0 0.0 ";
299
- nut[52] = " 1 0-2 0 0 4 0.0 0 0.0 ";
300
- nut[53] = " 2 0 0-2 1 4 0.0 -2 0.0 ";
301
- nut[54] = " 0 1 2-2 1 4 0.0 -2 0.0 ";
302
- nut[55] = " 1 1 0 0 0 -3 0.0 0 0.0 ";
303
- nut[56] = " 1-1 0-1 0 -3 0.0 0 0.0 ";
304
- nut[57] = "-1-1 2 2 2 -3 0.0 1 0.0 ";
305
- nut[58] = " 0-1 2 2 2 -3 0.0 1 0.0 ";
306
- nut[59] = " 1-1 2 0 2 -3 0.0 1 0.0 ";
307
- nut[60] = " 3 0 2 0 2 -3 0.0 1 0.0 ";
308
- nut[61] = "-2 0 2 0 2 -3 0.0 1 0.0 ";
309
- nut[62] = " 1 0 2 0 0 3 0.0 0 0.0 ";
310
- nut[63] = "-1 0 2 4 2 -2 0.0 1 0.0 ";
311
- nut[64] = " 1 0 0 0 2 -2 0.0 1 0.0 ";
312
- nut[65] = "-1 0 2-2 1 -2 0.0 1 0.0 ";
313
- nut[66] = " 0-2 2-2 1 -2 0.0 1 0.0 ";
314
- nut[67] = "-2 0 0 0 1 -2 0.0 1 0.0 ";
315
- nut[68] = " 2 0 0 0 1 2 0.0 -1 0.0 ";
316
- nut[69] = " 3 0 0 0 0 2 0.0 0 0.0 ";
317
- nut[70] = " 1 1 2 0 2 2 0.0 -1 0.0 ";
318
- nut[71] = " 0 0 2 1 2 2 0.0 -1 0.0 ";
319
- nut[72] = " 1 0 0 2 1 -1 0.0 0 0.0 ";
320
- nut[73] = " 1 0 2 2 1 -1 0.0 1 0.0 ";
321
- nut[74] = " 1 1 0-2 1 -1 0.0 0 0.0 ";
322
- nut[75] = " 0 1 0 2 0 -1 0.0 0 0.0 ";
323
- nut[76] = " 0 1 2-2 0 -1 0.0 0 0.0 ";
324
- nut[77] = " 0 1-2 2 0 -1 0.0 0 0.0 ";
325
- nut[78] = " 1 0-2 2 0 -1 0.0 0 0.0 ";
326
- nut[79] = " 1 0-2-2 0 -1 0.0 0 0.0 ";
327
- nut[80] = " 1 0 2-2 0 -1 0.0 0 0.0 ";
328
- nut[81] = " 1 0 0-4 0 -1 0.0 0 0.0 ";
329
- nut[82] = " 2 0 0-4 0 -1 0.0 0 0.0 ";
330
- nut[83] = " 0 0 2 4 2 -1 0.0 0 0.0 ";
331
- nut[84] = " 0 0 2-1 2 -1 0.0 0 0.0 ";
332
- nut[85] = "-2 0 2 4 2 -1 0.0 1 0.0 ";
333
- nut[86] = " 2 0 2 2 2 -1 0.0 0 0.0 ";
334
- nut[87] = " 0-1 2 0 1 -1 0.0 0 0.0 ";
335
- nut[88] = " 0 0-2 0 1 -1 0.0 0 0.0 ";
336
- nut[89] = " 0 0 4-2 2 1 0.0 0 0.0 ";
337
- nut[90] = " 0 1 0 0 2 1 0.0 0 0.0 ";
338
- nut[91] = " 1 1 2-2 2 1 0.0 -1 0.0 ";
339
- nut[92] = " 3 0 2-2 2 1 0.0 0 0.0 ";
340
- nut[93] = "-2 0 2 2 2 1 0.0 -1 0.0 ";
341
- nut[94] = "-1 0 0 0 2 1 0.0 -1 0.0 ";
342
- nut[95] = " 0 0-2 2 1 1 0.0 0 0.0 ";
343
- nut[96] = " 0 1 2 0 1 1 0.0 0 0.0 ";
344
- nut[97] = "-1 0 4 0 2 1 0.0 0 0.0 ";
345
- nut[98] = " 2 1 0-2 0 1 0.0 0 0.0 ";
346
- nut[99] = " 2 0 0 2 0 1 0.0 0 0.0 ";
347
- nut[100]= " 2 0 2-2 1 1 0.0 -1 0.0 ";
348
- nut[101]= " 2 0-2 0 1 1 0.0 0 0.0 ";
349
- nut[102]= " 1-1 0-2 0 1 0.0 0 0.0 ";
350
- nut[103]= "-1 0 0 1 1 1 0.0 0 0.0 ";
351
- nut[104]= "-1-1 0 2 1 1 0.0 0 0.0 ";
352
- nut[105]= " 0 1 0 1 0 1 0.0 0 0.0 ";
353
-
354
- //Reading periodic terms
355
- var fMm, fM, fF, fD, f_omega, dp=0, de=0;
356
-
357
- for (x=0; x<105; x++)
358
- {
359
- fMm = eval(nut[x].substring(0,2));
360
- fM = eval(nut[x].substring(2,4));
361
- fF = eval(nut[x].substring(4,6));
362
- fD = eval(nut[x].substring(6,8));
363
- f_omega = eval(nut[x].substring(8,10));
364
- dp += (eval(nut[x].substring(10,17))+TE*eval(nut[x].substring(17,23)))*sind(fD*D+fM*M+fMm*Mm+fF*F+f_omega*omega);
365
- de += (eval(nut[x].substring(23,29))+TE*eval(nut[x].substring(29,33)))*cosd(fD*D+fM*M+fMm*Mm+fF*F+f_omega*omega);
366
- }
367
-
368
- //Corrections (Herring, 1987)
369
- /*
370
- var corr = new Array(4);
371
- corr[0] = " 0 0 0 0 1-725 417 213 224 ";
372
- corr[1] = " 0 1 0 0 0 523 61 208 -24 ";
373
- corr[2] = " 0 0 2-2 2 102-118 -41 -47 ";
374
- corr[3] = " 0 0 2 0 2 -81 0 32 0 ";
375
-
376
- for (x=0; x<4; x++)
377
- {
378
- fMm = eval(corr[x].substring(0,2));
379
- fM = eval(corr[x].substring(2,4));
380
- fF = eval(corr[x].substring(4,6));
381
- fD = eval(corr[x].substring(6,8));
382
- f_omega = eval(corr[x].substring(8,10));
383
- dp += 0.1*(eval(corr[x].substring(10,14))*sind(fD*D+fM*M+fMm*Mm+fF*F+f_omega*omega)+eval(corr[x].substring(14,18))*cosd(fD*D+fM*M+fMm*Mm+fF*F+f_omega*omega));
384
- de += 0.1*(eval(corr[x].substring(18,22))*cosd(fD*D+fM*M+fMm*Mm+fF*F+f_omega*omega)+eval(corr[x].substring(22,26))*sind(fD*D+fM*M+fMm*Mm+fF*F+f_omega*omega));
385
- }
386
- */
387
-
388
- //Nutation in longitude
389
- delta_psi = dp/36000000;
390
-
391
- //Nutation in obliquity
392
- delta_eps = de/36000000;
393
-
394
- //Mean obliquity of the ecliptic
395
- eps0 = (84381.448-46.815*TE-0.00059*TE2+0.001813*TE3)/3600;
396
-
397
- //True obliquity of the ecliptic
398
- eps = eps0+delta_eps;
399
- }
400
-
401
- //Equation of the equinoxes
402
- EoE = 240*delta_psi*cosd(eps);
403
-
404
- =end