equationoftime 4.1.7 → 4.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/.travis.yml +7 -0
- data/Gemfile +0 -1
- data/Manifest.txt +1 -0
- data/Rakefile +37 -9
- data/equationoftime.gemspec +12 -9
- data/examples/Equation_of_Time.png +0 -0
- data/examples/cal2jd.rb +10 -0
- data/examples/celes_formatters.rb +23 -0
- data/examples/eot_from_noon.rb +14 -0
- data/examples/eot_methods_list.rb +7 -0
- data/examples/my_lst.rb +11 -0
- data/examples/radians2degformated.rb +6 -0
- data/examples/t_sofa.rb +8229 -0
- data/examples/test_eot_c.rb +24 -0
- data/examples/use_addr.rb +20 -0
- data/examples/use_ajd.rb +40 -0
- data/ext/eot/ceot.c +3 -4
- data/ext/eot/eot.c +87 -43
- data/lib/eot/all.rb +11 -0
- data/lib/eot/angle_displays.rb +27 -13
- data/lib/eot/angles.rb +65 -7
- data/lib/eot/constants.rb +40 -3
- data/lib/eot/eot.so +0 -0
- data/lib/eot/times.rb +9 -1
- data/lib/eot/version.rb +1 -1
- data/test/eot/aliased_angles_spec.rb +293 -0
- data/test/eot/aliased_displays_spec.rb +127 -0
- data/test/eot/aliased_utilities_spec.rb +34 -0
- data/test/eot/angles_spec.rb +264 -0
- data/test/eot/constants_spec.rb +18 -0
- data/test/eot/displays_spec.rb +114 -0
- data/test/eot/geo_spec.rb +40 -0
- data/test/eot/init_spec.rb +45 -0
- data/test/eot/times_spec.rb +199 -0
- data/wiki.md +4 -3
- metadata +64 -29
data/lib/eot/constants.rb
CHANGED
@@ -1,13 +1,17 @@
|
|
1
|
-
|
1
|
+
##
|
2
|
+
# class Eot file = constants.rb:
|
2
3
|
# has the constants used and more
|
4
|
+
|
3
5
|
class Eot
|
4
|
-
# Array result for time_julian_century default = [0.0, 0.0, 0.0, 0.0, 0.0]
|
5
|
-
# A2000 = [0.0, 0.0, 0.0, 0.0, 0.0]
|
6
6
|
|
7
|
+
##
|
7
8
|
# Arc seconds in a degree = 3_600.0
|
9
|
+
|
8
10
|
ARCSEC = 3_600.0
|
9
11
|
|
12
|
+
##
|
10
13
|
# Arc seconds in a degree = 3_600.0
|
14
|
+
|
11
15
|
ASD = 3_600.0
|
12
16
|
|
13
17
|
# Arc seconds in an hour = 240.0
|
@@ -25,31 +29,46 @@ class Eot
|
|
25
29
|
# 2Pi = 6.283185307179586476925287
|
26
30
|
# D2PI = 6.283185307179586476925287
|
27
31
|
|
32
|
+
##
|
28
33
|
# from desktop calculator DAS2R = 4.8481368110953599358991410235795e-6
|
34
|
+
|
29
35
|
DAS2R = 4.8481368110953599358991410235795e-6
|
30
36
|
|
31
37
|
# Astronomical unit (m) = 149597870e3
|
32
38
|
# DAU = 149597870e3
|
33
39
|
|
40
|
+
##
|
34
41
|
# Hours in a day = 24.0
|
42
|
+
|
35
43
|
DAY_HOURS = 24.0
|
36
44
|
|
45
|
+
##
|
37
46
|
# Minutes in a day = 1_440.0
|
47
|
+
|
38
48
|
DAY_MINUTES = 1_440.0
|
39
49
|
|
50
|
+
##
|
40
51
|
# Seconds in a day = 86_400.0
|
52
|
+
|
41
53
|
DAY_SECONDS = 86_400.0
|
42
54
|
|
55
|
+
##
|
43
56
|
# Seconds in a day = 86_400.0
|
57
|
+
|
44
58
|
DAYSEC = 86_400.0
|
45
59
|
|
60
|
+
##
|
46
61
|
# Micro Seconds in a day = 86_400_000_000.0
|
62
|
+
|
47
63
|
DAY_USECS = 86_400_000_000.0
|
48
64
|
|
65
|
+
##
|
49
66
|
# Speed of light (AU per day) = DAYSEC / AULT
|
50
67
|
# DC = DAYSEC / AULT
|
51
68
|
|
69
|
+
##
|
52
70
|
# from desktop calculator D2R = 0.017453292519943295769236907684886
|
71
|
+
|
53
72
|
D2R = 0.017453292519943295769236907684886
|
54
73
|
|
55
74
|
# dint(A) - truncate to nearest whole number towards zero (double)
|
@@ -61,11 +80,15 @@ class Eot
|
|
61
80
|
# dsign(A,B) - magnitude of A with sign of B (double)
|
62
81
|
# dsign(A,B) = ((B)<0.0?-fabs(A):fabs(A))
|
63
82
|
|
83
|
+
##
|
64
84
|
# Reference epoch (J2000.0), Julian Date
|
65
85
|
# Default Julian Number = 2451545.0
|
86
|
+
|
66
87
|
DJ00 = 2_451_545.0
|
67
88
|
|
89
|
+
##
|
68
90
|
# Days per Julian century = 36525.0
|
91
|
+
|
69
92
|
DJC = 36_525.0
|
70
93
|
|
71
94
|
# Days per Julian millennium = 365250.0
|
@@ -94,7 +117,9 @@ class Eot
|
|
94
117
|
# Seconds of time to radians = 7.272205216643039903848712e-5
|
95
118
|
# DS2R = 7.272205216643039903848712e-5
|
96
119
|
|
120
|
+
##
|
97
121
|
# Default DateTime = DateTime.new( 2000, 01, 01, 12, 00, 00, "+00:00" )
|
122
|
+
|
98
123
|
DT2000 = DateTime.new(2000, 01, 01, 12, 00, 00, '+00:00')
|
99
124
|
|
100
125
|
# arc seconds degrees to radians = PI / 180.0 / ARCSEC
|
@@ -124,20 +149,32 @@ class Eot
|
|
124
149
|
# 1858, 11, 17, 0.0 midnight start of calendar reform = 2400000.5
|
125
150
|
# MJD0 = 2400000.5
|
126
151
|
|
152
|
+
##
|
127
153
|
# from desktop calculator PI = 3.1415926535897932384626433832795
|
154
|
+
|
128
155
|
PI = 3.1415926535897932384626433832795
|
129
156
|
|
157
|
+
##
|
130
158
|
# 2Pi from Math module = Math::PI * 2.0
|
159
|
+
|
131
160
|
P2 = PI * 2.0
|
132
161
|
|
162
|
+
##
|
133
163
|
# from desktop calculator R2D = 57.295779513082320876798154814105
|
164
|
+
|
134
165
|
R2D = 57.295779513082320876798154814105
|
135
166
|
|
167
|
+
##
|
136
168
|
# from desktop calculator RTD = 0.015915494309189533576888376337251
|
169
|
+
|
137
170
|
RTD = 0.015915494309189533576888376337251
|
138
171
|
|
172
|
+
##
|
139
173
|
# from desktop calculator Sidereal minutes =
|
140
174
|
# 4.0 / 1.0027379093507953456536618754278
|
175
|
+
# probably 3.989 would be close enough because
|
176
|
+
# it's not that constant anyway
|
177
|
+
|
141
178
|
SM = 4.0 / 1.0027379093507953456536618754278
|
142
179
|
|
143
180
|
# Schwarzschild radius of the Sun (au) =
|
data/lib/eot/eot.so
ADDED
Binary file
|
data/lib/eot/times.rb
CHANGED
@@ -1,9 +1,17 @@
|
|
1
|
-
|
1
|
+
##
|
2
|
+
# class Eot file = times.rb:
|
2
3
|
# methods calculating times
|
4
|
+
|
3
5
|
class Eot
|
6
|
+
|
7
|
+
##
|
4
8
|
# From times.rb:
|
9
|
+
|
5
10
|
# Pass in an AJD number
|
6
11
|
# Returns a DateTime object
|
12
|
+
# only DateTime#jd() to work with so
|
13
|
+
# add a half day to make it work.
|
14
|
+
|
7
15
|
def ajd_to_datetime(ajd)
|
8
16
|
DateTime.jd(ajd + 0.5)
|
9
17
|
end
|
data/lib/eot/version.rb
CHANGED
@@ -0,0 +1,293 @@
|
|
1
|
+
# aliased_angles_spec.rb
|
2
|
+
gem 'minitest'
|
3
|
+
require 'minitest/autorun'
|
4
|
+
|
5
|
+
lib = File.expand_path('../../../lib', __FILE__)
|
6
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
7
|
+
require 'eot'
|
8
|
+
|
9
|
+
aliased_angles = Eot.new
|
10
|
+
|
11
|
+
describe 'tests ajd of 2456885.0 ' do
|
12
|
+
|
13
|
+
before(:each) do
|
14
|
+
aliased_angles.ajd = 2_456_885.0
|
15
|
+
ajd = aliased_angles.ajd
|
16
|
+
aliased_angles.ma_ta_set
|
17
|
+
# somtimes need date to check values somewhere else
|
18
|
+
aliased_angles.date = aliased_angles.ajd_to_datetime(ajd)
|
19
|
+
end
|
20
|
+
|
21
|
+
it 'expected 2_456_885.0 for aliased_angles.ajd 'do
|
22
|
+
assert_equal(2_456_885.0, aliased_angles.ajd)
|
23
|
+
end
|
24
|
+
|
25
|
+
it 'expected "2014-08-15T12:00:00+00:00" from \
|
26
|
+
aliased_angles.date.to_s ' do
|
27
|
+
assert_equal('2014-08-15T12:00:00+00:00', aliased_angles.date.to_s)
|
28
|
+
end
|
29
|
+
|
30
|
+
it 'expected 3.8508003966038915 from aliased_angles.ma 'do
|
31
|
+
assert_equal(3.8508003966038915, aliased_angles.ma)
|
32
|
+
end
|
33
|
+
|
34
|
+
it 'expected 2.4887103398436143 from \
|
35
|
+
aliased_angles.apparent_longitude()? ' do
|
36
|
+
assert_equal(2.4887103398436143, aliased_angles.apparent_longitude)
|
37
|
+
end
|
38
|
+
|
39
|
+
it 'expected -0.7943361570447028 from \
|
40
|
+
aliased_angles.cosine_apparent_longitude()? ' do
|
41
|
+
assert_equal(-0.7943361570447028, \
|
42
|
+
aliased_angles.cosine_apparent_longitude)
|
43
|
+
end
|
44
|
+
|
45
|
+
it 'expected -0.7943772759574919 from \
|
46
|
+
aliased_angles.cosine_true_longitude()? ' do
|
47
|
+
assert_equal(-0.7943772759574919, aliased_angles.cosine_true_longitude)
|
48
|
+
end
|
49
|
+
|
50
|
+
it 'expected 0.9175115346811911 from \
|
51
|
+
aliased_angles.cosine_true_obliquity()? ' do
|
52
|
+
assert_equal(0.9175115346811911, aliased_angles.cosine_true_obliquity)
|
53
|
+
end
|
54
|
+
|
55
|
+
it 'expected 0.24401410218543554 from \
|
56
|
+
aliased_angles.declination()? ' do
|
57
|
+
assert_equal(0.24401410218543554, aliased_angles.declination)
|
58
|
+
end
|
59
|
+
|
60
|
+
it 'expected -0.04103082558803539 from \
|
61
|
+
aliased_angles.delta_t_ecliptic()? ' do
|
62
|
+
assert_equal(-0.04103082558803539, aliased_angles.delta_t_ecliptic)
|
63
|
+
end
|
64
|
+
|
65
|
+
it 'expected 0.021413249720702462 from \
|
66
|
+
aliased_angles.delta_t_elliptic()? ' do
|
67
|
+
assert_equal(0.021413249720702462, aliased_angles.delta_t_elliptic)
|
68
|
+
end
|
69
|
+
|
70
|
+
it 'expected 0.016702468499021204 from \
|
71
|
+
aliased_angles.eccentricity_earth_orbit()? ' do
|
72
|
+
assert_equal(0.016702468499021204, \
|
73
|
+
aliased_angles.eccentricity_earth_orbit)
|
74
|
+
end
|
75
|
+
|
76
|
+
it 'expected -0.021413249720702462 from \
|
77
|
+
aliased_angles.equation_of_center()? ' do
|
78
|
+
assert_equal(-0.021413249720702462, aliased_angles.equation_of_center)
|
79
|
+
end
|
80
|
+
|
81
|
+
it 'expected 2.5101912804141424 from \
|
82
|
+
aliased_angles.geometric_mean_longitude()? ' do
|
83
|
+
assert_equal(2.5101912804141424, \
|
84
|
+
aliased_angles.geometric_mean_longitude)
|
85
|
+
end
|
86
|
+
|
87
|
+
it 'expected 1.5857841877939605 from \
|
88
|
+
aliased_angles.horizon_angle(1)? ' do
|
89
|
+
assert_equal(1.5857841877939605, aliased_angles.horizon_angle(1))
|
90
|
+
end
|
91
|
+
|
92
|
+
it 'expected 3.8508003966038915 from \
|
93
|
+
aliased_angles.mean_anomaly()? ' do
|
94
|
+
assert_equal(3.8508003966038915, aliased_angles.mean_anomaly)
|
95
|
+
end
|
96
|
+
|
97
|
+
it 'expected 2.510089864980358 from \
|
98
|
+
aliased_angles.mean_longitude_aries()? ' do
|
99
|
+
assert_equal(2.510089864980358, aliased_angles.mean_longitude_aries)
|
100
|
+
end
|
101
|
+
|
102
|
+
it 'expected 0.40905940254265843 from \
|
103
|
+
aliased_angles.mean_obliquity()? ' do
|
104
|
+
assert_equal(0.40905940254265843, aliased_angles.mean_obliquity)
|
105
|
+
end
|
106
|
+
|
107
|
+
it 'expected 0.40905940254265843 from \
|
108
|
+
aliased_angles.mean_obliquity_of_ecliptic()? ' do
|
109
|
+
assert_equal(0.40905940254265843, \
|
110
|
+
aliased_angles.mean_obliquity_of_ecliptic)
|
111
|
+
end
|
112
|
+
|
113
|
+
it 'expected 0.40901870461547685 from \
|
114
|
+
aliased_angles.obliquity_correction()? ' do
|
115
|
+
assert_equal(0.40901870461547685, aliased_angles.obliquity_correction)
|
116
|
+
end
|
117
|
+
|
118
|
+
it 'expected 2.5297411654316497 from \
|
119
|
+
aliased_angles.right_ascension()? ' do
|
120
|
+
assert_equal(2.5297411654316497, aliased_angles.right_ascension)
|
121
|
+
end
|
122
|
+
|
123
|
+
it 'expected 0.6074784519729512 from \
|
124
|
+
aliased_angles.sine_apparent_longitude()? ' do
|
125
|
+
assert_equal(0.6074784519729512, aliased_angles.sine_apparent_longitude)
|
126
|
+
end
|
127
|
+
|
128
|
+
it 'expected 0.6074246812917259 from \
|
129
|
+
aliased_angles.sine_true_longitude()? ' do
|
130
|
+
assert_equal(0.6074246812917259, aliased_angles.sine_true_longitude)
|
131
|
+
end
|
132
|
+
|
133
|
+
it 'expected 3.8293871468831893 from \
|
134
|
+
aliased_angles.true_anomaly()? ' do
|
135
|
+
assert_equal(3.8293871468831893, aliased_angles.true_anomaly)
|
136
|
+
end
|
137
|
+
|
138
|
+
it 'expected 2.48877803069344 from \
|
139
|
+
aliased_angles.true_longitude()? ' do
|
140
|
+
assert_equal(2.48877803069344, aliased_angles.true_longitude)
|
141
|
+
end
|
142
|
+
|
143
|
+
it 'expected 2.5101242776531474 from \
|
144
|
+
aliased_angles.true_longitude_aries()? ' do
|
145
|
+
assert_equal(2.5101242776531474, aliased_angles.true_longitude_aries)
|
146
|
+
end
|
147
|
+
|
148
|
+
it 'expected 0.40901870461547685 from \
|
149
|
+
aliased_angles.true_obliquity()? ' do
|
150
|
+
assert_equal(0.40901870461547685, aliased_angles.true_obliquity)
|
151
|
+
end
|
152
|
+
end
|
153
|
+
|
154
|
+
describe 'tests ajd of 2455055.5 ' do
|
155
|
+
|
156
|
+
before(:each) do
|
157
|
+
aliased_angles.ajd = 2_455_055.0
|
158
|
+
ajd = aliased_angles.ajd
|
159
|
+
aliased_angles.ma_ta_set
|
160
|
+
# check date for this ajd when needed.
|
161
|
+
aliased_angles.date = aliased_angles.ajd_to_datetime(ajd)
|
162
|
+
end
|
163
|
+
|
164
|
+
it 'expected 2_455_055.0, from aliased_angles.' do
|
165
|
+
assert_equal(2_455_055.0, aliased_angles.ajd)
|
166
|
+
end
|
167
|
+
|
168
|
+
it 'expected "2009-08-11T12:00:00+00:00" from \
|
169
|
+
aliased_angles.date.to_s ' do
|
170
|
+
assert_equal('2009-08-11T12:00:00+00:00', aliased_angles.date.to_s)
|
171
|
+
end
|
172
|
+
|
173
|
+
it 'expected 3.7871218188949207, from aliased_angles.ma ' do
|
174
|
+
assert_equal(3.7871218188949207, aliased_angles.ma)
|
175
|
+
end
|
176
|
+
|
177
|
+
it 'expected 3.7871218188949207 from \
|
178
|
+
aliased_angles.ma from Eot_angles.mean_anomaly() ' do
|
179
|
+
assert_equal(3.7871218188949207, aliased_angles.mean_anomaly)
|
180
|
+
end
|
181
|
+
|
182
|
+
it 'expected 2.4252140645725033 from \
|
183
|
+
aliased_angles.apparent_longitude()? ' do
|
184
|
+
assert_equal(2.4252140645725033, aliased_angles.apparent_longitude)
|
185
|
+
end
|
186
|
+
|
187
|
+
it 'expected -0.7541886969975007 from \
|
188
|
+
aliased_angles.cosine_apparent_longitude()? ' do
|
189
|
+
assert_equal(-0.7541886969975007, \
|
190
|
+
aliased_angles.cosine_apparent_longitude)
|
191
|
+
end
|
192
|
+
|
193
|
+
it 'expected -0.7542060769936684 from \
|
194
|
+
aliased_angles.cosine_true_longitude()? ' do
|
195
|
+
assert_equal(-0.7542060769936684, aliased_angles.cosine_true_longitude)
|
196
|
+
end
|
197
|
+
|
198
|
+
it 'expected 0.9174818088112336 from \
|
199
|
+
aliased_angles.cosine_true_obliquity()? ' do
|
200
|
+
assert_equal(0.9174818088112336, aliased_angles.cosine_true_obliquity)
|
201
|
+
end
|
202
|
+
|
203
|
+
it 'expected 0.2642691272294404 from \
|
204
|
+
aliased_angles.declination()? ' do
|
205
|
+
assert_equal(0.2642691272294404, aliased_angles.declination)
|
206
|
+
end
|
207
|
+
|
208
|
+
it 'expected -0.04234904897476355 from \
|
209
|
+
aliased_angles.delta_t_ecliptic()? ' do
|
210
|
+
assert_equal(-0.04234904897476355, aliased_angles.delta_t_ecliptic)
|
211
|
+
end
|
212
|
+
|
213
|
+
it 'expected 0.019768413456709915 from \
|
214
|
+
aliased_angles.delta_t_elliptic()? ' do
|
215
|
+
assert_equal(0.019768413456709915, aliased_angles.delta_t_elliptic)
|
216
|
+
end
|
217
|
+
|
218
|
+
it 'expected 0.016704576164208475 from \
|
219
|
+
aliased_angles.eccentricity_earth_orbit()? ' do
|
220
|
+
assert_equal(0.016704576164208475, \
|
221
|
+
aliased_angles.eccentricity_earth_orbit)
|
222
|
+
end
|
223
|
+
|
224
|
+
it 'expected -0.019768413456709915 from \
|
225
|
+
aliased_angles.equation_of_center()? ' do
|
226
|
+
assert_equal(-0.019768413456709915, aliased_angles.equation_of_center)
|
227
|
+
end
|
228
|
+
|
229
|
+
it 'expected 2.445008945789877 from \
|
230
|
+
aliased_angles.geometric_mean_longitude()? ' do
|
231
|
+
assert_equal(2.445008945789877, aliased_angles.geometric_mean_longitude)
|
232
|
+
end
|
233
|
+
|
234
|
+
it 'expected 1.585863261753274 from \
|
235
|
+
aliased_angles.horizon_angle()? ' do
|
236
|
+
assert_equal(1.585863261753274, aliased_angles.horizon_angle(1))
|
237
|
+
end
|
238
|
+
|
239
|
+
it 'expected 3.7871218188949207 from \
|
240
|
+
aliased_angles.mean_anomaly()? ' do
|
241
|
+
assert_equal(3.7871218188949207, aliased_angles.mean_anomaly)
|
242
|
+
end
|
243
|
+
|
244
|
+
it 'expected 2.444907382260759 from \
|
245
|
+
aliased_angles.mean_longitude_aries()? ' do
|
246
|
+
assert_equal(2.444907382260759, aliased_angles.mean_longitude_aries)
|
247
|
+
end
|
248
|
+
|
249
|
+
it 'expected 0.4090707793981491 from \
|
250
|
+
aliased_angles.mean_obliquity()? ' do
|
251
|
+
assert_equal(0.4090707793981491, aliased_angles.mean_obliquity)
|
252
|
+
end
|
253
|
+
|
254
|
+
it 'expected 0.4090934409048494 from \
|
255
|
+
aliased_angles.obliquity_correction()? ' do
|
256
|
+
assert_equal(0.4090934409048494, aliased_angles.obliquity_correction)
|
257
|
+
end
|
258
|
+
|
259
|
+
it 'expected 2.467563113547267 from \
|
260
|
+
aliased_angles.right_ascension()? ' do
|
261
|
+
assert_equal(2.467563113547267, aliased_angles.right_ascension)
|
262
|
+
end
|
263
|
+
|
264
|
+
it 'expected 0.6566577566139093 from \
|
265
|
+
aliased_angles.sine_apparent_longitude()? ' do
|
266
|
+
assert_equal(0.6566577566139093, aliased_angles.sine_apparent_longitude)
|
267
|
+
end
|
268
|
+
|
269
|
+
it 'expected 0.6566377946979757 from \
|
270
|
+
aliased_angles.sine_true_longitude()? ' do
|
271
|
+
assert_equal(0.6566377946979757, aliased_angles.sine_true_longitude)
|
272
|
+
end
|
273
|
+
|
274
|
+
it 'expected 3.767353405438211 from aliased_angles.true_anomaly()? ' do
|
275
|
+
assert_equal(3.767353405438211, aliased_angles.true_anomaly)
|
276
|
+
end
|
277
|
+
|
278
|
+
it 'expected 2.4252405323331674 from \
|
279
|
+
aliased_angles.true_longitude()? ' do
|
280
|
+
assert_equal(2.4252405323331674, aliased_angles.true_longitude)
|
281
|
+
end
|
282
|
+
|
283
|
+
it 'expected 2.4449774607872907 from \
|
284
|
+
aliased_angles.true_longitude_aries()? ' do
|
285
|
+
assert_equal(2.4449774607872907, aliased_angles.true_longitude_aries)
|
286
|
+
end
|
287
|
+
|
288
|
+
it 'expected 0.4090934409048494 from \
|
289
|
+
aliased_angles.true_obliquity()? ' do
|
290
|
+
assert_equal(0.4090934409048494, aliased_angles.true_obliquity)
|
291
|
+
end
|
292
|
+
|
293
|
+
end
|
@@ -0,0 +1,127 @@
|
|
1
|
+
# aliased_displays_spec.rb
|
2
|
+
gem 'minitest'
|
3
|
+
require 'minitest/autorun'
|
4
|
+
|
5
|
+
lib = File.expand_path('../../../lib', __FILE__)
|
6
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
7
|
+
require 'eot'
|
8
|
+
|
9
|
+
aliased_displays = Eot.new
|
10
|
+
|
11
|
+
describe 'aliased_displays using ajd of 2456885.0' do
|
12
|
+
|
13
|
+
before(:each) do
|
14
|
+
aliased_displays.ajd = 2_456_885.0
|
15
|
+
ajd = aliased_displays.ajd
|
16
|
+
aliased_displays.ma_ta_set
|
17
|
+
# check date for this ajd when needed.
|
18
|
+
aliased_displays.date = aliased_displays.ajd_to_datetime(ajd)
|
19
|
+
|
20
|
+
end
|
21
|
+
|
22
|
+
it 'expected 2456885.0 , from aliased_displays.' do
|
23
|
+
assert_equal 2_456_885.0, aliased_displays.ajd
|
24
|
+
end
|
25
|
+
|
26
|
+
it 'expected "2014-08-15T12:00:00+00:00", \
|
27
|
+
from aliased_displays.date.to_s' do
|
28
|
+
assert_equal '2014-08-15T12:00:00+00:00', aliased_displays.date.to_s
|
29
|
+
end
|
30
|
+
|
31
|
+
it 'expected 3.8508003966038915, from aliased_displays.' do
|
32
|
+
assert_equal 3.8508003966038915, aliased_displays.ma
|
33
|
+
end
|
34
|
+
|
35
|
+
it 'expected "+142:35:33.356" \
|
36
|
+
from aliased_displays.apparent_longitude_string()? ' do
|
37
|
+
assert_equal '+142:35:33.356', aliased_displays.apparent_longitude_string
|
38
|
+
end
|
39
|
+
|
40
|
+
it 'expected "+013:58:51.522" \
|
41
|
+
from aliased_displays.declination_string()? ' do
|
42
|
+
assert_equal '+013:58:51.522', aliased_displays.declination_string
|
43
|
+
end
|
44
|
+
|
45
|
+
it 'expected "-04m, 29.2s" from \
|
46
|
+
aliased_displays.display_equation_of_time()? ' do
|
47
|
+
assert_equal '-04m, 29.2s', aliased_displays.display_equation_of_time
|
48
|
+
end
|
49
|
+
|
50
|
+
it 'expected "12:00:00.000" \
|
51
|
+
from aliased_displays.display_time_string()? ' do
|
52
|
+
assert_equal '12:00:00.000', aliased_displays.display_time_string
|
53
|
+
assert_equal '12:00:00.000', aliased_displays.display_time_string(nil)
|
54
|
+
assert_equal '12:00:00.000', aliased_displays.display_time_string(0)
|
55
|
+
end
|
56
|
+
|
57
|
+
it 'expected "12:00:00.000" from \
|
58
|
+
aliased_displays.display_time_string(aliased_displays.date)? ' do
|
59
|
+
assert_equal '12:00:00.000', \
|
60
|
+
aliased_displays.display_time_string(aliased_displays.date)
|
61
|
+
end
|
62
|
+
|
63
|
+
it 'expected "2000-01-01" from aliased_displays.jd_to_date_string()? ' do
|
64
|
+
assert_equal '2000-01-01', aliased_displays.jd_to_date_string
|
65
|
+
assert_equal '2000-01-01', aliased_displays.jd_to_date_string(nil)
|
66
|
+
assert_equal '2000-01-01', aliased_displays.jd_to_date_string(0)
|
67
|
+
end
|
68
|
+
|
69
|
+
it 'expected "2014-08-15" \
|
70
|
+
from aliased_displays.jd_to_date_string(aliased_displays.ajd)? ' do
|
71
|
+
assert_equal '2014-08-15', \
|
72
|
+
aliased_displays.jd_to_date_string(aliased_displays.ajd)
|
73
|
+
end
|
74
|
+
|
75
|
+
it 'expected "12:00:00" from \
|
76
|
+
aliased_displays.julian_period_day_fraction_to_time()? ' do
|
77
|
+
assert_equal '12:00:00', \
|
78
|
+
aliased_displays.julian_period_day_fraction_to_time
|
79
|
+
assert_equal '12:00:00', \
|
80
|
+
aliased_displays.julian_period_day_fraction_to_time(nil)
|
81
|
+
assert_equal '12:00:00', \
|
82
|
+
aliased_displays.julian_period_day_fraction_to_time(0)
|
83
|
+
end
|
84
|
+
|
85
|
+
it 'expected "+220:38:04.598" from \
|
86
|
+
aliased_displays.mean_anomaly_string()? ' do
|
87
|
+
assert_equal '+220:38:04.598', aliased_displays.mean_anomaly_string
|
88
|
+
end
|
89
|
+
|
90
|
+
it 'expected "+144:56:36.571" from \
|
91
|
+
aliased_displays.right_ascension_string()? ' do
|
92
|
+
assert_equal '+144:56:36.571', aliased_displays.right_ascension_string
|
93
|
+
end
|
94
|
+
|
95
|
+
it 'expected "+219:24:27.798" from \
|
96
|
+
aliased_displays.true_anomaly_string()? ' do
|
97
|
+
assert_equal '+219:24:27.798', aliased_displays.true_anomaly_string
|
98
|
+
end
|
99
|
+
|
100
|
+
it 'expected "+142:35:47.318" from \
|
101
|
+
aliased_displays.true_longitude_string()? ' do
|
102
|
+
assert_equal '+142:35:47.318', aliased_displays.true_longitude_string
|
103
|
+
end
|
104
|
+
|
105
|
+
it 'expected "+023:26:06.164" from \
|
106
|
+
aliased_displays.true_obliquity_string()? ' do
|
107
|
+
assert_equal '+023:26:06.164', aliased_displays.true_obliquity_string
|
108
|
+
end
|
109
|
+
|
110
|
+
end
|
111
|
+
|
112
|
+
describe 'Eot aliased displays explicit values' do
|
113
|
+
|
114
|
+
it 'expected "16:40:40.800" from \
|
115
|
+
aliased_displays.display_time_string(16.6780)? ' do
|
116
|
+
assert_equal '16:40:40.800', \
|
117
|
+
aliased_displays.display_time_string(16.6780)
|
118
|
+
end
|
119
|
+
|
120
|
+
it 'expected "17:59:16.800" from \
|
121
|
+
aliased_displays.display_time_string(17988)? ' do
|
122
|
+
aliased_displays.date = Date.today.to_s
|
123
|
+
assert_equal '17:59:16.800', \
|
124
|
+
aliased_displays.display_time_string(17.988)
|
125
|
+
end
|
126
|
+
|
127
|
+
end
|