equationoftime 4.1.2 → 4.1.4

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 (90) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/.ruby-version +1 -1
  4. data/Gemfile +6 -4
  5. data/Gemfile.lock +21 -14
  6. data/Guardfile +4 -21
  7. data/Manifest.txt +18 -52
  8. data/README.rdoc +6 -6
  9. data/Rakefile +53 -92
  10. data/equationoftime.gemspec +48 -49
  11. data/examples/my_lst.rb +9 -0
  12. data/examples/use_addr.rb +20 -0
  13. data/examples/use_ajd.rb +40 -0
  14. data/ext/eot/ceot.c +18 -14
  15. data/ext/eot/extconf.rb +4 -5
  16. data/lib/eot/angle_displays.rb +95 -0
  17. data/lib/eot/angles.rb +160 -291
  18. data/lib/eot/constants.rb +78 -81
  19. data/lib/eot/deltas.rb +40 -0
  20. data/lib/eot/geo_lat_lng_smt.rb +30 -57
  21. data/lib/eot/init.rb +86 -124
  22. data/lib/eot/time_displays.rb +105 -0
  23. data/lib/eot/times.rb +118 -121
  24. data/lib/eot/trigometric.rb +51 -0
  25. data/lib/eot/utilities.rb +49 -50
  26. data/lib/eot/version.rb +3 -2
  27. data/lib/eot.rb +11 -5
  28. data/test/eot/aliased_angles_spec.rb +291 -0
  29. data/test/eot/aliased_displays_spec.rb +126 -0
  30. data/test/{aliased_utilities_spec.rb → eot/aliased_utilities_spec.rb} +32 -36
  31. data/test/eot/angles_spec.rb +261 -0
  32. data/test/eot/constants_spec.rb +17 -0
  33. data/test/eot/displays_spec.rb +111 -0
  34. data/test/eot/geo_spec.rb +40 -0
  35. data/test/eot/init_spec.rb +45 -0
  36. data/test/eot/times_spec.rb +137 -0
  37. data/wiki.md +55 -0
  38. data/wiki2.md +4 -0
  39. data.tar.gz.sig +0 -0
  40. metadata +55 -69
  41. metadata.gz.sig +0 -0
  42. data/.settings/org.eclipse.ltk.core.refactoring.prefs +0 -2
  43. data/examples/analemma_data_generator.rb +0 -58
  44. data/examples/check_date_type.rb +0 -60
  45. data/examples/compare_geoc_long_ra.rb +0 -44
  46. data/examples/data_table_for_astro_dog.rb +0 -45
  47. data/examples/earth_rotation.rb +0 -42
  48. data/examples/eot_methods_list.rb +0 -48
  49. data/examples/eot_plot.r +0 -57
  50. data/examples/eot_suntimes.rb +0 -149
  51. data/examples/equation_of_time.py +0 -186
  52. data/examples/figure_1.jpg +0 -0
  53. data/examples/file_converter.rb +0 -31
  54. data/examples/from_readme.rb +0 -14
  55. data/examples/from_wiki.rb +0 -46
  56. data/examples/geo_locator.rb +0 -16
  57. data/examples/getjd.rb +0 -45
  58. data/examples/gmst_gast_non_sofa.rb +0 -406
  59. data/examples/input_suntimes.rb +0 -24
  60. data/examples/julian_day_formula.rb +0 -29
  61. data/examples/julian_day_formula.txt +0 -12
  62. data/examples/my_time_conversion.rb +0 -21
  63. data/examples/nutation_series.txt +0 -678
  64. data/examples/nutation_table5_3a.txt +0 -682
  65. data/examples/ptime.rb +0 -162
  66. data/examples/suntimes.rb +0 -30
  67. data/examples/suntimes_test.rb +0 -50
  68. data/examples/t_sofa.rb +0 -8228
  69. data/examples/test_celes.rb +0 -51
  70. data/examples/test_ceot.rb +0 -55
  71. data/examples/test_poly_eval.rb +0 -32
  72. data/examples/time_scales.rb +0 -29
  73. data/examples/times_year.rb +0 -53
  74. data/examples/usage_example.rb +0 -26
  75. data/examples/use_angles.rb +0 -222
  76. data/lib/eot/displays.rb +0 -216
  77. data/lib/eot/eot.so +0 -0
  78. data/lib/eot/nutation.rb +0 -78
  79. data/run_tests_eclipse.rb +0 -1
  80. data/test/aliased_angles_spec.rb +0 -239
  81. data/test/aliased_displays_spec.rb +0 -105
  82. data/test/angles_spec.rb +0 -264
  83. data/test/constants_spec.rb +0 -20
  84. data/test/displays_spec.rb +0 -110
  85. data/test/geo_spec.rb +0 -38
  86. data/test/init_spec.rb +0 -44
  87. data/test/nutation_spec.rb +0 -37
  88. data/test/spec_config.rb +0 -8
  89. data/test/times_spec.rb +0 -133
  90. data/test/utilities_spec.rb +0 -35
