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.
- checksums.yaml +4 -4
- data/.gitignore +8 -3
- data/Gemfile.lock +48 -0
- data/README.md +22 -19
- data/Rakefile +14 -7
- data/equationoftime.gemspec +9 -6
- data/ext/ceot/ceot.c +52 -0
- data/ext/ceot/eot.c +79 -0
- data/ext/ceot/eot.h +8 -0
- data/ext/ceot/extconf.rb +5 -0
- data/lib/eot.rb +2 -1
- data/lib/eot/angles.rb +44 -43
- data/lib/eot/init.rb +13 -6
- data/lib/eot/version.rb +1 -1
- data/wiki.md +6 -7
- metadata +26 -255
- data/.settings/org.eclipse.ltk.core.refactoring.prefs +0 -2
- data/Makefile +0 -238
- data/analemma_data.yml +0 -2925
- data/examples/Equation_of_Time.jpg +0 -0
- data/examples/analemma_data_generator.rb +0 -53
- data/examples/celes_parts/.RUBYARCHDIR.time +0 -0
- data/examples/celes_parts/.cproject +0 -56
- data/examples/celes_parts/.project +0 -78
- data/examples/celes_parts/a2af.c +0 -120
- data/examples/celes_parts/a2tf.c +0 -116
- data/examples/celes_parts/af2a.c +0 -107
- data/examples/celes_parts/anp.c +0 -82
- data/examples/celes_parts/anpm.c +0 -82
- data/examples/celes_parts/bi00.c +0 -116
- data/examples/celes_parts/bp00.c +0 -173
- data/examples/celes_parts/bp06.c +0 -136
- data/examples/celes_parts/bpn2xy.c +0 -100
- data/examples/celes_parts/c2i00a.c +0 -139
- data/examples/celes_parts/c2i00b.c +0 -139
- data/examples/celes_parts/c2i06a.c +0 -136
- data/examples/celes_parts/c2ibpn.c +0 -142
- data/examples/celes_parts/c2ixy.c +0 -131
- data/examples/celes_parts/c2ixys.c +0 -123
- data/examples/celes_parts/c2s.c +0 -96
- data/examples/celes_parts/c2t00a.c +0 -154
- data/examples/celes_parts/c2t00b.c +0 -150
- data/examples/celes_parts/c2t06a.c +0 -152
- data/examples/celes_parts/c2tcio.c +0 -122
- data/examples/celes_parts/c2teqx.c +0 -122
- data/examples/celes_parts/c2tpe.c +0 -167
- data/examples/celes_parts/c2txy.c +0 -159
- data/examples/celes_parts/cal2jd.c +0 -139
- data/examples/celes_parts/celes_core.c +0 -2522
- data/examples/celes_parts/cp.c +0 -80
- data/examples/celes_parts/cpv.c +0 -82
- data/examples/celes_parts/cr.c +0 -83
- data/examples/celes_parts/d2dtf.c +0 -206
- data/examples/celes_parts/d2tf.c +0 -160
- data/examples/celes_parts/dat.c +0 -289
- data/examples/celes_parts/depend +0 -25
- data/examples/celes_parts/dtdb.c +0 -1213
- data/examples/celes_parts/dtf2d.c +0 -196
- data/examples/celes_parts/ee00.c +0 -128
- data/examples/celes_parts/ee00a.c +0 -135
- data/examples/celes_parts/ee00b.c +0 -141
- data/examples/celes_parts/ee06a.c +0 -122
- data/examples/celes_parts/eect00.c +0 -282
- data/examples/celes_parts/eform.c +0 -147
- data/examples/celes_parts/eo06a.c +0 -131
- data/examples/celes_parts/eors.c +0 -108
- data/examples/celes_parts/epb.c +0 -96
- data/examples/celes_parts/epb2jd.c +0 -91
- data/examples/celes_parts/epj.c +0 -93
- data/examples/celes_parts/epj2jd.c +0 -91
- data/examples/celes_parts/epv00.c +0 -2589
- data/examples/celes_parts/eqeq94.c +0 -131
- data/examples/celes_parts/era00.c +0 -136
- data/examples/celes_parts/extconf.rb +0 -4
- data/examples/celes_parts/fad03.c +0 -103
- data/examples/celes_parts/fae03.c +0 -102
- data/examples/celes_parts/faf03.c +0 -106
- data/examples/celes_parts/faju03.c +0 -102
- data/examples/celes_parts/fal03.c +0 -103
- data/examples/celes_parts/falp03.c +0 -103
- data/examples/celes_parts/fama03.c +0 -102
- data/examples/celes_parts/fame03.c +0 -102
- data/examples/celes_parts/fane03.c +0 -99
- data/examples/celes_parts/faom03.c +0 -104
- data/examples/celes_parts/fapa03.c +0 -103
- data/examples/celes_parts/fasa03.c +0 -102
- data/examples/celes_parts/faur03.c +0 -99
- data/examples/celes_parts/fave03.c +0 -102
- data/examples/celes_parts/fk52h.c +0 -143
- data/examples/celes_parts/fk5hip.c +0 -126
- data/examples/celes_parts/fk5hz.c +0 -160
- data/examples/celes_parts/fw2m.c +0 -134
- data/examples/celes_parts/fw2xy.c +0 -120
- data/examples/celes_parts/gc2gd.c +0 -134
- data/examples/celes_parts/gc2gde.c +0 -200
- data/examples/celes_parts/gd2gc.c +0 -134
- data/examples/celes_parts/gd2gce.c +0 -138
- data/examples/celes_parts/gmst00.c +0 -145
- data/examples/celes_parts/gmst06.c +0 -136
- data/examples/celes_parts/gmst82.c +0 -151
- data/examples/celes_parts/gst00a.c +0 -138
- data/examples/celes_parts/gst00b.c +0 -146
- data/examples/celes_parts/gst06.c +0 -140
- data/examples/celes_parts/gst06a.c +0 -131
- data/examples/celes_parts/gst94.c +0 -131
- data/examples/celes_parts/h2fk5.c +0 -148
- data/examples/celes_parts/hfk5z.c +0 -175
- data/examples/celes_parts/ir.c +0 -83
- data/examples/celes_parts/jd2cal.c +0 -155
- data/examples/celes_parts/jdcalf.c +0 -161
- data/examples/celes_parts/num00a.c +0 -121
- data/examples/celes_parts/num00b.c +0 -121
- data/examples/celes_parts/num06a.c +0 -125
- data/examples/celes_parts/numat.c +0 -109
- data/examples/celes_parts/nut00a.c +0 -2047
- data/examples/celes_parts/nut00b.c +0 -372
- data/examples/celes_parts/nut06a.c +0 -153
- data/examples/celes_parts/nut80.c +0 -325
- data/examples/celes_parts/nutm80.c +0 -117
- data/examples/celes_parts/obl06.c +0 -118
- data/examples/celes_parts/obl80.c +0 -118
- data/examples/celes_parts/p06e.c +0 -321
- data/examples/celes_parts/p2pv.c +0 -83
- data/examples/celes_parts/p2s.c +0 -91
- data/examples/celes_parts/pap.c +0 -139
- data/examples/celes_parts/pas.c +0 -96
- data/examples/celes_parts/pb06.c +0 -144
- data/examples/celes_parts/pdp.c +0 -84
- data/examples/celes_parts/pfw06.c +0 -165
- data/examples/celes_parts/plan94.c +0 -514
- data/examples/celes_parts/pm.c +0 -83
- data/examples/celes_parts/pmat00.c +0 -118
- data/examples/celes_parts/pmat06.c +0 -122
- data/examples/celes_parts/pmat76.c +0 -141
- data/examples/celes_parts/pmp.c +0 -85
- data/examples/celes_parts/pn.c +0 -109
- data/examples/celes_parts/pn00.c +0 -177
- data/examples/celes_parts/pn00a.c +0 -162
- data/examples/celes_parts/pn00b.c +0 -162
- data/examples/celes_parts/pn06.c +0 -187
- data/examples/celes_parts/pn06a.c +0 -152
- data/examples/celes_parts/pnm00a.c +0 -121
- data/examples/celes_parts/pnm00b.c +0 -121
- data/examples/celes_parts/pnm06a.c +0 -124
- data/examples/celes_parts/pnm80.c +0 -126
- data/examples/celes_parts/pom00.c +0 -115
- data/examples/celes_parts/ppp.c +0 -85
- data/examples/celes_parts/ppsp.c +0 -94
- data/examples/celes_parts/pr00.c +0 -142
- data/examples/celes_parts/prec76.c +0 -148
- data/examples/celes_parts/pv2p.c +0 -81
- data/examples/celes_parts/pv2s.c +0 -144
- data/examples/celes_parts/pvdpv.c +0 -102
- data/examples/celes_parts/pvm.c +0 -86
- data/examples/celes_parts/pvmpv.c +0 -87
- data/examples/celes_parts/pvppv.c +0 -87
- data/examples/celes_parts/pvstar.c +0 -207
- data/examples/celes_parts/pvu.c +0 -93
- data/examples/celes_parts/pvup.c +0 -88
- data/examples/celes_parts/pvxpv.c +0 -107
- data/examples/celes_parts/pxp.c +0 -94
- data/examples/celes_parts/rm2v.c +0 -111
- data/examples/celes_parts/rv2m.c +0 -118
- data/examples/celes_parts/rx.c +0 -110
- data/examples/celes_parts/rxp.c +0 -99
- data/examples/celes_parts/rxpv.c +0 -86
- data/examples/celes_parts/rxr.c +0 -99
- data/examples/celes_parts/ry.c +0 -110
- data/examples/celes_parts/rz.c +0 -110
- data/examples/celes_parts/s00.c +0 -371
- data/examples/celes_parts/s00a.c +0 -143
- data/examples/celes_parts/s00b.c +0 -143
- data/examples/celes_parts/s06.c +0 -368
- data/examples/celes_parts/s06a.c +0 -145
- data/examples/celes_parts/s2c.c +0 -85
- data/examples/celes_parts/s2p.c +0 -88
- data/examples/celes_parts/s2pv.c +0 -103
- data/examples/celes_parts/s2xpv.c +0 -87
- data/examples/celes_parts/sepp.c +0 -105
- data/examples/celes_parts/seps.c +0 -93
- data/examples/celes_parts/sofa.h +0 -379
- data/examples/celes_parts/sofam.h +0 -155
- data/examples/celes_parts/sp00.c +0 -118
- data/examples/celes_parts/starpm.c +0 -205
- data/examples/celes_parts/starpv.c +0 -264
- data/examples/celes_parts/sxp.c +0 -84
- data/examples/celes_parts/sxpv.c +0 -85
- data/examples/celes_parts/taitt.c +0 -110
- data/examples/celes_parts/taiut1.c +0 -112
- data/examples/celes_parts/taiutc.c +0 -182
- data/examples/celes_parts/tcbtdb.c +0 -132
- data/examples/celes_parts/tcgtt.c +0 -109
- data/examples/celes_parts/tdbtcb.c +0 -137
- data/examples/celes_parts/tdbtt.c +0 -122
- data/examples/celes_parts/test_celes.rb +0 -48
- data/examples/celes_parts/tf2a.c +0 -107
- data/examples/celes_parts/tf2d.c +0 -107
- data/examples/celes_parts/tr.c +0 -93
- data/examples/celes_parts/trxp.c +0 -93
- data/examples/celes_parts/trxpv.c +0 -93
- data/examples/celes_parts/tttai.c +0 -110
- data/examples/celes_parts/tttcg.c +0 -112
- data/examples/celes_parts/tttdb.c +0 -121
- data/examples/celes_parts/ttut1.c +0 -110
- data/examples/celes_parts/ut1tai.c +0 -111
- data/examples/celes_parts/ut1tt.c +0 -110
- data/examples/celes_parts/ut1utc.c +0 -193
- data/examples/celes_parts/utctai.c +0 -163
- data/examples/celes_parts/utcut1.c +0 -151
- data/examples/celes_parts/xy06.c +0 -2758
- data/examples/celes_parts/xys00a.c +0 -133
- data/examples/celes_parts/xys00b.c +0 -133
- data/examples/celes_parts/xys06a.c +0 -133
- data/examples/celes_parts/zp.c +0 -77
- data/examples/celes_parts/zpv.c +0 -79
- data/examples/celes_parts/zr.c +0 -83
- data/examples/check_date_type.rb +0 -55
- data/examples/compare_geoc_long_ra.rb +0 -39
- data/examples/data_table_for_astro_dog.rb +0 -40
- data/examples/earth_rotation.rb +0 -38
- data/examples/eot.c +0 -15
- data/examples/eot.h +0 -2
- data/examples/eot_methods_list.rb +0 -43
- data/examples/eot_plot.r +0 -57
- data/examples/eot_suntimes.rb +0 -144
- data/examples/equation_of_time.py +0 -186
- data/examples/extconf.rb +0 -2
- data/examples/figure_1.jpg +0 -0
- data/examples/file_converter.rb +0 -31
- data/examples/from_readme.rb +0 -10
- data/examples/geo_locator.rb +0 -12
- data/examples/getjd.rb +0 -45
- data/examples/gmst_gast_non_sofa.rb +0 -404
- data/examples/input_suntimes.rb +0 -21
- data/examples/julian_day_formula.rb +0 -29
- data/examples/julian_day_formula.txt +0 -12
- data/examples/my_time_conversion.rb +0 -21
- data/examples/nutation_series.txt +0 -678
- data/examples/nutation_series.yaml +0 -14239
- data/examples/nutation_table5_3a.txt +0 -682
- data/examples/nutation_table5_3a.yaml +0 -9532
- data/examples/ptime.rb +0 -162
- data/examples/rbeot.c +0 -24
- data/examples/suntimes.rb +0 -28
- data/examples/suntimes_test.rb +0 -47
- data/examples/test_eot.rb +0 -17
- data/examples/test_poly_eval.rb +0 -27
- data/examples/time_scales.rb +0 -26
- data/examples/times_year.rb +0 -50
- data/examples/usage_example.rb +0 -23
- data/examples/use_angles.rb +0 -219
- data/rise_set_data.yml +0 -1461
- data/tests/minitest/aliased_angles_spec.rb +0 -241
- data/tests/minitest/aliased_displays_spec.rb +0 -108
- data/tests/minitest/aliased_utilities_spec.rb +0 -38
- data/tests/minitest/angles_spec.rb +0 -266
- data/tests/minitest/constants_spec.rb +0 -21
- data/tests/minitest/delta_epsilon_spec.rb +0 -32
- data/tests/minitest/displays_spec.rb +0 -113
- data/tests/minitest/geo_spec.rb +0 -40
- data/tests/minitest/init_spec.rb +0 -46
- data/tests/minitest/nutation_spec.rb +0 -39
- data/tests/minitest/times_spec.rb +0 -139
- data/tests/minitest/utilities_spec.rb +0 -37
- data/tests/spec_config.rb +0 -3
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
# constants_spec.rb
|
|
2
|
-
#
|
|
3
|
-
# comment out next two lines and uncomment below for rpec tests.
|
|
4
|
-
gem 'minitest'
|
|
5
|
-
require 'minitest/autorun'
|
|
6
|
-
# require_relative '../spec_config'
|
|
7
|
-
|
|
8
|
-
lib = File.expand_path('../../../lib', __FILE__)
|
|
9
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
10
|
-
require 'eot'
|
|
11
|
-
|
|
12
|
-
describe "Equation of Time constants." do
|
|
13
|
-
|
|
14
|
-
it "01 require 'eot' should find all constants." do
|
|
15
|
-
assert_equal 24.0, Eot::DAY_HOURS
|
|
16
|
-
assert_equal 1440.0, Eot::DAY_MINUTES
|
|
17
|
-
assert_equal 86400.0, Eot::DAY_SECONDS
|
|
18
|
-
assert_equal 86400.0 * 1.0e+6, Eot::DAY_USECS
|
|
19
|
-
assert_equal 57.29577951308232, Eot::R2D
|
|
20
|
-
end
|
|
21
|
-
end
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
# delta_epsilon_spec.rb
|
|
2
|
-
#
|
|
3
|
-
# comment out next two lines and uncomment below for rpec tests.
|
|
4
|
-
gem 'minitest'
|
|
5
|
-
require 'minitest/autorun'
|
|
6
|
-
# require_relative '../spec_config'
|
|
7
|
-
|
|
8
|
-
lib = File.expand_path('../../../lib', __FILE__)
|
|
9
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
10
|
-
require 'eot'
|
|
11
|
-
|
|
12
|
-
Eot_first = Eot.new
|
|
13
|
-
|
|
14
|
-
describe 'set ajd to 2456885.0' do
|
|
15
|
-
|
|
16
|
-
before(:each) do
|
|
17
|
-
ajd = 2456885.0
|
|
18
|
-
Eot_first.ajd = ajd
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
it 'expected 2456885.0 for Eot_first.ajd' do
|
|
22
|
-
assert_equal 2456885.0, Eot_first.ajd
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
it 'expected 220.63461047270653 for Eot_first.ma' do
|
|
26
|
-
assert_equal 220.63461047270653, Eot_first.ma * Eot::R2D
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
it 'expected -0.0023318194624360874 returned by delta_epsilon()' do
|
|
30
|
-
assert_equal -0.0023318194624360874, Eot_first.delta_epsilon() * Eot::R2D
|
|
31
|
-
end
|
|
32
|
-
end
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
# displays_spec.rb
|
|
2
|
-
#
|
|
3
|
-
# comment out next two lines and uncomment below for rpec tests.
|
|
4
|
-
gem 'minitest'
|
|
5
|
-
require 'minitest/autorun'
|
|
6
|
-
# require_relative '../spec_config'
|
|
7
|
-
|
|
8
|
-
lib = File.expand_path('../../../lib', __FILE__)
|
|
9
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
10
|
-
require 'eot'
|
|
11
|
-
|
|
12
|
-
Eot_displays = Eot.new
|
|
13
|
-
|
|
14
|
-
describe 'Eot displays using ajd of 2456885.0' do
|
|
15
|
-
|
|
16
|
-
before(:each) do
|
|
17
|
-
ajd = 2456885.0
|
|
18
|
-
Eot_displays.ajd = ajd
|
|
19
|
-
|
|
20
|
-
# check date for this ajd when needed.
|
|
21
|
-
Eot_displays.date = Eot_displays.ajd_to_datetime(ajd)
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
it 'expected 2456885.0 for Eot_displays.ajd'do
|
|
25
|
-
assert_equal 2456885.0, Eot_displays.ajd
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
it 'expected "2014-08-15T12:00:00+00:00", returned by Eot_displays.date.to_s' do
|
|
29
|
-
assert_equal "2014-08-15T12:00:00+00:00", Eot_displays.date.to_s
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
it 'expected 220.63461047270653, returned by Eot_displays.' do
|
|
33
|
-
assert_equal 220.63461047270653, Eot_displays.ma * Eot::R2D
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
it 'expected "+000:00:00.000" returned by Eot_displays.degrees_to_s() ' do
|
|
37
|
-
assert_equal "+000:00:00.000", Eot_displays.degrees_to_s()
|
|
38
|
-
assert_equal "+000:00:00.000", Eot_displays.degrees_to_s(nil)
|
|
39
|
-
assert_equal "+000:00:00.000", Eot_displays.degrees_to_s(0)
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
it 'expected "+142:35:33.356" returned by Eot_displays.string_al_Sun() ' do
|
|
43
|
-
assert_equal "+142:35:33.356", Eot_displays.string_al_Sun()
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
it 'expected "12:00:00" returned by Eot_displays.string_day_fraction_to_time() ' do
|
|
47
|
-
assert_equal "12:00:00", Eot_displays.string_day_fraction_to_time()
|
|
48
|
-
assert_equal "12:00:00", Eot_displays.string_day_fraction_to_time(nil)
|
|
49
|
-
assert_equal "12:00:00", Eot_displays.string_day_fraction_to_time(0)
|
|
50
|
-
end
|
|
51
|
-
|
|
52
|
-
it 'expected "+013:58:51.521" returned by Eot_displays.string_dec_Sun() ' do
|
|
53
|
-
assert_equal "+013:58:51.521", Eot_displays.string_dec_Sun()
|
|
54
|
-
end
|
|
55
|
-
|
|
56
|
-
it 'expected "-04m, 28.9s" returned by Eot_displays.string_eot() ' do
|
|
57
|
-
assert_equal "-04m, 28.9s", Eot_displays.string_eot()
|
|
58
|
-
end
|
|
59
|
-
|
|
60
|
-
it 'expected "2000-01-01" returned by Eot_displays.string_jd_to_date() ' do
|
|
61
|
-
assert_equal "2000-01-01", Eot_displays.string_jd_to_date()
|
|
62
|
-
assert_equal "2000-01-01", Eot_displays.string_jd_to_date(nil)
|
|
63
|
-
assert_equal "2000-01-01", Eot_displays.string_jd_to_date(0)
|
|
64
|
-
end
|
|
65
|
-
|
|
66
|
-
it 'expected "2014-08-15" returned by Eot_displays.jd_to_date_string(Eot_displays.ajd)? ' do
|
|
67
|
-
assert_equal "2014-08-15", Eot_displays.jd_to_date_string(Eot_displays.ajd)
|
|
68
|
-
end
|
|
69
|
-
|
|
70
|
-
it 'expected "+220:38:04.597" returned by Eot_displays.string_ma_Sun() ' do
|
|
71
|
-
assert_equal "+220:38:04.597", Eot_displays.string_ma_Sun()
|
|
72
|
-
end
|
|
73
|
-
|
|
74
|
-
it 'expected "+144:56:36.571" returned by Eot_displays.string_ra_Sun() ' do
|
|
75
|
-
assert_equal "+144:56:36.571", Eot_displays.string_ra_Sun()
|
|
76
|
-
end
|
|
77
|
-
|
|
78
|
-
it 'expected "+219:24:27.797" returned by Eot_displays.string_ta_Sun() ' do
|
|
79
|
-
assert_equal "+219:24:27.797", Eot_displays.string_ta_Sun()
|
|
80
|
-
end
|
|
81
|
-
|
|
82
|
-
it 'expected "12:00:00.000" returned by Eot_displays.string_time() ' do
|
|
83
|
-
assert_equal "12:00:00.000", Eot_displays.string_time()
|
|
84
|
-
assert_equal "12:00:00.000", Eot_displays.string_time(nil)
|
|
85
|
-
assert_equal "12:00:00.000", Eot_displays.string_time(0)
|
|
86
|
-
end
|
|
87
|
-
|
|
88
|
-
it 'expected "12:00:00.000" returned by Eot_displays.display_time_string(Eot_adisplays.date)? ' do
|
|
89
|
-
assert_equal "12:00:00.000", Eot_displays.display_time_string(Eot_displays.date)
|
|
90
|
-
end
|
|
91
|
-
|
|
92
|
-
it 'expected "+142:35:47.318" returned by Eot_displays.string_tl_Sun() ' do
|
|
93
|
-
assert_equal "+142:35:47.318", Eot_displays.string_tl_Sun()
|
|
94
|
-
end
|
|
95
|
-
|
|
96
|
-
it 'expected "+023:26:06.163" returned by Eot_displays.string_to_Earth() ' do
|
|
97
|
-
assert_equal "+023:26:06.163", Eot_displays.string_to_Earth()
|
|
98
|
-
end
|
|
99
|
-
|
|
100
|
-
end
|
|
101
|
-
|
|
102
|
-
describe 'Eot displays explicit values' do
|
|
103
|
-
|
|
104
|
-
it 'expected "16:40:40.800" returned by Eot_displays.string_time(16.6780) ' do
|
|
105
|
-
assert_equal "16:40:40.800", Eot_displays.string_time(16.6780)
|
|
106
|
-
end
|
|
107
|
-
|
|
108
|
-
it 'expected "17:59:16.800" returned by Eot_displays.string_time(17988) ' do
|
|
109
|
-
Eot_displays.date= Date.today.to_s
|
|
110
|
-
assert_equal "17:59:16.800", Eot_displays.string_time(17.988)
|
|
111
|
-
end
|
|
112
|
-
|
|
113
|
-
end
|
data/tests/minitest/geo_spec.rb
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
# geo_spec.rb/
|
|
2
|
-
#
|
|
3
|
-
# comment out next two lines and uncomment below for rpec tests.
|
|
4
|
-
gem 'minitest'
|
|
5
|
-
require 'minitest/autorun'
|
|
6
|
-
# require_relative '../spec_config'
|
|
7
|
-
|
|
8
|
-
lib = File.expand_path('../../../lib', __FILE__)
|
|
9
|
-
$LOAD_PATH.unshift(lib)unless$LOAD_PATH.include?(lib)
|
|
10
|
-
require 'eot'
|
|
11
|
-
|
|
12
|
-
geo = GeoLatLng.new()
|
|
13
|
-
|
|
14
|
-
describe 'Geo defaults' do
|
|
15
|
-
|
|
16
|
-
it 'expected "Blackheath Ave, London SE10 8XJ, UK" 'do
|
|
17
|
-
assert_equal "Blackheath Ave, London SE10 8XJ, UK", geo.addr
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
it'expected "http://maps.googleapis.com/maps/api/geocode/xml?sensor=false&address="' do
|
|
21
|
-
assert_equal "http://maps.googleapis.com/maps/api/geocode/xml?sensor=false&address=", geo.base
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
it'expected "Blackheath Ave, London SE10 8XJ, UK" 'do
|
|
25
|
-
assert_equal "Blackheath Ave, London SE10 8XJ, UK", geo.default_int
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
it'expected "3333 Coyote Hill Road, Palo Alto, CA, 94304, USA" 'do
|
|
29
|
-
assert_equal "3333 Coyote Hill Road, Palo Alto, CA, 94304, USA", geo.default_us
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
it'expected 0.0'do
|
|
33
|
-
assert_equal 0.0, geo.lat
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
it'expected 0.0'do
|
|
37
|
-
assert_equal 0.0, geo.lng
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
end
|
data/tests/minitest/init_spec.rb
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
# init_spec.rb
|
|
2
|
-
#
|
|
3
|
-
# comment out next two lines and uncomment below for rpec tests.
|
|
4
|
-
gem 'minitest'
|
|
5
|
-
require 'minitest/autorun'
|
|
6
|
-
# require_relative '../spec_config'
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
lib = File.expand_path('../../../lib', __FILE__)
|
|
10
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
11
|
-
require 'eot'
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
describe 'Eot_initialize using today matchers' do
|
|
15
|
-
|
|
16
|
-
it 'expected DateTime.now.to_time.utc.to_datetime.jd.to_f' do
|
|
17
|
-
@test1 = Eot.new()
|
|
18
|
-
assert_equal DateTime.now.to_time.utc.to_datetime.jd.to_f, @test1.ajd
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
it 'expected 0.0' do
|
|
22
|
-
@test2 = Eot.new()
|
|
23
|
-
assert_equal 51.4769388, @test2.latitude
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
it 'expected 0.0' do
|
|
27
|
-
@test3 = Eot.new()
|
|
28
|
-
assert_equal -4.2e-05, @test3.longitude
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
it 'expected @test4.ma_Sun()' do
|
|
32
|
-
@test4 = Eot.new()
|
|
33
|
-
assert_equal @test4.ma_Sun(), @test4.ma
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
it 'expected (@test5.ajd - Eot::DJ00) / Eot::DJC' do
|
|
37
|
-
@test5 = Eot.new()
|
|
38
|
-
assert_equal (@test5.ajd - Eot::DJ00) / Eot::DJC, @test5.ta
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
it 'expected 0.0 returned by Eot_initialize.new() ' do
|
|
42
|
-
@test6 = Eot.new()
|
|
43
|
-
assert_equal "Blackheath Ave, London SE10 8XJ, UK", @test6.addr
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
end
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
# nutation_spec.rb
|
|
2
|
-
#
|
|
3
|
-
# comment out next two lines and uncomment below for rpec tests.
|
|
4
|
-
gem 'minitest'
|
|
5
|
-
require 'minitest/autorun'
|
|
6
|
-
# require_relative '../spec_config'
|
|
7
|
-
|
|
8
|
-
lib = File.expand_path('../../../lib', __FILE__)
|
|
9
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
10
|
-
require 'eot'
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
Eot_nutation = Eot.new
|
|
14
|
-
|
|
15
|
-
describe 'Eot_nutation using ajd of 2456885.0' do
|
|
16
|
-
|
|
17
|
-
before(:each) do
|
|
18
|
-
ajd = 2456885.0
|
|
19
|
-
Eot_nutation.ajd = ajd
|
|
20
|
-
Eot_nutation.date = Eot_nutation.ajd_to_datetime(ajd)
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
it 'expected 2456885.0 from Eot_nutation.ajd' do
|
|
24
|
-
assert_equal 2456885.0, Eot_nutation.ajd
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
it 'expected "2014-08-15T12:00:00+00:00" from Eot_nutation.date.to_s' do
|
|
28
|
-
assert_equal "2014-08-15T12:00:00+00:00", Eot_nutation.date.to_s
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
it 'expected 220.63461047270653 from Eot_nutation.ma' do
|
|
32
|
-
assert_equal 220.63461047270653, Eot_nutation.ma * Eot::R2D
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
it 'expected [3.75123821843003e-05, -4.069792718159396e-05] from Eot_nutation.delta_equinox()' do
|
|
36
|
-
assert_equal [3.75123821843003e-05, -4.069792718159396e-05], Eot_nutation.delta_equinox()
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
end
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
# times_spec.rb
|
|
2
|
-
#
|
|
3
|
-
# comment out next two lines and uncomment below for rpec tests.
|
|
4
|
-
gem 'minitest'
|
|
5
|
-
require 'minitest/autorun'
|
|
6
|
-
# require_relative '../spec_config'
|
|
7
|
-
|
|
8
|
-
lib = File.expand_path('../../../lib', __FILE__)
|
|
9
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
10
|
-
require 'eot'
|
|
11
|
-
|
|
12
|
-
Eot_times = Eot.new
|
|
13
|
-
|
|
14
|
-
describe 'tests ajd of 2456885.0' do
|
|
15
|
-
|
|
16
|
-
before(:each) do
|
|
17
|
-
ajd = 2456885.0
|
|
18
|
-
Eot_times.ajd = ajd
|
|
19
|
-
# check date for this ajd when needed.
|
|
20
|
-
Eot_times.date = Eot_times.ajd_to_datetime(ajd)
|
|
21
|
-
# use ta attribute as matcher
|
|
22
|
-
@ta = Eot_times.ta
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
it 'expected 2456885.0 for Eot_times.ajd'do
|
|
26
|
-
assert_equal 2456885.0, Eot_times.ajd
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
it 'expected "2014-08-15T12:00:00+00:00" for Eot_times.date'.to_s do
|
|
30
|
-
assert_equal "2014-08-15T12:00:00+00:00", Eot_times.date.to_s
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
it 'expected 220.63461047270653 for Eot_times.ma'do
|
|
34
|
-
assert_equal 220.63461047270653, Eot_times.ma * Eot::R2D
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
it 'expected "2014-08-15T12:00:00+00:00" from Eot_times.ajd_to_datetime(Eot_times.ajd).to_s ' do
|
|
38
|
-
assert_equal "2014-08-15T12:00:00+00:00", Eot_times.ajd_to_datetime(Eot_times.ajd).to_s
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
it 'expected -0.003102965199978262 from Eot_times.eot_jd() ' do
|
|
42
|
-
assert_equal -0.003102965199978262, Eot_times.eot_jd()
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
it 'expected "2014-08-15T12:04:28+00:00" from Eot_times.local_noon_dt().to_s ' do
|
|
46
|
-
assert_equal "2014-08-15T12:04:28+00:00", Eot_times.local_noon_dt().to_s
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
it 'expected "2014-08-15T12:00:00+00:00" from Eot_times.mean_local_noon_dt().to_s ' do
|
|
50
|
-
assert_equal "2014-08-15T12:00:00+00:00", Eot_times.mean_local_noon_dt().to_s
|
|
51
|
-
end
|
|
52
|
-
|
|
53
|
-
it 'expected "2014-08-15T04:45:44+00:00" from Eot_times.sunrise_dt() ' do
|
|
54
|
-
assert_equal "2014-08-15T04:45:44+00:00", Eot_times.sunrise_dt().to_s
|
|
55
|
-
end
|
|
56
|
-
|
|
57
|
-
it 'expected "2014-08-15T19:23:11+00:00" from Eot_times.sunset_dt() ' do
|
|
58
|
-
assert_equal "2014-08-15T19:23:11+00:00", Eot_times.sunset_dt().to_s
|
|
59
|
-
end
|
|
60
|
-
|
|
61
|
-
it 'expected 2456884.6984291207 from Eot_times.sunrise_jd() ' do
|
|
62
|
-
assert_equal 2456884.6984291207, Eot_times.sunrise_jd()
|
|
63
|
-
end
|
|
64
|
-
|
|
65
|
-
it 'expected 2456885.3077770434 from Eot_times.sunset_jd() ' do
|
|
66
|
-
assert_equal 2456885.3077770434, Eot_times.sunset_jd()
|
|
67
|
-
end
|
|
68
|
-
|
|
69
|
-
it 'expected -9.362425472253944 from Eot_times.time_delta_oblique() ' do
|
|
70
|
-
assert_equal -9.362425472253944, Eot_times.time_delta_oblique()
|
|
71
|
-
end
|
|
72
|
-
|
|
73
|
-
it 'expected 4.894155584285248 from Eot_times.time_delta_orbit() ' do
|
|
74
|
-
assert_equal 4.894155584285248, Eot_times.time_delta_orbit()
|
|
75
|
-
end
|
|
76
|
-
|
|
77
|
-
it 'expected -4.468269887968697 from Eot_times.time_eot() ' do
|
|
78
|
-
assert_equal -4.468269887968697, Eot_times.time_eot()
|
|
79
|
-
end
|
|
80
|
-
|
|
81
|
-
end
|
|
82
|
-
|
|
83
|
-
describe 'tests ajd of 2455055.0' do
|
|
84
|
-
|
|
85
|
-
before(:each) do
|
|
86
|
-
ajd = 2455055.0
|
|
87
|
-
Eot_times.ajd = ajd
|
|
88
|
-
# check date for this ajd when needed.
|
|
89
|
-
Eot_times.date = Eot_times.ajd_to_datetime(ajd)
|
|
90
|
-
# use ta attribute as matcher
|
|
91
|
-
@ta = Eot_times.ta
|
|
92
|
-
end
|
|
93
|
-
|
|
94
|
-
it 'expected 2455055.0, from Eot_times.' do
|
|
95
|
-
assert_equal 2455055.0, Eot_times.ajd
|
|
96
|
-
end
|
|
97
|
-
|
|
98
|
-
it 'expected "2009-08-11T12:00:00+00:00" from Eot_times.date.to_s' do
|
|
99
|
-
assert_equal "2009-08-11T12:00:00+00:00", Eot_times.date.to_s
|
|
100
|
-
end
|
|
101
|
-
|
|
102
|
-
it 'expected 216.98609672458667 from Eot_times.' do
|
|
103
|
-
assert_equal 216.98609672458667, Eot_times.ma * Eot::R2D
|
|
104
|
-
end
|
|
105
|
-
|
|
106
|
-
it 'expected "2009-08-11T12:00:00+00:00" from Eot_times.ajd_to_datetime(Eot_times.ajd).to_s' do
|
|
107
|
-
assert_equal "2009-08-11T12:00:00+00:00", Eot_times.ajd_to_datetime(Eot_times.ajd).to_s
|
|
108
|
-
end
|
|
109
|
-
|
|
110
|
-
it 'expected -0.003579806101313601 from Eot_times.eot_jd()' do
|
|
111
|
-
assert_equal -0.003579806101313601, Eot_times.eot_jd()
|
|
112
|
-
end
|
|
113
|
-
|
|
114
|
-
it 'expected "2009-08-11T12:00:00+00:00" from Eot_times.mean_local_noon_dt().to_s' do
|
|
115
|
-
assert_equal "2009-08-11T12:00:00+00:00", Eot_times.mean_local_noon_dt().to_s
|
|
116
|
-
end
|
|
117
|
-
|
|
118
|
-
it 'expected "2009-08-11T04:39:44+00:00" from Eot_times.sunrise_dt().to_s' do
|
|
119
|
-
assert_equal "2009-08-11T04:39:44+00:00", Eot_times.sunrise_dt().to_s
|
|
120
|
-
end
|
|
121
|
-
|
|
122
|
-
it 'expected 2455054.6942686504 from Eot_times.sunrise_jd()' do
|
|
123
|
-
assert_equal 2455054.6942686504, Eot_times.sunrise_jd()
|
|
124
|
-
end
|
|
125
|
-
|
|
126
|
-
it 'expected "2009-08-11T19:30:33+00:00" from Eot_times.sunset_dt()' do
|
|
127
|
-
assert_equal "2009-08-11T19:30:33+00:00", Eot_times.sunset_dt().to_s
|
|
128
|
-
end
|
|
129
|
-
|
|
130
|
-
it 'expected 2455055.3128911955 from Eot_times.sunset_jd() ' do
|
|
131
|
-
assert_equal 2455055.3128911955, Eot_times.sunset_jd()
|
|
132
|
-
end
|
|
133
|
-
|
|
134
|
-
it 'expected -5.154920785891585 is from Eot_times.time_eot() ' do
|
|
135
|
-
assert_equal -5.154920785891585, Eot_times.time_eot()
|
|
136
|
-
end
|
|
137
|
-
|
|
138
|
-
end
|
|
139
|
-
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
# utilities_spec.rb
|
|
2
|
-
#
|
|
3
|
-
# comment out next two lines and uncomment below for rpec tests.
|
|
4
|
-
gem 'minitest'
|
|
5
|
-
require 'minitest/autorun'
|
|
6
|
-
# require_relative '../spec_config'
|
|
7
|
-
|
|
8
|
-
lib = File.expand_path('../../../lib', __FILE__)
|
|
9
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
10
|
-
require 'eot'
|
|
11
|
-
|
|
12
|
-
Eot_utilities = Eot.new
|
|
13
|
-
|
|
14
|
-
describe 'tests ajd of 2456885.0' do
|
|
15
|
-
|
|
16
|
-
before(:each) do
|
|
17
|
-
ajd = 2456885.0
|
|
18
|
-
Eot_utilities.ajd = ajd
|
|
19
|
-
# check date for this ajd when needed.
|
|
20
|
-
Eot_utilities.date = Eot_utilities.ajd_to_datetime(ajd)
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
it 'expected 2456885.0 for Eot_utilities.ajd'do
|
|
24
|
-
assert_equal 2456885.0, Eot_utilities.ajd
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
it 'expected 220.63461047270653 for Eot_utilities.ma'do
|
|
28
|
-
assert_equal 220.63461047270653, Eot_utilities.ma * Eot::R2D
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
it 'expected 0.0 returned by Eot_utilities.mod_360() ' do
|
|
32
|
-
assert_equal 0.0, Eot_utilities.mod_360()
|
|
33
|
-
assert_equal 0.0, Eot_utilities.mod_360(nil)
|
|
34
|
-
assert_equal 0.0, Eot_utilities.mod_360(0)
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
end
|