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.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/.ruby-version +1 -1
- data/Gemfile +6 -4
- data/Gemfile.lock +21 -14
- data/Guardfile +4 -21
- data/Manifest.txt +18 -52
- data/README.rdoc +6 -6
- data/Rakefile +53 -92
- data/equationoftime.gemspec +48 -49
- data/examples/my_lst.rb +9 -0
- data/examples/use_addr.rb +20 -0
- data/examples/use_ajd.rb +40 -0
- data/ext/eot/ceot.c +18 -14
- data/ext/eot/extconf.rb +4 -5
- data/lib/eot/angle_displays.rb +95 -0
- data/lib/eot/angles.rb +160 -291
- data/lib/eot/constants.rb +78 -81
- data/lib/eot/deltas.rb +40 -0
- data/lib/eot/geo_lat_lng_smt.rb +30 -57
- data/lib/eot/init.rb +86 -124
- data/lib/eot/time_displays.rb +105 -0
- data/lib/eot/times.rb +118 -121
- data/lib/eot/trigometric.rb +51 -0
- data/lib/eot/utilities.rb +49 -50
- data/lib/eot/version.rb +3 -2
- data/lib/eot.rb +11 -5
- data/test/eot/aliased_angles_spec.rb +291 -0
- data/test/eot/aliased_displays_spec.rb +126 -0
- data/test/{aliased_utilities_spec.rb → eot/aliased_utilities_spec.rb} +32 -36
- data/test/eot/angles_spec.rb +261 -0
- data/test/eot/constants_spec.rb +17 -0
- data/test/eot/displays_spec.rb +111 -0
- data/test/eot/geo_spec.rb +40 -0
- data/test/eot/init_spec.rb +45 -0
- data/test/eot/times_spec.rb +137 -0
- data/wiki.md +55 -0
- data/wiki2.md +4 -0
- data.tar.gz.sig +0 -0
- metadata +55 -69
- metadata.gz.sig +0 -0
- data/.settings/org.eclipse.ltk.core.refactoring.prefs +0 -2
- data/examples/analemma_data_generator.rb +0 -58
- data/examples/check_date_type.rb +0 -60
- data/examples/compare_geoc_long_ra.rb +0 -44
- data/examples/data_table_for_astro_dog.rb +0 -45
- data/examples/earth_rotation.rb +0 -42
- data/examples/eot_methods_list.rb +0 -48
- data/examples/eot_plot.r +0 -57
- data/examples/eot_suntimes.rb +0 -149
- data/examples/equation_of_time.py +0 -186
- data/examples/figure_1.jpg +0 -0
- data/examples/file_converter.rb +0 -31
- data/examples/from_readme.rb +0 -14
- data/examples/from_wiki.rb +0 -46
- data/examples/geo_locator.rb +0 -16
- data/examples/getjd.rb +0 -45
- data/examples/gmst_gast_non_sofa.rb +0 -406
- data/examples/input_suntimes.rb +0 -24
- 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_table5_3a.txt +0 -682
- data/examples/ptime.rb +0 -162
- data/examples/suntimes.rb +0 -30
- data/examples/suntimes_test.rb +0 -50
- data/examples/t_sofa.rb +0 -8228
- data/examples/test_celes.rb +0 -51
- data/examples/test_ceot.rb +0 -55
- data/examples/test_poly_eval.rb +0 -32
- data/examples/time_scales.rb +0 -29
- data/examples/times_year.rb +0 -53
- data/examples/usage_example.rb +0 -26
- data/examples/use_angles.rb +0 -222
- data/lib/eot/displays.rb +0 -216
- data/lib/eot/eot.so +0 -0
- data/lib/eot/nutation.rb +0 -78
- data/run_tests_eclipse.rb +0 -1
- data/test/aliased_angles_spec.rb +0 -239
- data/test/aliased_displays_spec.rb +0 -105
- data/test/angles_spec.rb +0 -264
- data/test/constants_spec.rb +0 -20
- data/test/displays_spec.rb +0 -110
- data/test/geo_spec.rb +0 -38
- data/test/init_spec.rb +0 -44
- data/test/nutation_spec.rb +0 -37
- data/test/spec_config.rb +0 -8
- data/test/times_spec.rb +0 -133
- data/test/utilities_spec.rb +0 -35
data/test/constants_spec.rb
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
# constants_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
|
-
describe "Equation of Time constants." do
|
|
11
|
-
|
|
12
|
-
it "01 require 'eot' should find all constants." do
|
|
13
|
-
assert_equal 24.0, Eot::DAY_HOURS
|
|
14
|
-
assert_equal 1440.0, Eot::DAY_MINUTES
|
|
15
|
-
assert_equal 86400.0, Eot::DAY_SECONDS
|
|
16
|
-
assert_equal 86400.0 * 1.0e+6, Eot::DAY_USECS
|
|
17
|
-
assert_equal 57.29577951308232, Eot::R2D
|
|
18
|
-
assert_equal 0.017453292519943295, Eot::D2R
|
|
19
|
-
end
|
|
20
|
-
end
|
data/test/displays_spec.rb
DELETED
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
# 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_displays = Eot.new
|
|
11
|
-
|
|
12
|
-
describe 'Eot displays using ajd of 2456885.0' do
|
|
13
|
-
|
|
14
|
-
before(:each) do
|
|
15
|
-
Eot_displays.ajd = 2456885.0
|
|
16
|
-
ajd = Eot_displays.ajd
|
|
17
|
-
# check date for this ajd when needed.
|
|
18
|
-
Eot_displays.date = Eot_displays.ajd_to_datetime(ajd)
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
it 'expected 2456885.0 for Eot_displays.ajd'do
|
|
22
|
-
assert_equal 2456885.0, Eot_displays.ajd
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
it 'expected "2014-08-15T12:00:00+00:00", returned by Eot_displays.date.to_s' do
|
|
26
|
-
assert_equal "2014-08-15T12:00:00+00:00", Eot_displays.date.to_s
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
it 'expected 3.8508003966038915, returned by Eot_displays.' do
|
|
30
|
-
assert_equal 3.8508003966038915, Eot_displays.ma
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
it 'expected "+000:00:00.000" returned by Eot_displays.degrees_to_s() ' do
|
|
34
|
-
assert_equal "+000:00:00.000", Eot_displays.degrees_to_s()
|
|
35
|
-
assert_equal "+000:00:00.000", Eot_displays.degrees_to_s(nil)
|
|
36
|
-
assert_equal "+000:00:00.000", Eot_displays.degrees_to_s(0)
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
it 'expected "+142:35:33.356" returned by Eot_displays.string_al_Sun() ' do
|
|
40
|
-
assert_equal "+142:35:33.356", Eot_displays.string_al_Sun()
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
it 'expected "12:00:00" returned by Eot_displays.string_day_fraction_to_time() ' do
|
|
44
|
-
assert_equal "12:00:00", Eot_displays.string_day_fraction_to_time()
|
|
45
|
-
assert_equal "12:00:00", Eot_displays.string_day_fraction_to_time(nil)
|
|
46
|
-
assert_equal "12:00:00", Eot_displays.string_day_fraction_to_time(0)
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
it 'expected "+013:58:51.521" returned by Eot_displays.string_dec_Sun() ' do
|
|
50
|
-
assert_equal "+013:58:51.521", Eot_displays.string_dec_Sun()
|
|
51
|
-
end
|
|
52
|
-
|
|
53
|
-
it 'expected "-04m, 29.2s" returned by Eot_displays.string_eot() ' do
|
|
54
|
-
assert_equal "-04m, 29.2s", Eot_displays.string_eot()
|
|
55
|
-
end
|
|
56
|
-
|
|
57
|
-
it 'expected "2000-01-01" returned by Eot_displays.string_jd_to_date() ' do
|
|
58
|
-
assert_equal "2000-01-01", Eot_displays.string_jd_to_date()
|
|
59
|
-
assert_equal "2000-01-01", Eot_displays.string_jd_to_date(nil)
|
|
60
|
-
assert_equal "2000-01-01", Eot_displays.string_jd_to_date(0)
|
|
61
|
-
end
|
|
62
|
-
|
|
63
|
-
it 'expected "2014-08-15" returned by Eot_displays.jd_to_date_string(Eot_displays.ajd)? ' do
|
|
64
|
-
assert_equal "2014-08-15", Eot_displays.jd_to_date_string(Eot_displays.ajd)
|
|
65
|
-
end
|
|
66
|
-
|
|
67
|
-
it 'expected "+220:38:04.597" returned by Eot_displays.string_ma_Sun() ' do
|
|
68
|
-
assert_equal "+220:38:04.597", Eot_displays.string_ma_Sun()
|
|
69
|
-
end
|
|
70
|
-
|
|
71
|
-
it 'expected "+144:56:36.571" returned by Eot_displays.string_ra_Sun() ' do
|
|
72
|
-
assert_equal "+144:56:36.571", Eot_displays.string_ra_Sun()
|
|
73
|
-
end
|
|
74
|
-
|
|
75
|
-
it 'expected "+219:24:27.797" returned by Eot_displays.string_ta_Sun() ' do
|
|
76
|
-
assert_equal "+219:24:27.797", Eot_displays.string_ta_Sun()
|
|
77
|
-
end
|
|
78
|
-
|
|
79
|
-
it 'expected "12:00:00.000" returned by Eot_displays.string_time() ' do
|
|
80
|
-
assert_equal "12:00:00.000", Eot_displays.string_time()
|
|
81
|
-
assert_equal "12:00:00.000", Eot_displays.string_time(nil)
|
|
82
|
-
assert_equal "12:00:00.000", Eot_displays.string_time(0)
|
|
83
|
-
end
|
|
84
|
-
|
|
85
|
-
it 'expected "12:00:00.000" returned by Eot_displays.display_time_string(Eot_adisplays.date)? ' do
|
|
86
|
-
assert_equal "12:00:00.000", Eot_displays.display_time_string(Eot_displays.date)
|
|
87
|
-
end
|
|
88
|
-
|
|
89
|
-
it 'expected "+142:35:47.318" returned by Eot_displays.string_tl_Sun() ' do
|
|
90
|
-
assert_equal "+142:35:47.318", Eot_displays.string_tl_Sun()
|
|
91
|
-
end
|
|
92
|
-
|
|
93
|
-
it 'expected "+023:26:06.163" returned by Eot_displays.string_to_Earth() ' do
|
|
94
|
-
assert_equal "+023:26:06.163", Eot_displays.string_to_Earth()
|
|
95
|
-
end
|
|
96
|
-
|
|
97
|
-
end
|
|
98
|
-
|
|
99
|
-
describe 'Eot displays explicit values' do
|
|
100
|
-
|
|
101
|
-
it 'expected "16:40:40.800" returned by Eot_displays.string_time(16.6780) ' do
|
|
102
|
-
assert_equal "16:40:40.800", Eot_displays.string_time(16.6780)
|
|
103
|
-
end
|
|
104
|
-
|
|
105
|
-
it 'expected "17:59:16.800" returned by Eot_displays.string_time(17988) ' do
|
|
106
|
-
Eot_displays.date= Date.today.to_s
|
|
107
|
-
assert_equal "17:59:16.800", Eot_displays.string_time(17.988)
|
|
108
|
-
end
|
|
109
|
-
|
|
110
|
-
end
|
data/test/geo_spec.rb
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
# geo_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
|
-
geo = GeoLatLng.new()
|
|
11
|
-
|
|
12
|
-
describe 'Geo defaults' do
|
|
13
|
-
|
|
14
|
-
it 'expected "Blackheath Ave, London SE10 8XJ, UK" 'do
|
|
15
|
-
assert_equal "Blackheath Ave, London SE10 8XJ, UK", geo.addr
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
it'expected "http://maps.googleapis.com/maps/api/geocode/json?address="' do
|
|
19
|
-
assert_equal "http://maps.googleapis.com/maps/api/geocode/json?address=", geo.base
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
it'expected "Blackheath Ave, London SE10 8XJ, UK" 'do
|
|
23
|
-
assert_equal "Blackheath Ave, London SE10 8XJ, UK", geo.default_int
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
it'expected "3333 Coyote Hill Road, Palo Alto, CA, 94304, USA" 'do
|
|
27
|
-
assert_equal "3333 Coyote Hill Road, Palo Alto, CA, 94304, USA", geo.default_us
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
it'expected 0.0'do
|
|
31
|
-
assert_equal 0.0, geo.lat
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
it'expected 0.0'do
|
|
35
|
-
assert_equal 0.0, geo.lng
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
end
|
data/test/init_spec.rb
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
# init_spec.rb
|
|
2
|
-
#
|
|
3
|
-
|
|
4
|
-
require_relative 'spec_config'
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
lib = File.expand_path('../../../lib', __FILE__)
|
|
8
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
9
|
-
require 'eot'
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
describe 'Eot_initialize using today matchers' do
|
|
13
|
-
|
|
14
|
-
it 'expected DateTime.now.to_time.utc.to_datetime.jd.to_f' do
|
|
15
|
-
@test1 = Eot.new()
|
|
16
|
-
assert_equal DateTime.now.to_time.utc.to_datetime.jd.to_f, @test1.ajd
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
it 'expected 0.0' do
|
|
20
|
-
@test2 = Eot.new()
|
|
21
|
-
assert_equal( 51.4769388, @test2.latitude )
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
it 'expected 0.0' do
|
|
25
|
-
@test3 = Eot.new()
|
|
26
|
-
assert_equal( -4.2e-05, @test3.longitude )
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
it 'expected @test4.ma_Sun()' do
|
|
30
|
-
@test4 = Eot.new()
|
|
31
|
-
assert_equal @test4.ma_Sun(), @test4.ma
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
it 'expected (@test5.ajd - Eot::DJ00) / Eot::DJC' do
|
|
35
|
-
@test5 = Eot.new()
|
|
36
|
-
assert_equal (@test5.ajd - Eot::DJ00) / Eot::DJC, @test5.ta
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
it 'expected 0.0 returned by Eot_initialize.new() ' do
|
|
40
|
-
@test6 = Eot.new()
|
|
41
|
-
assert_equal "Blackheath Ave, London SE10 8XJ, UK", @test6.addr
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
end
|
data/test/nutation_spec.rb
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
#~ # nutation_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
|
-
|
|
11
|
-
#~ Eot_nutation = Eot.new
|
|
12
|
-
|
|
13
|
-
#~ describe 'Eot_nutation using ajd of 2456885.0' do
|
|
14
|
-
|
|
15
|
-
#~ before(:each) do
|
|
16
|
-
#~ Eot_nutation.ajd = 2456885.0
|
|
17
|
-
#~ ajd = Eot_nutation.ajd
|
|
18
|
-
#~ Eot_nutation.date = Eot_nutation.ajd_to_datetime(ajd)
|
|
19
|
-
#~ end
|
|
20
|
-
|
|
21
|
-
#~ it 'expected 2456885.0 from Eot_nutation.ajd' do
|
|
22
|
-
#~ assert_equal 2456885.0, Eot_nutation.ajd
|
|
23
|
-
#~ end
|
|
24
|
-
|
|
25
|
-
#~ it 'expected "2014-08-15T12:00:00+00:00" from Eot_nutation.date.to_s' do
|
|
26
|
-
#~ assert_equal "2014-08-15T12:00:00+00:00", Eot_nutation.date.to_s
|
|
27
|
-
#~ end
|
|
28
|
-
|
|
29
|
-
#~ it 'expected 3.8508003966038915 from Eot_nutation.ma' do
|
|
30
|
-
#~ assert_equal 3.8508003966038915, Eot_nutation.ma
|
|
31
|
-
#~ end
|
|
32
|
-
|
|
33
|
-
#~ it 'expected [3.75123821843003e-05, -4.069792718159396e-05] from Eot_nutation.delta_equinox()' do
|
|
34
|
-
#~ assert_equal [3.75123821843003e-05, -4.069792718159396e-05], Eot_nutation.delta_equinox()
|
|
35
|
-
#~ end
|
|
36
|
-
|
|
37
|
-
#~ end
|
data/test/spec_config.rb
DELETED
data/test/times_spec.rb
DELETED
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
# times_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_times = Eot.new
|
|
11
|
-
|
|
12
|
-
describe 'tests ajd of 2456885.0' do
|
|
13
|
-
|
|
14
|
-
before(:each) do
|
|
15
|
-
Eot_times.ajd = 2456885.0
|
|
16
|
-
ajd = Eot_times.ajd
|
|
17
|
-
# check date for this ajd when needed.
|
|
18
|
-
Eot_times.date = Eot_times.ajd_to_datetime(ajd)
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
it 'expected 2456885.0 for Eot_times.ajd'do
|
|
22
|
-
assert_equal( 2456885.0, Eot_times.ajd )
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
it 'expected "2014-08-15T12:00:00+00:00" for Eot_times.date'.to_s do
|
|
26
|
-
assert_equal "2014-08-15T12:00:00+00:00", Eot_times.date.to_s
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
it 'expected 3.8508003966038915 for Eot_times.ma'do
|
|
30
|
-
assert_equal( 3.8508003966038915, Eot_times.ma )
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
it 'expected "2014-08-15T12:00:00+00:00" from Eot_times.ajd_to_datetime(Eot_times.ajd).to_s ' do
|
|
34
|
-
assert_equal "2014-08-15T12:00:00+00:00", Eot_times.ajd_to_datetime(Eot_times.ajd).to_s
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
it 'expected -0.0031137091174580018 from Eot_times.eot_jd() ' do
|
|
38
|
-
assert_equal( -0.0031137091174580018, Eot_times.eot_jd() )
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
it 'expected "2014-08-15T12:04:29+00:00" from Eot_times.local_noon_dt().to_s ' do
|
|
42
|
-
assert_equal "2014-08-15T12:04:29+00:00", Eot_times.local_noon_dt().to_s
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
it 'expected "2014-08-15T12:00:00+00:00" from Eot_times.mean_local_noon_dt().to_s ' do
|
|
46
|
-
assert_equal "2014-08-15T12:00:00+00:00", Eot_times.mean_local_noon_dt().to_s
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
it 'expected "2014-08-15T04:45:45+00:00" from Eot_times.sunrise_dt() ' do
|
|
50
|
-
assert_equal "2014-08-15T04:45:45+00:00", Eot_times.sunrise_dt().to_s
|
|
51
|
-
end
|
|
52
|
-
|
|
53
|
-
it 'expected "2014-08-15T19:23:12+00:00" from Eot_times.sunset_dt() ' do
|
|
54
|
-
assert_equal "2014-08-15T19:23:12+00:00", Eot_times.sunset_dt().to_s
|
|
55
|
-
end
|
|
56
|
-
|
|
57
|
-
it 'expected 2456884.6984398644 from Eot_times.sunrise_jd() ' do
|
|
58
|
-
assert_equal( 2456884.6984398644, Eot_times.sunrise_jd() )
|
|
59
|
-
end
|
|
60
|
-
|
|
61
|
-
it 'expected 2456885.307787787 from Eot_times.sunset_jd() ' do
|
|
62
|
-
assert_equal( 2456885.307787787, Eot_times.sunset_jd() )
|
|
63
|
-
end
|
|
64
|
-
|
|
65
|
-
it 'expected -9.362425472253944 from Eot_times.time_delta_oblique() ' do
|
|
66
|
-
assert_equal( -9.362425472253944, Eot_times.time_delta_oblique() )
|
|
67
|
-
end
|
|
68
|
-
|
|
69
|
-
it 'expected 4.894155584285248 from Eot_times.time_delta_orbit() ' do
|
|
70
|
-
assert_equal( 4.894155584285248, Eot_times.time_delta_orbit() )
|
|
71
|
-
end
|
|
72
|
-
|
|
73
|
-
it 'expected -4.483741129139522 from Eot_times.time_eot() ' do
|
|
74
|
-
assert_equal( -4.483741129139522, Eot_times.time_eot() )
|
|
75
|
-
end
|
|
76
|
-
|
|
77
|
-
end
|
|
78
|
-
|
|
79
|
-
describe 'tests ajd of 2455055.0' do
|
|
80
|
-
|
|
81
|
-
before(:each) do
|
|
82
|
-
Eot_times.ajd = 2455055.0
|
|
83
|
-
ajd = Eot_times.ajd
|
|
84
|
-
# check date for this ajd when needed.
|
|
85
|
-
Eot_times.date = Eot_times.ajd_to_datetime(ajd)
|
|
86
|
-
end
|
|
87
|
-
|
|
88
|
-
it 'expected 2455055.0, from Eot_times.' do
|
|
89
|
-
assert_equal( 2455055.0, Eot_times.ajd )
|
|
90
|
-
end
|
|
91
|
-
|
|
92
|
-
it 'expected "2009-08-11T12:00:00+00:00" from Eot_times.date.to_s' do
|
|
93
|
-
assert_equal "2009-08-11T12:00:00+00:00", Eot_times.date.to_s
|
|
94
|
-
end
|
|
95
|
-
|
|
96
|
-
it 'expected 3.7871218188949207 from Eot_times.' do
|
|
97
|
-
assert_equal( 3.7871218188949207, Eot_times.ma )
|
|
98
|
-
end
|
|
99
|
-
|
|
100
|
-
it 'expected "2009-08-11T12:00:00+00:00" from Eot_times.ajd_to_datetime(Eot_times.ajd).to_s' do
|
|
101
|
-
assert_equal "2009-08-11T12:00:00+00:00", Eot_times.ajd_to_datetime(Eot_times.ajd).to_s
|
|
102
|
-
end
|
|
103
|
-
|
|
104
|
-
it 'expected -0.00358400707437244 from Eot_times.eot_jd()' do
|
|
105
|
-
assert_equal( -0.00358400707437244, Eot_times.eot_jd() )
|
|
106
|
-
end
|
|
107
|
-
|
|
108
|
-
it 'expected "2009-08-11T12:00:00+00:00" from Eot_times.mean_local_noon_dt().to_s' do
|
|
109
|
-
assert_equal "2009-08-11T12:00:00+00:00", Eot_times.mean_local_noon_dt().to_s
|
|
110
|
-
end
|
|
111
|
-
|
|
112
|
-
it 'expected "2009-08-11T04:39:45+00:00" from Eot_times.sunrise_dt().to_s' do
|
|
113
|
-
assert_equal "2009-08-11T04:39:45+00:00", Eot_times.sunrise_dt().to_s
|
|
114
|
-
end
|
|
115
|
-
|
|
116
|
-
it 'expected 2455054.6942728516 from Eot_times.sunrise_jd()' do
|
|
117
|
-
assert_equal( 2455054.6942728516, Eot_times.sunrise_jd() )
|
|
118
|
-
end
|
|
119
|
-
|
|
120
|
-
it 'expected "2009-08-11T19:30:34+00:00" from Eot_times.sunset_dt()' do
|
|
121
|
-
assert_equal "2009-08-11T19:30:34+00:00", Eot_times.sunset_dt().to_s
|
|
122
|
-
end
|
|
123
|
-
|
|
124
|
-
it 'expected 2455055.3128953967 from Eot_times.sunset_jd() ' do
|
|
125
|
-
assert_equal( 2455055.3128953967, Eot_times.sunset_jd() )
|
|
126
|
-
end
|
|
127
|
-
|
|
128
|
-
it 'expected -5.160970187096313 is from Eot_times.time_eot() ' do
|
|
129
|
-
assert_equal( -5.160970187096313, Eot_times.time_eot() )
|
|
130
|
-
end
|
|
131
|
-
|
|
132
|
-
end
|
|
133
|
-
|
data/test/utilities_spec.rb
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
#~ # utilities_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_utilities = Eot.new
|
|
11
|
-
|
|
12
|
-
#~ describe 'tests ajd of 2456885.0' do
|
|
13
|
-
|
|
14
|
-
#~ before(:each) do
|
|
15
|
-
#~ Eot_utilities.ajd = 2456885.0
|
|
16
|
-
#~ ajd = Eot_utilities.ajd
|
|
17
|
-
#~ # check date for this ajd when needed.
|
|
18
|
-
#~ Eot_utilities.date = Eot_utilities.ajd_to_datetime(ajd)
|
|
19
|
-
#~ end
|
|
20
|
-
|
|
21
|
-
#~ it 'expected 2456885.0 for Eot_utilities.ajd'do
|
|
22
|
-
#~ assert_equal 2456885.0, Eot_utilities.ajd
|
|
23
|
-
#~ end
|
|
24
|
-
|
|
25
|
-
#~ it 'expected 3.8508003966038915 for Eot_utilities.ma'do
|
|
26
|
-
#~ assert_equal 3.8508003966038915, Eot_utilities.ma
|
|
27
|
-
#~ end
|
|
28
|
-
|
|
29
|
-
#~ it 'expected 0.0 returned by Eot_utilities.mod_360() ' do
|
|
30
|
-
#~ assert_equal 0.0, Eot_utilities.mod_360()
|
|
31
|
-
#~ assert_equal 0.0, Eot_utilities.mod_360(nil)
|
|
32
|
-
#~ assert_equal 0.0, Eot_utilities.mod_360(0)
|
|
33
|
-
#~ end
|
|
34
|
-
|
|
35
|
-
#~ end
|