data/lib/eot/nutation.rb DELETED
@@ -1,78 +0,0 @@
1
- # nutation.rb
2
-
3
- #require_relative 'celes_core'
4
- #require 'celes'
5
-
6
- class Eot
7
-
8
- # From nutation.rb:
9
- # Returns array with [ delta_eps, delta_psi, ma_sun, omega]
10
- # celes gem is used here now for performance. It is a Ruby wrapper for
11
- # see http://www.iausofa.org/
12
- # also see http://aa.usno.navy.mil/ Circular 179 nutation data page 46 (5.19)
13
- # Note: Original code is still intact just commented out.
14
- def delta_equinox()
15
- # Mean anomaly of the Moon.
16
- # ma_moon = [-0.00024470, 0.051635, 31.8792, 1717915923.2178, 485868.249036].inject(0.0) {|p, a| p * @ta + a}
17
- # ma_moon = Celes.fal03(@ta)
18
- # Mean anomaly of the Sun.
19
- # ma_sun = [-0.00001149, 0.000136, -0.5532, 129596581.0481, 1287104.793048].inject(0.0) {|p, a| p * @ta + a}
20
- # ma_sun = Celes.falp03(@ta)
21
- # mean longitude of the Moon minus mean longitude of the ascending node.
22
- # md_moon = [0.00000417, -0.001037, -12.7512, 1739527262.8478, 335779.526232].inject(0.0) {|p, a| p * @ta + a}
23
- # md_moon = Celes.faf03(@ta)
24
- # Mean elongation of the Moon from the Sun.
25
- # me_moon = [-0.00003169, 0.006593, -6.3706, 1602961601.2090, 1072260.70369].inject(0.0) {|p, a| p * @ta + a}
26
- # me_moon = Celes.fad03(@ta)
27
- # Mean longitude of the ascending node of the Moon.
28
- # omega = [-0.00005939, 0.007702, 7.4722, -6962890.5431, 450160.398036].inject(0.0) {|p, a| p * @ta + a}
29
- # omega = Celes.faom03(@ta)
30
- # declare and clear these two variables for the sigma loop
31
- # delta_psi, delta_eps = 0, 0
32
-
33
- # lines = data.size - 1
34
- # (0..lines).each do |i|
35
- # fma_sun = data[i][0].to_i
36
- # fma_moon = data[i][1].to_i
37
- # fmd_moon = data[i][2].to_i
38
- # fme_moon = data[i][3].to_i
39
- # fomega = data[i][4].to_i
40
-
41
- # sine = sin(fma_moon * ma_moon +
42
- # fma_sun * ma_sun +
43
- # fmd_moon * md_moon +
44
- # fme_moon * me_moon +
45
- # fomega * omega)
46
-
47
- # cosine = cos(fma_moon * ma_moon +
48
- # fma_sun * ma_sun +
49
- # fmd_moon * md_moon +
50
- # fme_moon * me_moon +
51
- # fomega * omega)
52
-
53
- # delta_psi += (data[i][6].to_f +
54
- # data[i][7].to_f * @ta) * sine +
55
- # data[i][10].to_f * cosine
56
-
57
- # delta_eps += (data[i][8].to_f +
58
- # data[i][9].to_f * @ta) * cosine +
59
- # data[i][12].to_f * sine
60
-
61
- # end
62
-
63
-
64
- # delta_eps = delta_eps / 1000.0 / 3600.0
65
- # delta_psi = delta_psi / 1000.0 / 3600.0
66
-
67
- [ Celes.nut06a(@ajd, 0)[0], Celes.nut06a(@ajd, 0)[1]]
68
- # [ nil, nil, ma_moon, ma_sun, md_moon, me_moon, omega]
69
- end
70
-
71
- end
72
- if __FILE__ == $PROGRAM_NAME
73
-
74
- spec = File.expand_path('../../../tests/minitest', __FILE__)
75
- $LOAD_PATH.unshift(spec) unless $LOAD_PATH.include?(spec)
76
- require 'nutation_spec'
77
-
78
- end
data/run_tests_eclipse.rb DELETED
@@ -1 +0,0 @@
1
- system 'rake'
@@ -1,239 +0,0 @@
1
- # aliased_angles_spec.rb
2
- #
3
-
4
- require_relative 'spec_config'
5
-
6
- lib = File.expand_path('../../../lib', __FILE__)
7
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
8
- require 'eot'
9
-
10
- Eot_aliased_angles = Eot.new()
11
-
12
- describe 'tests ajd of 2456885.0' do
13
-
14
- before(:each) do
15
- Eot_aliased_angles.ajd = 2456885.0
16
- ajd = Eot_aliased_angles.ajd
17
- # somtimes need date to check values somewhere else
18
- Eot_aliased_angles.date = Eot_aliased_angles.ajd_to_datetime(ajd)
19
- end
20
-
21
- it 'expected 2456885.0 for Eot_aliased_angles.ajd'do
22
- assert_equal( 2456885.0, Eot_aliased_angles.ajd )
23
- end
24
-
25
- it 'expected "2014-08-15T12:00:00+00:00" for Eot_aliased_angles.date'.to_s do
26
- assert_equal( "2014-08-15T12:00:00+00:00", Eot_aliased_angles.date.to_s )
27
- end
28
-
29
- it 'expected 3.8508003966038915 for Eot_aliased_angles.ma'do
30
- assert_equal( 3.8508003966038915, Eot_aliased_angles.ma )
31
- end
32
-
33
- it 'expected 2.4887103398436143 returned by Eot_aliased_angles.apparent_longitude()? ' do
34
- assert_equal( 2.4887103398436143, Eot_aliased_angles.apparent_longitude() )
35
- end
36
-
37
- it 'expected -0.7943361570447028 returned by Eot_aliased_angles.cosine_apparent_longitude()? ' do
38
- assert_equal( -0.7943361570447028, Eot_aliased_angles.cosine_apparent_longitude() )
39
- end
40
-
41
- it 'expected -0.7943772759574919 returned by Eot_aliased_angles.cosine_true_longitude()? ' do
42
- assert_equal( -0.7943772759574919, Eot_aliased_angles.cosine_true_longitude() )
43
- end
44
-
45
- it 'expected 0.9175115346811911 returned by Eot_aliased_angles.cosine_true_obliquity()? ' do
46
- assert_equal( 0.9175115346811911, Eot_aliased_angles.cosine_true_obliquity() )
47
- end
48
-
49
- it 'expected 0.24401410218543554 returned by Eot_aliased_angles.declination()? ' do
50
- assert_equal( 0.24401410218543554, Eot_aliased_angles.declination() )
51
- end
52
-
53
- it 'expected -0.04103082558803539 returned by Eot_aliased_angles.delta_t_ecliptic()? ' do
54
- assert_equal( -0.04103082558803539, Eot_aliased_angles.delta_t_ecliptic() )
55
- end
56
-
57
- it 'expected 0.021413249720702243 returned by Eot_aliased_angles.delta_t_elliptic()? ' do
58
- assert_equal( 0.021413249720702243, Eot_aliased_angles.delta_t_elliptic() )
59
- end
60
-
61
- it 'expected 0.016702468499021204 returned by Eot_aliased_angles.eccentricity_earth_orbit()? ' do
62
- assert_equal( 0.016702468499021204, Eot_aliased_angles.eccentricity_earth_orbit() )
63
- end
64
-
65
- it 'expected -0.021413249720702462 returned by Eot_aliased_angles.equation_of_center()? ' do
66
- assert_equal( -0.021413249720702462, Eot_aliased_angles.equation_of_center() )
67
- end
68
-
69
- it 'expected 2.5101912804141424 returned by Eot_aliased_angles.geometric_mean_longitude()? ' do
70
- assert_equal( 2.5101912804141424, Eot_aliased_angles.geometric_mean_longitude() )
71
- end
72
-
73
- it 'expected 1.9143229567859146 returned by Eot_aliased_angles.horizon_angle()? ' do
74
- assert_equal( 1.9143229567859146, Eot_aliased_angles.horizon_angle() )
75
- end
76
-
77
- it 'expected 3.8508003966038915 returned by Eot_aliased_angles.mean_anomaly()? ' do
78
- assert_equal( 3.8508003966038915, Eot_aliased_angles.mean_anomaly() )
79
- end
80
-
81
- it 'expected 2.510089864980358 returned by Eot_aliased_angles.mean_longitude_aries()? ' do
82
- assert_equal( 2.510089864980358, Eot_aliased_angles.mean_longitude_aries() )
83
- end
84
-
85
- it 'expected 0.40905940254265843 returned by Eot_aliased_angles.mean_obliquity()? ' do
86
- assert_equal( 0.40905940254265843, Eot_aliased_angles.mean_obliquity() )
87
- end
88
-
89
- it 'expected 0.40905940254265843 returned by Eot_aliased_angles.mean_obliquity_of_ecliptic()? ' do
90
- assert_equal( 0.40905940254265843, Eot_aliased_angles.mean_obliquity_of_ecliptic() )
91
- end
92
-
93
- it 'expected 0.40901870461547685 returned by Eot_aliased_angles.obliquity_correction()? ' do
94
- assert_equal( 0.40901870461547685, Eot_aliased_angles.obliquity_correction() )
95
- end
96
-
97
- it 'expected 2.5297411654316497 returned by Eot_aliased_angles.right_ascension()? ' do
98
- assert_equal( 2.5297411654316497, Eot_aliased_angles.right_ascension() )
99
- end
100
-
101
- it 'expected 0.6074784519729512 returned by Eot_aliased_angles.sine_apparent_longitude()? ' do
102
- assert_equal( 0.6074784519729512, Eot_aliased_angles.sine_apparent_longitude() )
103
- end
104
-
105
- it 'expected 0.6074246812917259 returned by Eot_aliased_angles.sine_true_longitude()? ' do
106
- assert_equal( 0.6074246812917259, Eot_aliased_angles.sine_true_longitude() )
107
- end
108
-
109
- it 'expected 3.8293871468831893 returned by Eot_aliased_angles.true_anomaly()? ' do
110
- assert_equal( 3.8293871468831893, Eot_aliased_angles.true_anomaly() )
111
- end
112
-
113
- it 'expected 2.48877803069344 returned by Eot_aliased_angles.true_longitude()? ' do
114
- assert_equal( 2.48877803069344, Eot_aliased_angles.true_longitude() )
115
- end
116
-
117
- it 'expected 2.5101242776531474 returned by Eot_aliased_angles.true_longitude_aries()? ' do
118
- assert_equal( 2.5101242776531474, Eot_aliased_angles.true_longitude_aries() )
119
- end
120
-
121
- it 'expected 0.40901870461547685 returned by Eot_aliased_angles.true_obliquity()? ' do
122
- assert_equal( 0.40901870461547685, Eot_aliased_angles.true_obliquity() )
123
- end
124
- end
125
-
126
- describe 'tests ajd of 2455055.5' do
127
-
128
- before(:each) do
129
- Eot_aliased_angles.ajd = 2455055.0
130
- ajd = Eot_aliased_angles.ajd
131
- # check date for this ajd when needed.
132
- Eot_aliased_angles.date = Eot_aliased_angles.ajd_to_datetime(ajd)
133
- end
134
-
135
- it 'expected 455055.0, returned by Eot_aliased_angles.' do
136
- assert_equal( 2455055.0, Eot_aliased_angles.ajd )
137
- end
138
-
139
- it 'expected "2009-08-11T12:00:00+00:00", returned by Eot_aliased_angles.date.to_s' do
140
- assert_equal( "2009-08-11T12:00:00+00:00", Eot_aliased_angles.date.to_s )
141
- end
142
-
143
- it 'expected 3.7871218188949207, returned by Eot_aliased_angles.ma' do
144
- assert_equal( 3.7871218188949207, Eot_aliased_angles.ma )
145
- end
146
-
147
- it 'expected 3.7871218188949207 Eot_aliased_angles.ma returned by Eot_angles.mean_anomaly()' do
148
- assert_equal( 3.7871218188949207, Eot_aliased_angles.mean_anomaly() )
149
- end
150
-
151
- it 'expected 2.4252140645725033 returned by Eot_aliased_angles.apparent_longitude()? ' do
152
- assert_equal( 2.4252140645725033, Eot_aliased_angles.apparent_longitude() )
153
- end
154
-
155
- it 'expected -0.7541886969975007 returned by Eot_aliased_angles.cosine_apparent_longitude()? ' do
156
- assert_equal( -0.7541886969975007, Eot_aliased_angles.cosine_apparent_longitude() )
157
- end
158
-
159
- it 'expected -0.7542060769936684 returned by Eot_aliased_angles.cosine_true_longitude()? ' do
160
- assert_equal( -0.7542060769936684, Eot_aliased_angles.cosine_true_longitude() )
161
- end
162
-
163
- it 'expected 0.9174818088112336 returned by Eot_aliased_angles.cosine_true_obliquity()? ' do
164
- assert_equal( 0.9174818088112336, Eot_aliased_angles.cosine_true_obliquity() )
165
- end
166
-
167
- it 'expected 0.26426912722944046 returned by Eot_aliased_angles.declination()? ' do
168
- assert_equal( 0.26426912722944046, Eot_aliased_angles.declination() )
169
- end
170
-
171
- it 'expected -0.04234904897476355 returned by Eot_aliased_angles.delta_t_ecliptic()? ' do
172
- assert_equal( -0.04234904897476355, Eot_aliased_angles.delta_t_ecliptic() )
173
- end
174
-
175
- it 'expected 0.019768413456709766 returned by Eot_aliased_angles.delta_t_elliptic()? ' do
176
- assert_equal( 0.019768413456709766, Eot_aliased_angles.delta_t_elliptic() )
177
- end
178
-
179
- it 'expected 0.016704576164208475 returned by Eot_aliased_angles.eccentricity_earth_orbit()? ' do
180
- assert_equal( 0.016704576164208475, Eot_aliased_angles.eccentricity_earth_orbit() )
181
- end
182
-
183
- it 'expected -0.019768413456709915 returned by Eot_aliased_angles.equation_of_center()? ' do
184
- assert_equal( -0.019768413456709915, Eot_aliased_angles.equation_of_center() )
185
- end
186
-
187
- it 'expected 2.445008945789877 returned by Eot_aliased_angles.geometric_mean_longitude()? ' do
188
- assert_equal( 2.445008945789877, Eot_aliased_angles.geometric_mean_longitude() )
189
- end
190
-
191
- it 'expected 1.9434600427973594 returned by Eot_aliased_angles.horizon_angle()? ' do
192
- assert_equal( 1.9434600427973594, Eot_aliased_angles.horizon_angle() )
193
- end
194
-
195
- it 'expected 3.7871218188949207 returned by Eot_aliased_angles.mean_anomaly()? ' do
196
- assert_equal( 3.7871218188949207, Eot_aliased_angles.mean_anomaly() )
197
- end
198
-
199
- it 'expected 2.444907382260759 returned by Eot_aliased_angles.mean_longitude_aries()? ' do
200
- assert_equal( 2.444907382260759, Eot_aliased_angles.mean_longitude_aries() )
201
- end
202
-
203
- it 'expected 0.4090707793981491 returned by Eot_aliased_angles.mean_obliquity()? ' do
204
- assert_equal( 0.4090707793981491, Eot_aliased_angles.mean_obliquity() )
205
- end
206
-
207
- it 'expected 0.4090934409048494 returned by Eot_aliased_angles.obliquity_correction()? ' do
208
- assert_equal( 0.4090934409048494, Eot_aliased_angles.obliquity_correction() )
209
- end
210
-
211
- it 'expected 2.467563113547267 returned by Eot_aliased_angles.right_ascension()? ' do
212
- assert_equal( 2.467563113547267, Eot_aliased_angles.right_ascension() )
213
- end
214
-
215
- it 'expected 0.6566577566139093 returned by Eot_aliased_angles.sine_apparent_longitude()? ' do
216
- assert_equal( 0.6566577566139093, Eot_aliased_angles.sine_apparent_longitude() )
217
- end
218
-
219
- it 'expected 0.6566377946979757 returned by Eot_aliased_angles.sine_true_longitude()? ' do
220
- assert_equal( 0.6566377946979757, Eot_aliased_angles.sine_true_longitude() )
221
- end
222
-
223
- it 'expected 3.767353405438211 returned by Eot_aliased_angles.true_anomaly()? ' do
224
- assert_equal( 3.767353405438211, Eot_aliased_angles.true_anomaly() )
225
- end
226
-
227
- it 'expected 2.4252405323331674 returned by Eot_aliased_angles.true_longitude()? ' do
228
- assert_equal( 2.4252405323331674, Eot_aliased_angles.true_longitude() )
229
- end
230
-
231
- it 'expected 2.4449774607872907 returned by Eot_aliased_angles.true_longitude_aries()? ' do
232
- assert_equal( 2.4449774607872907, Eot_aliased_angles.true_longitude_aries() )
233
- end
234
-
235
- it 'expected 0.4090934409048494 returned by Eot_aliased_angles.true_obliquity()? ' do
236
- assert_equal( 0.4090934409048494, Eot_aliased_angles.true_obliquity() )
237
- end
238
-
239
- end
@@ -1,105 +0,0 @@
1
- # aliased_displays_spec.rb
2
- #
3
-
4
- require_relative 'spec_config'
5
-
6
- lib = File.expand_path('../../../lib', __FILE__)
7
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
8
- require 'eot'
9
-
10
- Eot_aliased_displays = Eot.new
11
-
12
- describe 'Eot_aliased_displays using ajd of 2456885.0' do
13
-
14
- before(:each) do
15
- Eot_aliased_displays.ajd = 2456885.0
16
- ajd = Eot_aliased_displays.ajd
17
- # check date for this ajd when needed.
18
- Eot_aliased_displays.date = Eot_aliased_displays.ajd_to_datetime(ajd)
19
-
20
- end
21
-
22
- it 'expected 2456885.0 , returned by Eot_aliased_displays.' do
23
- assert_equal 2456885.0, Eot_aliased_displays.ajd
24
- end
25
-
26
- it 'expected "2014-08-15T12:00:00+00:00", returned by Eot_aliased_displays.date.to_s' do
27
- assert_equal "2014-08-15T12:00:00+00:00", Eot_aliased_displays.date.to_s
28
- end
29
-
30
- it 'expected 3.8508003966038915, returned by Eot_aliased_displays.' do
31
- assert_equal 3.8508003966038915, Eot_aliased_displays.ma
32
- end
33
-
34
- it 'expected "+142:35:33.356" returned by Eot_aliased_displays.apparent_longitude_string()? ' do
35
- assert_equal "+142:35:33.356", Eot_aliased_displays.apparent_longitude_string()
36
- end
37
-
38
- it 'expected "+013:58:51.521" returned by Eot_aliased_displays.declination_string()? ' do
39
- assert_equal "+013:58:51.521", Eot_aliased_displays.declination_string()
40
- end
41
-
42
- it 'expected "-04m, 29.2s" returned by Eot_aliased_displays.display_equation_of_time()? ' do
43
- assert_equal "-04m, 29.2s", Eot_aliased_displays.display_equation_of_time()
44
- end
45
-
46
- it 'expected "12:00:00.000" returned by Eot_aliased_displays.display_time_string()? ' do
47
- assert_equal "12:00:00.000", Eot_aliased_displays.display_time_string()
48
- assert_equal "12:00:00.000", Eot_aliased_displays.display_time_string(nil)
49
- assert_equal "12:00:00.000", Eot_aliased_displays.display_time_string(0)
50
- end
51
-
52
- it 'expected "12:00:00.000" returned by Eot_aliased_displays.display_time_string(Eot_aliased_displays.date)? ' do
53
- assert_equal "12:00:00.000", Eot_aliased_displays.display_time_string(Eot_aliased_displays.date)
54
- end
55
-
56
- it 'expected "2000-01-01" returned by Eot_aliased_displays.jd_to_date_string()? ' do
57
- assert_equal "2000-01-01", Eot_aliased_displays.jd_to_date_string()
58
- assert_equal "2000-01-01", Eot_aliased_displays.jd_to_date_string(nil)
59
- assert_equal "2000-01-01", Eot_aliased_displays.jd_to_date_string(0)
60
- end
61
-
62
- it 'expected "2014-08-15" returned by Eot_aliased_displays.jd_to_date_string(Eot_aliased_displays.ajd)? ' do
63
- assert_equal "2014-08-15", Eot_aliased_displays.jd_to_date_string(Eot_aliased_displays.ajd)
64
- end
65
-
66
- it 'expected "12:00:00" returned by Eot_aliased_displays.julian_period_day_fraction_to_time()? ' do
67
- assert_equal "12:00:00", Eot_aliased_displays.julian_period_day_fraction_to_time()
68
- assert_equal "12:00:00", Eot_aliased_displays.julian_period_day_fraction_to_time(nil)
69
- assert_equal "12:00:00", Eot_aliased_displays.julian_period_day_fraction_to_time(0)
70
- end
71
-
72
- it 'expected "+220:38:04.597" returned by Eot_aliased_displays.mean_anomaly_string()? ' do
73
- assert_equal "+220:38:04.597", Eot_aliased_displays.mean_anomaly_string()
74
- end
75
-
76
- it 'expected "+144:56:36.571" returned by Eot_aliased_displays.right_ascension_string()? ' do
77
- assert_equal "+144:56:36.571", Eot_aliased_displays.right_ascension_string()
78
- end
79
-
80
- it 'expected "+219:24:27.797" returned by Eot_aliased_displays.true_anomaly_string()? ' do
81
- assert_equal "+219:24:27.797", Eot_aliased_displays.true_anomaly_string()
82
- end
83
-
84
- it 'expected "+142:35:47.3184" returned by Eot_aliased_displays.true_longitude_string()? ' do
85
- assert_equal "+142:35:47.318", Eot_aliased_displays.true_longitude_string()
86
- end
87
-
88
- it 'expected "+023:26:06.163" returned by Eot_aliased_displays.true_obliquity_string()? ' do
89
- assert_equal "+023:26:06.163", Eot_aliased_displays.true_obliquity_string()
90
- end
91
-
92
- end
93
-
94
- describe 'Eot aliased displays explicit values' do
95
-
96
- it 'expected "16:40:40.800" returned by Eot_aliased_displays.display_time_string(16.6780)? ' do
97
- assert_equal "16:40:40.800", Eot_aliased_displays.display_time_string(16.6780)
98
- end
99
-
100
- it 'expected "17:59:16.800" returned by Eot_aliased_displays.display_time_string(17988)? ' do
101
- Eot_aliased_displays.date = Date.today.to_s
102
- assert_equal "17:59:16.800", Eot_aliased_displays.display_time_string(17.988)
103
- end
104
-
105
- end
data/test/angles_spec.rb DELETED
@@ -1,264 +0,0 @@
1
- # angles_spec.rb
2
- #
3
-
4
- require_relative 'spec_config'
5
-
6
- lib = File.expand_path('../../../lib', __FILE__)
7
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
8
- require 'eot'
9
-
10
- Eot_angles = Eot.new
11
-
12
- describe 'Tests ajd of 2456885.0' do
13
-
14
- before(:each) do
15
- Eot_angles.ajd = 2456885.0
16
- ajd = Eot_angles.ajd
17
- # check date for this ajd when needed.
18
- Eot_angles.date = Eot_angles.ajd_to_datetime(ajd)
19
- end
20
-
21
- it 'expected 2456885.0 for Eot_angles.ajd'do
22
- assert_equal( 2456885.0, Eot_angles.ajd )
23
- end
24
-
25
- it 'expected "2014-08-15T12:00:00+00:00" for Eot_angles.date'.to_s do
26
- assert_equal( "2014-08-15T12:00:00+00:00", Eot_angles.date.to_s )
27
- end
28
-
29
- it 'expected 3.8508003966038915 for Eot_angles.ma'do
30
- assert_equal( 3.8508003966038915, Eot_angles.ma )
31
- end
32
-
33
- it 'expected 2.4887103398436143 from Eot_angles.al_Sun()? ' do
34
- assert_equal( 2.4887103398436143, Eot_angles.al_Sun() )
35
- end
36
-
37
- it 'expected -0.021413249720702462 from Eot_angles.centre()? ' do
38
- assert_equal( -0.021413249720702462, Eot_angles.center() )
39
- end
40
-
41
- it 'expected -0.7943361570447028 from Eot_angles.cosine_al_Sun()? ' do
42
- assert_equal( -0.7943361570447028, Eot_angles.cosine_al_Sun() )
43
- end
44
-
45
- it 'expected -0.7943772759574919 from Eot_angles.cosine_tl_Sun()? ' do
46
- assert_equal( -0.7943772759574919, Eot_angles.cosine_tl_Sun() )
47
- end
48
-
49
- it 'expected 0.9175115346811911 from Eot_angles.cosine_to_Earth()? ' do
50
- assert_equal( 0.9175115346811911, Eot_angles.cosine_to_Earth() )
51
- end
52
-
53
- it 'expected 0.24401410218543554 from Eot_angles.dec_Sun()? ' do
54
- assert_equal( 0.24401410218543554, Eot_angles.dec_Sun() )
55
- end
56
-
57
- it 'expected -4.069792718159396e-05 from Eot_angles.delta_epsilon()? ' do
58
- assert_equal( -4.069792718159396e-05, Eot_angles.delta_epsilon() )
59
- end
60
-
61
- it 'expected -0.04103082558803539 from Eot_angles.delta_oblique()? ' do
62
- assert_equal( -0.04103082558803539, Eot_angles.delta_oblique() )
63
- end
64
-
65
- it 'expected 0.021413249720702243 from Eot_angles.delta_orbit()? ' do
66
- assert_equal( 0.021413249720702243, Eot_angles.delta_orbit() )
67
- end
68
-
69
- it 'expected 3.75123821843003e-05 from Eot_angles.delta_psi()? ' do
70
- assert_equal( 3.75123821843003e-05, Eot_angles.delta_psi() )
71
- end
72
-
73
- it 'expected 0.016702468499021204 from Eot_angles.eccentricity_Earth()? ' do
74
- assert_equal( 0.016702468499021204, Eot_angles.eccentricity_Earth() )
75
- end
76
-
77
- it 'expected 3.441804334746474e-05 from Eot_angles.eq_of_equinox()? ' do
78
- assert_equal( 3.441804334746474e-05, Eot_angles.eq_of_equinox() )
79
- end
80
-
81
- it 'expected -0.019617575867333148 from Eot_angles.eot()? ' do
82
- assert_equal( -0.019617575867333148, Eot_angles.eot() )
83
- end
84
-
85
- it 'expected 2.5101912804141424 from Eot_angles.gml_Sun()? ' do
86
- assert_equal( 2.5101912804141424, Eot_angles.gml_Sun() )
87
- end
88
-
89
- it 'expected 1.9143229567859146 from Eot_angles.ha_Sun()? ' do
90
- assert_equal( 1.9143229567859146, Eot_angles.ha_Sun() )
91
- end
92
-
93
- it 'expected 3.8508003966038915 from Eot_angles.ma_Sun()? ' do
94
- assert_equal( 3.8508003966038915, Eot_angles.ma_Sun( ) )
95
- end
96
-
97
- it 'expected 2.510089864980358 from Eot_angles.ml_Aries()? ' do
98
- assert_equal( 2.510089864980358, Eot_angles.ml_Aries() )
99
- end
100
-
101
- it 'expected 0.40905940254265843 from Eot_angles.mo_Earth()? ' do
102
- assert_equal( 0.40905940254265843, Eot_angles.mo_Earth() )
103
- end
104
-
105
- it 'expected -2.7528817371494685 from Eot_angles.omega()? ' do
106
- assert_equal( -2.7528817371494685, Eot_angles.omega() )
107
- end
108
-
109
- it 'expected 2.5297411654316497 from Eot_angles.ra_Sun()? ' do
110
- assert_equal( 2.5297411654316497, Eot_angles.ra_Sun() )
111
- end
112
-
113
- it 'expected 0.6074784519729512 from Eot_angles.sine_al_Sun()? ' do
114
- assert_equal( 0.6074784519729512, Eot_angles.sine_al_Sun() )
115
- end
116
-
117
- it 'expected 0.6074246812917259 from Eot_angles.sine_tl_Sun()? ' do
118
- assert_equal( 0.6074246812917259, Eot_angles.sine_tl_Sun() )
119
- end
120
-
121
- it 'expected 3.8293871468831893 from Eot_angles.ta_Sun()? ' do
122
- assert_equal( 3.8293871468831893, Eot_angles.ta_Sun() )
123
- end
124
-
125
- it 'expected 2.5101242776531474 from Eot_angles.tl_Aries()? ' do
126
- assert_equal( 2.5101242776531474, Eot_angles.tl_Aries() )
127
- end
128
-
129
- it 'expected 2.48877803069344 from Eot_angles.tl_Sun()? ' do
130
- assert_equal( 2.48877803069344, Eot_angles.tl_Sun() )
131
- end
132
-
133
- it 'expected 0.40901870461547685 from Eot_angles.to_Earth()? ' do
134
- assert_equal( 0.40901870461547685, Eot_angles.to_Earth() )
135
- end
136
- end
137
-
138
-
139
-
140
- describe 'Tests ajd of 2455055.5 ' do
141
-
142
- before(:each) do
143
- Eot_angles.ajd = 2455055.0
144
- ajd = Eot_angles.ajd
145
- # check date for this ajd when needed.
146
- Eot_angles.date = Eot_angles.ajd_to_datetime(ajd)
147
- end
148
-
149
- it 'expected 2455055.0, from Eot_angles.' do
150
- assert_equal( 2455055.0, Eot_angles.ajd )
151
- end
152
-
153
- it 'expected "2009-08-11T12:00:00+00:00", from Eot_angles.date.to_s' do
154
- assert_equal( "2009-08-11T12:00:00+00:00", Eot_angles.date.to_s )
155
- end
156
-
157
- it 'expected 3.7871218188949207, from Eot_angles.' do
158
- assert_equal( 3.7871218188949207, Eot_angles.ma )
159
- end
160
-
161
- it 'expected 2.4252140645725033 from Eot_angles.al_Sun()? ' do
162
- assert_equal( 2.4252140645725033, Eot_angles.al_Sun() )
163
- end
164
-
165
- it 'expected -0.019768413456709915 from Eot_angles.center()? ' do
166
- assert_equal( -0.019768413456709915, Eot_angles.center() )
167
- end
168
-
169
- it 'expected -0.7541886969975007 from Eot_angles.cosine_al_Sun()? ' do
170
- assert_equal( -0.7541886969975007, Eot_angles.cosine_al_Sun() )
171
- end
172
-
173
- it 'expected -0.7542060769936684 from Eot_angles.cosine_tl_Sun()? ' do
174
- assert_equal( -0.7542060769936684, Eot_angles.cosine_tl_Sun() )
175
- end
176
-
177
- it 'expected 0.9174818088112336 from Eot_angles.cosine_to_Earth()? ' do
178
- assert_equal( 0.9174818088112336, Eot_angles.cosine_to_Earth() )
179
- end
180
-
181
- it 'expected 0.26426912722944046 from Eot_angles.dec_Sun()? ' do
182
- assert_equal( 0.26426912722944046, Eot_angles.dec_Sun() )
183
- end
184
-
185
- it 'expected 2.2661506700250296e-05 from Eot_angles.delta_epsilon()? ' do
186
- assert_equal( 2.2661506700250296e-05, Eot_angles.delta_epsilon() )
187
- end
188
-
189
- it 'expected -0.04234904897476355 from Eot_angles.delta_oblique()? ' do
190
- assert_equal( -0.04234904897476355, Eot_angles.delta_oblique() )
191
- end
192
-
193
- it 'expected 0.019768413456709766 from Eot_angles.delta_orbit()? ' do
194
- assert_equal( 0.019768413456709766, Eot_angles.delta_orbit() )
195
- end
196
-
197
- it 'expected 7.639341522992976e-05 from Eot_angles.delta_psi()? ' do
198
- assert_equal( 7.639341522992976e-05, Eot_angles.delta_psi() )
199
- end
200
-
201
- it 'expected 0.016704576164208475 from Eot_angles.eccentricity_Earth()? ' do
202
- assert_equal( 0.016704576164208475, Eot_angles.eccentricity_Earth() )
203
- end
204
-
205
- it 'expected 7.00895687864236e-05 from Eot_angles.eq_of_equinox()? ' do
206
- assert_equal( 7.00895687864236e-05, Eot_angles.eq_of_equinox() )
207
- end
208
-
209
- it 'expected -0.022580635518053782 from Eot_angles.eot()? ' do
210
- assert_equal( -0.022580635518053782, Eot_angles.eot() )
211
- end
212
-
213
- it 'expected 2.445008945789877 from Eot_angles.gml_Sun()? ' do
214
- assert_equal( 2.445008945789877, Eot_angles.gml_Sun() )
215
- end
216
-
217
- it 'expected 1.9434600427973594 from Eot_angles.ha_Sun()? ' do
218
- assert_equal( 1.9434600427973594, Eot_angles.ha_Sun() )
219
- end
220
-
221
- it 'expected 3.7871218188949207 from Eot_angles.ma_Sun()? ' do
222
- assert_equal( 3.7871218188949207, Eot_angles.ma_Sun() )
223
- end
224
-
225
- it 'expected 2.444907382260759 from Eot_angles.ml_Aries()? ' do
226
- assert_equal( 2.444907382260759, Eot_angles.ml_Aries() )
227
- end
228
-
229
- it 'expected 0.4090707793981491 from Eot_angles.mo_Earth()? ' do
230
- assert_equal( 0.4090707793981491, Eot_angles.mo_Earth() )
231
- end
232
-
233
- it 'expected -1.0615640635268548 from Eot_angles.omega()? ' do
234
- assert_equal( -1.0615640635268548, Eot_angles.omega() )
235
- end
236
-
237
- it 'expected 2.467563113547267 from Eot_angles.ra_Sun()? ' do
238
- assert_equal( 2.467563113547267, Eot_angles.ra_Sun() )
239
- end
240
-
241
- it 'expected 0.6566577566139093 from Eot_angles.sine_al_Sun()? ' do
242
- assert_equal( 0.6566577566139093, Eot_angles.sine_al_Sun() )
243
- end
244
-
245
- it 'expected 0.6566377946979757 from Eot_angles.sine_tl_Sun()? ' do
246
- assert_equal( 0.6566377946979757, Eot_angles.sine_tl_Sun() )
247
- end
248
-
249
- it 'expected 3.767353405438211 from Eot_angles.ta_Sun()? ' do
250
- assert_equal( 3.767353405438211, Eot_angles.ta_Sun() )
251
- end
252
-
253
- it 'expected 2.4449774607872907 from Eot_angles.tl_Aries()? ' do
254
- assert_equal( 2.4449774607872907, Eot_angles.tl_Aries() )
255
- end
256
-
257
- it 'expected 2.4252405323331674 from Eot_angles.tl_Sun()? ' do
258
- assert_equal( 2.4252405323331674, Eot_angles.tl_Sun() )
259
- end
260
-
261
- it 'expected 0.4090934409048494 from Eot_angles.to_Earth()? ' do
262
- assert_equal( 0.4090934409048494, Eot_angles.to_Earth() )
263
- end
264
- end