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
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# class Eot file = time_displays.rb
|
|
2
|
+
class Eot
|
|
3
|
+
# From displays.rb
|
|
4
|
+
# String formatter for + and - time
|
|
5
|
+
def show_minutes(min = 0.0)
|
|
6
|
+
min.nil? ? min = 0.0 : min
|
|
7
|
+
time = Time.utc(1, 1, 1, 0, 0, 0, 0.0)
|
|
8
|
+
time += (min.abs * 60.0)
|
|
9
|
+
sign = sign_min(min)
|
|
10
|
+
time.strftime("#{sign}%M:%S.%3N")
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
# From displays.rb
|
|
14
|
+
# String for time now
|
|
15
|
+
def show_now(now = now(Time.now.utc))
|
|
16
|
+
show_minutes(now)
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
# From displays.rb
|
|
20
|
+
# String formatter for fraction of Julian day number
|
|
21
|
+
def string_day_fraction_to_time(jpd_time = 0.0)
|
|
22
|
+
jpd_time.nil? ? jpd_time = 0.0 : jpd_time
|
|
23
|
+
fraction = jpd_time + 0.5 - Integer(jpd_time)
|
|
24
|
+
h = Integer(fraction * DAY_HOURS)
|
|
25
|
+
m = Integer((fraction - h / DAY_HOURS) * DAY_MINUTES)
|
|
26
|
+
s = Integer((fraction - h / 24.0 - m / DAY_MINUTES) * DAY_SECONDS)
|
|
27
|
+
format('%02d', h) +
|
|
28
|
+
':' +
|
|
29
|
+
format('%02d', m) +
|
|
30
|
+
':' +
|
|
31
|
+
format('%02d', s)
|
|
32
|
+
end
|
|
33
|
+
alias_method :julian_period_day_fraction_to_time, :string_day_fraction_to_time
|
|
34
|
+
|
|
35
|
+
def sign_min(min)
|
|
36
|
+
if min < 0.0
|
|
37
|
+
sign = '-'
|
|
38
|
+
else
|
|
39
|
+
sign = '+'
|
|
40
|
+
end
|
|
41
|
+
sign
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# From displays.rb
|
|
45
|
+
# Equation of time output for minutes and seconds
|
|
46
|
+
def string_eot
|
|
47
|
+
min_eot = time_eot
|
|
48
|
+
sign = sign_min(min_eot)
|
|
49
|
+
eot = min_eot.abs
|
|
50
|
+
minutes = Integer(eot)
|
|
51
|
+
seconds = (eot - minutes) * 60.0
|
|
52
|
+
decimal_seconds = (seconds - Integer(seconds)) * 100.0
|
|
53
|
+
min = format('%02d', minutes)
|
|
54
|
+
sec = format('%02d', seconds)
|
|
55
|
+
dec_sec = format('%01d', decimal_seconds)
|
|
56
|
+
sign << min << 'm, ' << sec << '.' << dec_sec << 's'
|
|
57
|
+
end
|
|
58
|
+
alias_method :display_equation_of_time, :string_eot
|
|
59
|
+
|
|
60
|
+
# From displays.rb
|
|
61
|
+
# String format conversion of jd to date
|
|
62
|
+
def string_jd_to_date(jd = DJ00)
|
|
63
|
+
jd = check_jd_zero(jd)
|
|
64
|
+
Date.jd(jd).to_s
|
|
65
|
+
end
|
|
66
|
+
alias_method :jd_to_date_string, :string_jd_to_date
|
|
67
|
+
|
|
68
|
+
def format_time(h, m, s, ds)
|
|
69
|
+
format('%02d', h) +
|
|
70
|
+
':' +
|
|
71
|
+
format('%02d', m) +
|
|
72
|
+
':' +
|
|
73
|
+
format('%02d', s) +
|
|
74
|
+
'.' +
|
|
75
|
+
format('%3.3d', ds)
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
def dt_parts(val)
|
|
79
|
+
h = val.hour
|
|
80
|
+
m = val.min
|
|
81
|
+
s = val.sec
|
|
82
|
+
is = Integer(s)
|
|
83
|
+
ds = Integer((s - is).round(3) * 1000.0)
|
|
84
|
+
[h, m, is, ds]
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
def float_parts(val)
|
|
88
|
+
hours = Integer(val % DAY_HOURS)
|
|
89
|
+
mins = 60.0 * (val % DAY_HOURS - hours)
|
|
90
|
+
imins = Integer(mins)
|
|
91
|
+
secs = 60.0 * (mins - imins)
|
|
92
|
+
isecs = Integer(secs)
|
|
93
|
+
ds = Integer((secs - isecs).round(3) * 1000.0)
|
|
94
|
+
[hours, imins, isecs, ds]
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# From displays.rb
|
|
98
|
+
# String formatter for h:m:s display
|
|
99
|
+
def string_time(dt = DT2000)
|
|
100
|
+
dt = check_t_zero(dt)
|
|
101
|
+
dt.class == DateTime ? ta = dt_parts(dt) : ta = float_parts(dt)
|
|
102
|
+
format_time(ta[0], ta[1], ta[2], ta[3])
|
|
103
|
+
end
|
|
104
|
+
alias_method :display_time_string, :string_time
|
|
105
|
+
end
|
data/lib/eot/times.rb
CHANGED
|
@@ -1,121 +1,118 @@
|
|
|
1
|
-
# times.rb
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
#
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
#
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
#
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
#
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
#
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
#
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
#
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
#
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
#
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
#
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
#
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
#
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
#
|
|
92
|
-
#
|
|
93
|
-
#
|
|
94
|
-
#
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
#
|
|
100
|
-
#
|
|
101
|
-
#
|
|
102
|
-
#
|
|
103
|
-
#
|
|
104
|
-
#
|
|
105
|
-
#
|
|
106
|
-
#
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
require 'times_spec'
|
|
120
|
-
|
|
121
|
-
end
|
|
1
|
+
# class Eot file = times.rb
|
|
2
|
+
class Eot
|
|
3
|
+
# From times.rb:
|
|
4
|
+
# Pass in an AJD number
|
|
5
|
+
# Returns a DateTime object
|
|
6
|
+
def ajd_to_datetime(ajd)
|
|
7
|
+
DateTime.jd(ajd + 0.5)
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
# From times.rb:
|
|
11
|
+
# Uses @ajd attribute
|
|
12
|
+
# Returns EOT as an AJD Julian number
|
|
13
|
+
def eot_jd
|
|
14
|
+
time_eot / DAY_MINUTES
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# From times.rb:
|
|
18
|
+
# Uses @ajd and @longitude attributes
|
|
19
|
+
# Returns DateTime object of local noon or solar transit
|
|
20
|
+
def local_noon_dt
|
|
21
|
+
ajd_to_datetime(@ajd - @longitude / 360.0 - eot_jd)
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
# From times.rb:
|
|
25
|
+
# Uses @ajd and @longitude attributes
|
|
26
|
+
# Returns DateTime object of local mean noon or solar transit
|
|
27
|
+
def mean_local_noon_dt
|
|
28
|
+
ajd_to_datetime(@ajd - @longitude / 360.0)
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# From times.rb:
|
|
32
|
+
# sets @ajd to DateTime.now
|
|
33
|
+
# Returns EOT (equation of time) now in decimal minutes form
|
|
34
|
+
def now
|
|
35
|
+
@ajd = DateTime.now.to_time.utc.to_datetime.ajd
|
|
36
|
+
@ta = (@ajd - DJ00) / DJC
|
|
37
|
+
time_eot
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# From times.rb:
|
|
41
|
+
# Uses @ajd attribute
|
|
42
|
+
# Returns a DateTime object of local sunrise
|
|
43
|
+
def sunrise_dt
|
|
44
|
+
ajd_to_datetime(sunrise_jd)
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# From times.rb:
|
|
48
|
+
# Uses @ajd attribute
|
|
49
|
+
# Returns Sunrise as a Julian Day Number
|
|
50
|
+
def sunrise_jd
|
|
51
|
+
local_noon_dt.ajd - ha_sun * R2D / 360.0
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# From times.rb:
|
|
55
|
+
# Uses @ajd attribute
|
|
56
|
+
# Returns a DateTime object of local sunset
|
|
57
|
+
def sunset_dt
|
|
58
|
+
ajd_to_datetime(sunset_jd)
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# From times.rb:
|
|
62
|
+
# Uses @ajd attribute
|
|
63
|
+
# Returns Sunset as a Julian Day Number
|
|
64
|
+
def sunset_jd
|
|
65
|
+
local_noon_dt.ajd + ha_sun * R2D / 360.0
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# From times.rb:
|
|
69
|
+
# Uses @ajd attribute
|
|
70
|
+
# Returns Oblique component of EOT in decimal minutes time
|
|
71
|
+
def time_delta_oblique
|
|
72
|
+
(tl_sun - ra_sun) * R2D * SM
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# From times.rb:
|
|
76
|
+
# Uses @ajd attribute
|
|
77
|
+
# Returns Orbit component of EOT in decimal minutes time
|
|
78
|
+
def time_delta_orbit
|
|
79
|
+
(@ma - ta_sun) * R2D * SM
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
# From times.rb:
|
|
83
|
+
# Uses @ajd attribute
|
|
84
|
+
# Returns EOT as a float for decimal minutes time
|
|
85
|
+
def time_eot
|
|
86
|
+
eot * R2D * SM
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
# From times.rb:
|
|
90
|
+
# All calculations with ( ta ) were based on this.
|
|
91
|
+
# Julian Century Time is a fractional century
|
|
92
|
+
# Julian Day Number DJ00 is subtracted from the JDN or AJDN and then divided
|
|
93
|
+
# by days in a Julian Century.
|
|
94
|
+
# Deprecated
|
|
95
|
+
def time_julian_century
|
|
96
|
+
t1 = (@ajd - DJ00) / DJC
|
|
97
|
+
# t2 = t1 * t1
|
|
98
|
+
# t3 = t1 * t2
|
|
99
|
+
# t4 = t2 * t2
|
|
100
|
+
# t5 = t2 * t3
|
|
101
|
+
# t6 = t3 * t3
|
|
102
|
+
# t7 = t3 * t4
|
|
103
|
+
# t8 = t4 * t4
|
|
104
|
+
# t9 = t4 * t5
|
|
105
|
+
# t10 = t5 * t5
|
|
106
|
+
# @ta = [ t1, t2, t3, t4, t5, t6, t7, t8, t9, t10 ]
|
|
107
|
+
@ta = t1
|
|
108
|
+
end
|
|
109
|
+
alias_method :time_julian_centurey, :time_julian_century
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
if __FILE__ == $PROGRAM_NAME
|
|
113
|
+
|
|
114
|
+
spec = File.expand_path('../../../tests/minitest', __FILE__)
|
|
115
|
+
$LOAD_PATH.unshift(spec) unless $LOAD_PATH.include?(spec)
|
|
116
|
+
require 'times_spec'
|
|
117
|
+
|
|
118
|
+
end
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# class Eot file = trigometric.rb
|
|
2
|
+
class Eot
|
|
3
|
+
include Math
|
|
4
|
+
# From trigometric.rb:
|
|
5
|
+
# cosine apparent longitude
|
|
6
|
+
# could be useful when dividing
|
|
7
|
+
def cosine_al_sun
|
|
8
|
+
cos(al(@ma, @ta, Celes.faom03(@ta)))
|
|
9
|
+
end
|
|
10
|
+
alias_method :cosine_apparent_longitude, :cosine_al_sun
|
|
11
|
+
alias_method :cosalsun, :cosine_al_sun
|
|
12
|
+
|
|
13
|
+
# From trigometric.rb:
|
|
14
|
+
# cosine true longitude
|
|
15
|
+
# used in solar right ascension
|
|
16
|
+
def cosine_tl_sun
|
|
17
|
+
cos(tl(@ma, @ta))
|
|
18
|
+
end
|
|
19
|
+
alias_method :cosine_true_longitude, :cosine_tl_sun
|
|
20
|
+
|
|
21
|
+
# From trigometric.rb:
|
|
22
|
+
# cosine true obliquity
|
|
23
|
+
# used in solar right ascension and equation of equinox
|
|
24
|
+
def cosine_to_earth
|
|
25
|
+
cos(Celes.nut06a(@ajd, 0)[1] + Celes.obl06(@ajd, 0))
|
|
26
|
+
end
|
|
27
|
+
alias_method :cosine_true_obliquity, :cosine_to_earth
|
|
28
|
+
|
|
29
|
+
# From trigometric.rb:
|
|
30
|
+
# sine apparent longitude
|
|
31
|
+
# used in solar declination
|
|
32
|
+
def sine_al_sun
|
|
33
|
+
sin(al(@ma, @ta, Celes.faom03(@ta)))
|
|
34
|
+
end
|
|
35
|
+
alias_method :sine_apparent_longitude, :sine_al_sun
|
|
36
|
+
|
|
37
|
+
# From trigometric.rb:
|
|
38
|
+
# sine true longitude
|
|
39
|
+
# used in solar right ascension
|
|
40
|
+
def sine_tl_sun
|
|
41
|
+
sin(tl(@ma, @ta))
|
|
42
|
+
end
|
|
43
|
+
alias_method :sine_true_longitude, :sine_tl_sun
|
|
44
|
+
|
|
45
|
+
# From trigometric.rb:
|
|
46
|
+
# sine true obliquity angle of Earth
|
|
47
|
+
# used in solar declination
|
|
48
|
+
def sine_to_earth
|
|
49
|
+
sin(Celes.nut06a(@ajd, 0)[1] + Celes.obl06(@ajd, 0))
|
|
50
|
+
end
|
|
51
|
+
end
|
data/lib/eot/utilities.rb
CHANGED
|
@@ -1,50 +1,49 @@
|
|
|
1
|
-
# utilities.rb
|
|
2
|
-
|
|
3
|
-
class Eot
|
|
4
|
-
# From utilities.rb:
|
|
5
|
-
# A check for default J2000
|
|
6
|
-
# sets default when arg is nil
|
|
7
|
-
def check_jd_nil(
|
|
8
|
-
jd.nil? ?
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
# From utilities.rb:
|
|
12
|
-
# A check for default J2000
|
|
13
|
-
# sets default when arg is zero
|
|
14
|
-
def check_jd_zero(
|
|
15
|
-
jd == 0 ?
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
# From utilities.rb:
|
|
19
|
-
# A check for default DT2000
|
|
20
|
-
# sets default when arg is nil
|
|
21
|
-
def check_t_nil(
|
|
22
|
-
dt.nil? ?
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
# From utilities.rb:
|
|
26
|
-
# A check for default DT2000
|
|
27
|
-
# sets default when arg is zero
|
|
28
|
-
def check_t_zero(
|
|
29
|
-
dt == 0 ?
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
# From utilities.rb:
|
|
33
|
-
# Keeps large angles in range of 360.0
|
|
34
|
-
# aliased by truncate
|
|
35
|
-
def mod_360(
|
|
36
|
-
x.nil? ? x = 0.0 : x
|
|
37
|
-
360.0 * (
|
|
38
|
-
end
|
|
39
|
-
alias_method :truncate, :mod_360
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
spec
|
|
46
|
-
|
|
47
|
-
require '
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
end
|
|
1
|
+
# utilities.rb
|
|
2
|
+
# class Eot
|
|
3
|
+
class Eot
|
|
4
|
+
# From utilities.rb:
|
|
5
|
+
# A check for default J2000
|
|
6
|
+
# sets default when arg is nil
|
|
7
|
+
def check_jd_nil(jd = DJ00)
|
|
8
|
+
jd.nil? ? DJ00 : jd
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
# From utilities.rb:
|
|
12
|
+
# A check for default J2000
|
|
13
|
+
# sets default when arg is zero
|
|
14
|
+
def check_jd_zero(jd = DJ00)
|
|
15
|
+
jd == 0 ? DJ00 : check_jd_nil(jd)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
# From utilities.rb:
|
|
19
|
+
# A check for default DT2000
|
|
20
|
+
# sets default when arg is nil
|
|
21
|
+
def check_t_nil(dt = DT2000)
|
|
22
|
+
dt.nil? ? DT2000 : dt
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# From utilities.rb:
|
|
26
|
+
# A check for default DT2000
|
|
27
|
+
# sets default when arg is zero
|
|
28
|
+
def check_t_zero(dt = DT2000)
|
|
29
|
+
dt == 0 ? DT2000 : check_t_nil(dt)
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# From utilities.rb:
|
|
33
|
+
# Keeps large angles in range of 360.0
|
|
34
|
+
# aliased by truncate
|
|
35
|
+
def mod_360(x = 0.0)
|
|
36
|
+
x.nil? ? x = 0.0 : x
|
|
37
|
+
360.0 * (x / 360.0 - Integer(x / 360.0))
|
|
38
|
+
end
|
|
39
|
+
alias_method :truncate, :mod_360
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
if __FILE__ == $PROGRAM_NAME
|
|
43
|
+
|
|
44
|
+
spec = File.expand_path('../../../tests/minitest', __FILE__)
|
|
45
|
+
$LOAD_PATH.unshift(spec) unless $LOAD_PATH.include?(spec)
|
|
46
|
+
require 'utilities_spec'
|
|
47
|
+
require 'aliased_utilities_spec'
|
|
48
|
+
|
|
49
|
+
end
|
data/lib/eot/version.rb
CHANGED
data/lib/eot.rb
CHANGED
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
# eot.rb
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
# require 'multi_xml'
|
|
3
|
+
require 'addressable/uri'
|
|
4
|
+
require 'rest-client'
|
|
5
|
+
require 'json'
|
|
6
|
+
require 'celes'
|
|
7
|
+
require 'date'
|
|
4
8
|
require 'eot/version'
|
|
5
9
|
require 'eot/eot'
|
|
6
10
|
require 'eot/constants'
|
|
7
11
|
require 'eot/init'
|
|
8
12
|
require 'eot/utilities'
|
|
9
13
|
require 'eot/angles'
|
|
14
|
+
require 'eot/deltas'
|
|
15
|
+
require 'eot/trigometric'
|
|
10
16
|
require 'eot/times'
|
|
11
|
-
require 'eot/
|
|
12
|
-
require 'eot/
|
|
13
|
-
require 'eot/geo_lat_lng_smt'
|
|
17
|
+
require 'eot/angle_displays'
|
|
18
|
+
require 'eot/time_displays'
|
|
19
|
+
require 'eot/geo_lat_lng_smt'
|