astronoby 0.8.0 → 0.9.0
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/CHANGELOG.md +58 -0
- data/README.md +6 -4
- data/UPGRADING.md +25 -0
- data/docs/README.md +30 -2
- data/docs/angles.md +1 -1
- data/docs/coordinates.md +1 -1
- data/docs/deep_sky_bodies.md +101 -0
- data/docs/ephem.md +1 -1
- data/docs/instant.md +1 -1
- data/docs/moon_phases.md +1 -1
- data/docs/observer.md +1 -1
- data/docs/reference_frames.md +1 -1
- data/docs/rise_transit_set_times.md +5 -5
- data/docs/{celestial_bodies.md → solar_system_bodies.md} +1 -1
- data/lib/astronoby/angle.rb +6 -2
- data/lib/astronoby/angular_velocity.rb +76 -0
- data/lib/astronoby/bodies/deep_sky_object.rb +44 -0
- data/lib/astronoby/bodies/deep_sky_object_position.rb +127 -0
- data/lib/astronoby/bodies/earth.rb +5 -1
- data/lib/astronoby/bodies/moon.rb +21 -0
- data/lib/astronoby/bodies/solar_system_body.rb +25 -0
- data/lib/astronoby/cache.rb +1 -0
- data/lib/astronoby/constants.rb +7 -2
- data/lib/astronoby/coordinates/equatorial.rb +2 -5
- data/lib/astronoby/distance.rb +6 -0
- data/lib/astronoby/events/extremum_calculator.rb +233 -0
- data/lib/astronoby/events/extremum_event.rb +15 -0
- data/lib/astronoby/events/rise_transit_set_calculator.rb +9 -6
- data/lib/astronoby/events/twilight_calculator.rb +1 -1
- data/lib/astronoby/instant.rb +27 -4
- data/lib/astronoby/reference_frames/apparent.rb +0 -10
- data/lib/astronoby/reference_frames/topocentric.rb +1 -1
- data/lib/astronoby/stellar_propagation.rb +162 -0
- data/lib/astronoby/time/greenwich_apparent_sidereal_time.rb +22 -0
- data/lib/astronoby/time/greenwich_mean_sidereal_time.rb +64 -0
- data/lib/astronoby/time/greenwich_sidereal_time.rb +20 -58
- data/lib/astronoby/time/local_apparent_sidereal_time.rb +42 -0
- data/lib/astronoby/time/local_mean_sidereal_time.rb +42 -0
- data/lib/astronoby/time/local_sidereal_time.rb +35 -26
- data/lib/astronoby/time/sidereal_time.rb +42 -0
- data/lib/astronoby/util/time.rb +61 -43
- data/lib/astronoby/velocity.rb +5 -0
- data/lib/astronoby/version.rb +1 -1
- data/lib/astronoby.rb +11 -0
- metadata +14 -2
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Astronoby
|
|
4
|
+
class GreenwichApparentSiderealTime < GreenwichSiderealTime
|
|
5
|
+
def self.from_utc(utc)
|
|
6
|
+
gmst = GreenwichMeanSiderealTime.from_utc(utc)
|
|
7
|
+
instant = Instant.from_time(utc)
|
|
8
|
+
nutation = Nutation.new(instant: instant)
|
|
9
|
+
mean_obliquity = MeanObliquity.at(instant)
|
|
10
|
+
|
|
11
|
+
equation_of_equinoxes = nutation.nutation_in_longitude.hours *
|
|
12
|
+
mean_obliquity.cos
|
|
13
|
+
gast_time = normalize_time(gmst.time + equation_of_equinoxes)
|
|
14
|
+
|
|
15
|
+
new(date: gmst.date, time: gast_time)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def initialize(date:, time:)
|
|
19
|
+
super(date: date, time: time, type: APPARENT)
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Astronoby
|
|
4
|
+
class GreenwichMeanSiderealTime < GreenwichSiderealTime
|
|
5
|
+
JULIAN_CENTURIES_EXPONENTS = [
|
|
6
|
+
6.697374558,
|
|
7
|
+
2400.051336,
|
|
8
|
+
0.000025862
|
|
9
|
+
].freeze
|
|
10
|
+
|
|
11
|
+
SIDEREAL_MINUTE_IN_UT_MINUTE = 0.9972695663
|
|
12
|
+
|
|
13
|
+
# Source:
|
|
14
|
+
# Title: Practical Astronomy with your Calculator or Spreadsheet
|
|
15
|
+
# Authors: Peter Duffett-Smith and Jonathan Zwart
|
|
16
|
+
# Edition: Cambridge University Press
|
|
17
|
+
# Chapter: 12 - Conversion of UT to Greenwich sidereal time (GST)
|
|
18
|
+
def self.from_utc(utc)
|
|
19
|
+
date = utc.to_date
|
|
20
|
+
julian_day = utc.to_date.ajd
|
|
21
|
+
t = (julian_day - JulianDate::J2000) / Constants::DAYS_PER_JULIAN_CENTURY
|
|
22
|
+
t0 = (
|
|
23
|
+
(JULIAN_CENTURIES_EXPONENTS[0] +
|
|
24
|
+
(JULIAN_CENTURIES_EXPONENTS[1] * t) +
|
|
25
|
+
(JULIAN_CENTURIES_EXPONENTS[2] * t * t)) % Constants::HOURS_PER_DAY
|
|
26
|
+
).abs
|
|
27
|
+
|
|
28
|
+
ut_in_hours = utc.hour +
|
|
29
|
+
utc.min / Constants::MINUTES_PER_HOUR +
|
|
30
|
+
(utc.sec + utc.subsec) / Constants::SECONDS_PER_HOUR
|
|
31
|
+
|
|
32
|
+
gmst = normalize_time(1.002737909 * ut_in_hours + t0)
|
|
33
|
+
|
|
34
|
+
new(date: date, time: gmst)
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
def initialize(date:, time:)
|
|
38
|
+
super(date: date, time: time, type: MEAN)
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Source:
|
|
42
|
+
# Title: Practical Astronomy with your Calculator or Spreadsheet
|
|
43
|
+
# Authors: Peter Duffett-Smith and Jonathan Zwart
|
|
44
|
+
# Edition: Cambridge University Press
|
|
45
|
+
# Chapter: 13 - Conversion of GST to UT
|
|
46
|
+
def to_utc
|
|
47
|
+
date = @date
|
|
48
|
+
julian_day = @date.ajd
|
|
49
|
+
t = (julian_day - JulianDate::J2000) / Constants::DAYS_PER_JULIAN_CENTURY
|
|
50
|
+
|
|
51
|
+
t0 = (
|
|
52
|
+
(JULIAN_CENTURIES_EXPONENTS[0] +
|
|
53
|
+
(JULIAN_CENTURIES_EXPONENTS[1] * t) +
|
|
54
|
+
(JULIAN_CENTURIES_EXPONENTS[2] * t * t)) % Constants::HOURS_PER_DAY
|
|
55
|
+
).abs
|
|
56
|
+
|
|
57
|
+
a = normalize_time(@time - t0)
|
|
58
|
+
|
|
59
|
+
utc = SIDEREAL_MINUTE_IN_UT_MINUTE * a
|
|
60
|
+
|
|
61
|
+
Util::Time.decimal_hour_to_time(date, 0, utc)
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
end
|
|
@@ -1,71 +1,33 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
module Astronoby
|
|
4
|
-
class GreenwichSiderealTime
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
# Source:
|
|
16
|
-
# Title: Practical Astronomy with your Calculator or Spreadsheet
|
|
17
|
-
# Authors: Peter Duffett-Smith and Jonathan Zwart
|
|
18
|
-
# Edition: Cambridge University Press
|
|
19
|
-
# Chapter: 12 - Conversion of UT to Greenwich sidereal time (GST)
|
|
20
|
-
def self.from_utc(utc)
|
|
21
|
-
date = utc.to_date
|
|
22
|
-
julian_day = utc.to_date.ajd
|
|
23
|
-
t = (julian_day - JulianDate::J2000) / Constants::DAYS_PER_JULIAN_CENTURY
|
|
24
|
-
t0 = (
|
|
25
|
-
(JULIAN_CENTURIES_EXPONENTS[0] +
|
|
26
|
-
(JULIAN_CENTURIES_EXPONENTS[1] * t) +
|
|
27
|
-
(JULIAN_CENTURIES_EXPONENTS[2] * t * t)) % Constants::HOURS_PER_DAY
|
|
28
|
-
).abs
|
|
29
|
-
|
|
30
|
-
ut_in_hours = utc.hour +
|
|
31
|
-
utc.min / Constants::MINUTES_PER_HOUR +
|
|
32
|
-
(utc.sec + utc.subsec) / Constants::SECONDS_PER_HOUR
|
|
33
|
-
|
|
34
|
-
gmst = 1.002737909 * ut_in_hours + t0
|
|
35
|
-
gmst += Constants::HOURS_PER_DAY if gmst.negative?
|
|
36
|
-
gmst -= Constants::HOURS_PER_DAY if gmst > Constants::HOURS_PER_DAY
|
|
4
|
+
class GreenwichSiderealTime < SiderealTime
|
|
5
|
+
def self.from_utc(utc, type: MEAN)
|
|
6
|
+
validate_type!(type)
|
|
7
|
+
case type
|
|
8
|
+
when MEAN
|
|
9
|
+
GreenwichMeanSiderealTime.from_utc(utc)
|
|
10
|
+
when APPARENT
|
|
11
|
+
GreenwichApparentSiderealTime.from_utc(utc)
|
|
12
|
+
end
|
|
13
|
+
end
|
|
37
14
|
|
|
38
|
-
|
|
15
|
+
def self.mean_from_utc(utc)
|
|
16
|
+
GreenwichMeanSiderealTime.from_utc(utc)
|
|
39
17
|
end
|
|
40
18
|
|
|
41
|
-
def
|
|
42
|
-
|
|
43
|
-
@time = time
|
|
19
|
+
def self.apparent_from_utc(utc)
|
|
20
|
+
GreenwichApparentSiderealTime.from_utc(utc)
|
|
44
21
|
end
|
|
45
22
|
|
|
46
|
-
# Source:
|
|
47
|
-
# Title: Practical Astronomy with your Calculator or Spreadsheet
|
|
48
|
-
# Authors: Peter Duffett-Smith and Jonathan Zwart
|
|
49
|
-
# Edition: Cambridge University Press
|
|
50
|
-
# Chapter: 13 - Conversion of GST to UT
|
|
51
23
|
def to_utc
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
t0 = (
|
|
57
|
-
(JULIAN_CENTURIES_EXPONENTS[0] +
|
|
58
|
-
(JULIAN_CENTURIES_EXPONENTS[1] * t) +
|
|
59
|
-
(JULIAN_CENTURIES_EXPONENTS[2] * t * t)) % Constants::HOURS_PER_DAY
|
|
60
|
-
).abs
|
|
61
|
-
|
|
62
|
-
a = @time - t0
|
|
63
|
-
a += Constants::HOURS_PER_DAY if a.negative?
|
|
64
|
-
a -= Constants::HOURS_PER_DAY if a > Constants::HOURS_PER_DAY
|
|
65
|
-
|
|
66
|
-
utc = SIDEREAL_MINUTE_IN_UT_MINUTE * a
|
|
24
|
+
unless mean?
|
|
25
|
+
raise NotImplementedError,
|
|
26
|
+
"UTC conversion only supported for mean sidereal time"
|
|
27
|
+
end
|
|
67
28
|
|
|
68
|
-
|
|
29
|
+
gmst = GreenwichMeanSiderealTime.new(date: @date, time: @time)
|
|
30
|
+
gmst.to_utc
|
|
69
31
|
end
|
|
70
32
|
|
|
71
33
|
def to_lst(longitude:)
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Astronoby
|
|
4
|
+
class LocalApparentSiderealTime < LocalSiderealTime
|
|
5
|
+
# Source:
|
|
6
|
+
# Title: Practical Astronomy with your Calculator or Spreadsheet
|
|
7
|
+
# Authors: Peter Duffett-Smith and Jonathan Zwart
|
|
8
|
+
# Edition: Cambridge University Press
|
|
9
|
+
# Chapter: 14 - Local sidereal time (LST)
|
|
10
|
+
def self.from_gst(gst:, longitude:)
|
|
11
|
+
unless gst.apparent?
|
|
12
|
+
raise ArgumentError, "GST must be apparent sidereal time"
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
date = gst.date
|
|
16
|
+
time = normalize_time(gst.time + longitude.hours)
|
|
17
|
+
|
|
18
|
+
new(date: date, time: time, longitude: longitude)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def self.from_utc(utc, longitude:)
|
|
22
|
+
gast = GreenwichApparentSiderealTime.from_utc(utc)
|
|
23
|
+
from_gst(gst: gast, longitude: longitude)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def initialize(date:, time:, longitude:)
|
|
27
|
+
super(date: date, time: time, longitude: longitude, type: APPARENT)
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Source:
|
|
31
|
+
# Title: Practical Astronomy with your Calculator or Spreadsheet
|
|
32
|
+
# Authors: Peter Duffett-Smith and Jonathan Zwart
|
|
33
|
+
# Edition: Cambridge University Press
|
|
34
|
+
# Chapter: 15 - Converting LST to GST
|
|
35
|
+
def to_gst
|
|
36
|
+
date = @date
|
|
37
|
+
time = normalize_time(@time - @longitude.hours)
|
|
38
|
+
|
|
39
|
+
GreenwichApparentSiderealTime.new(date: date, time: time)
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Astronoby
|
|
4
|
+
class LocalMeanSiderealTime < LocalSiderealTime
|
|
5
|
+
# Source:
|
|
6
|
+
# Title: Practical Astronomy with your Calculator or Spreadsheet
|
|
7
|
+
# Authors: Peter Duffett-Smith and Jonathan Zwart
|
|
8
|
+
# Edition: Cambridge University Press
|
|
9
|
+
# Chapter: 14 - Local sidereal time (LST)
|
|
10
|
+
def self.from_gst(gst:, longitude:)
|
|
11
|
+
unless gst.mean?
|
|
12
|
+
raise ArgumentError, "GST must be mean sidereal time"
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
date = gst.date
|
|
16
|
+
time = normalize_time(gst.time + longitude.hours)
|
|
17
|
+
|
|
18
|
+
new(date: date, time: time, longitude: longitude)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def self.from_utc(utc, longitude:)
|
|
22
|
+
gmst = GreenwichMeanSiderealTime.from_utc(utc)
|
|
23
|
+
from_gst(gst: gmst, longitude: longitude)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def initialize(date:, time:, longitude:)
|
|
27
|
+
super(date: date, time: time, longitude: longitude, type: MEAN)
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Source:
|
|
31
|
+
# Title: Practical Astronomy with your Calculator or Spreadsheet
|
|
32
|
+
# Authors: Peter Duffett-Smith and Jonathan Zwart
|
|
33
|
+
# Edition: Cambridge University Press
|
|
34
|
+
# Chapter: 15 - Converting LST to GST
|
|
35
|
+
def to_gst
|
|
36
|
+
date = @date
|
|
37
|
+
time = normalize_time(@time - @longitude.hours)
|
|
38
|
+
|
|
39
|
+
GreenwichMeanSiderealTime.new(date: date, time: time)
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
@@ -1,41 +1,50 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
module Astronoby
|
|
4
|
-
class LocalSiderealTime
|
|
5
|
-
attr_reader :
|
|
4
|
+
class LocalSiderealTime < SiderealTime
|
|
5
|
+
attr_reader :longitude
|
|
6
6
|
|
|
7
|
-
# Source:
|
|
8
|
-
# Title: Practical Astronomy with your Calculator or Spreadsheet
|
|
9
|
-
# Authors: Peter Duffett-Smith and Jonathan Zwart
|
|
10
|
-
# Edition: Cambridge University Press
|
|
11
|
-
# Chapter: 14 - Local sidereal time (LST)
|
|
12
7
|
def self.from_gst(gst:, longitude:)
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
8
|
+
case gst.type
|
|
9
|
+
when MEAN
|
|
10
|
+
LocalMeanSiderealTime.from_gst(gst: gst, longitude: longitude)
|
|
11
|
+
when APPARENT
|
|
12
|
+
LocalApparentSiderealTime.from_gst(gst: gst, longitude: longitude)
|
|
13
|
+
end
|
|
14
|
+
end
|
|
17
15
|
|
|
18
|
-
|
|
16
|
+
def self.from_utc(utc, longitude:, type: MEAN)
|
|
17
|
+
validate_type!(type)
|
|
18
|
+
case type
|
|
19
|
+
when MEAN
|
|
20
|
+
LocalMeanSiderealTime.from_utc(utc, longitude: longitude)
|
|
21
|
+
when APPARENT
|
|
22
|
+
LocalApparentSiderealTime.from_utc(utc, longitude: longitude)
|
|
23
|
+
end
|
|
19
24
|
end
|
|
20
25
|
|
|
21
|
-
def initialize(date:, time:, longitude:)
|
|
22
|
-
|
|
23
|
-
@time = time
|
|
26
|
+
def initialize(date:, time:, longitude:, type: MEAN)
|
|
27
|
+
super(date: date, time: time, type: type)
|
|
24
28
|
@longitude = longitude
|
|
25
29
|
end
|
|
26
30
|
|
|
27
|
-
# Source:
|
|
28
|
-
# Title: Practical Astronomy with your Calculator or Spreadsheet
|
|
29
|
-
# Authors: Peter Duffett-Smith and Jonathan Zwart
|
|
30
|
-
# Edition: Cambridge University Press
|
|
31
|
-
# Chapter: 15 - Converting LST to GST
|
|
32
31
|
def to_gst
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
32
|
+
case @type
|
|
33
|
+
when MEAN
|
|
34
|
+
lst = LocalMeanSiderealTime.new(
|
|
35
|
+
date: @date,
|
|
36
|
+
time: @time,
|
|
37
|
+
longitude: @longitude
|
|
38
|
+
)
|
|
39
|
+
lst.to_gst
|
|
40
|
+
when APPARENT
|
|
41
|
+
last = LocalApparentSiderealTime.new(
|
|
42
|
+
date: @date,
|
|
43
|
+
time: @time,
|
|
44
|
+
longitude: @longitude
|
|
45
|
+
)
|
|
46
|
+
last.to_gst
|
|
47
|
+
end
|
|
39
48
|
end
|
|
40
49
|
end
|
|
41
50
|
end
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Astronoby
|
|
4
|
+
class SiderealTime
|
|
5
|
+
TYPES = [
|
|
6
|
+
MEAN = :mean,
|
|
7
|
+
APPARENT = :apparent
|
|
8
|
+
].freeze
|
|
9
|
+
|
|
10
|
+
attr_reader :date, :time, :type
|
|
11
|
+
|
|
12
|
+
def self.normalize_time(time)
|
|
13
|
+
time += Constants::HOURS_PER_DAY if time.negative?
|
|
14
|
+
time -= Constants::HOURS_PER_DAY if time > Constants::HOURS_PER_DAY
|
|
15
|
+
time
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def self.validate_type!(type)
|
|
19
|
+
unless TYPES.include?(type)
|
|
20
|
+
raise ArgumentError, "Invalid type: #{type}. Must be one of #{TYPES}"
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def initialize(date:, time:, type: MEAN)
|
|
25
|
+
@date = date
|
|
26
|
+
@time = time
|
|
27
|
+
@type = type
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def mean?
|
|
31
|
+
@type == MEAN
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def apparent?
|
|
35
|
+
@type == APPARENT
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def normalize_time(time)
|
|
39
|
+
self.class.normalize_time(time)
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
data/lib/astronoby/util/time.rb
CHANGED
|
@@ -4,7 +4,7 @@ module Astronoby
|
|
|
4
4
|
module Util
|
|
5
5
|
module Time
|
|
6
6
|
OLD_LEAP_SECONDS = {
|
|
7
|
-
2378496.5 => 13.188148343557259,
|
|
7
|
+
2378496.5 => 13.188148343557259, # 1800-01-01T00:00:00+00:00
|
|
8
8
|
2378677.5 => 12.977779959648615,
|
|
9
9
|
2378861.5 => 12.789307379498496,
|
|
10
10
|
2379042.5 => 12.627219619724201,
|
|
@@ -400,52 +400,70 @@ module Astronoby
|
|
|
400
400
|
2450265.5 => 61.2837935622083,
|
|
401
401
|
2450449.5 => 61.96410528309934,
|
|
402
402
|
2450630.5 => 62.7581330776884,
|
|
403
|
-
2450814.5 =>
|
|
404
|
-
2450995.5 => 63,
|
|
405
|
-
2451179.5 =>
|
|
403
|
+
2450814.5 => 62.966,
|
|
404
|
+
2450995.5 => 63.284,
|
|
405
|
+
2451179.5 => 63.467,
|
|
406
|
+
2451360.5 => 63.664 # 1999-07-01T00:00:00+00:00
|
|
406
407
|
}.freeze
|
|
407
408
|
|
|
408
409
|
RECENT_LEAP_SECONDS = {
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
410
|
+
2451544.5 => 63.829, # 2000-01-01T00:00:00+00:00
|
|
411
|
+
2451726.5 => 63.980,
|
|
412
|
+
2451910.5 => 64.091,
|
|
413
|
+
2452091.5 => 64.212,
|
|
414
|
+
2452275.5 => 64.300,
|
|
415
|
+
2452456.5 => 64.413,
|
|
416
|
+
2452640.5 => 64.473,
|
|
417
|
+
2452821.5 => 64.551,
|
|
418
|
+
2453005.5 => 64.574,
|
|
419
|
+
2453187.5 => 64.653,
|
|
420
|
+
2453371.5 => 64.688,
|
|
421
|
+
2453552.5 => 64.799,
|
|
422
|
+
2453736.5 => 64.845,
|
|
423
|
+
2453917.5 => 64.989,
|
|
424
|
+
2454101.5 => 65.146,
|
|
425
|
+
2454282.5 => 65.341,
|
|
426
|
+
2454466.5 => 65.457,
|
|
427
|
+
2454648.5 => 65.629,
|
|
428
|
+
2454832.5 => 65.777,
|
|
429
|
+
2455013.5 => 65.951,
|
|
430
|
+
2455197.5 => 66.070,
|
|
431
|
+
2455378.5 => 66.241,
|
|
432
|
+
2455562.5 => 66.325,
|
|
433
|
+
2455743.5 => 66.475,
|
|
434
|
+
2455927.5 => 66.603,
|
|
435
|
+
2456109.5 => 66.771,
|
|
436
|
+
2456293.5 => 66.907,
|
|
437
|
+
2456474.5 => 67.127,
|
|
438
|
+
2456658.5 => 67.281,
|
|
439
|
+
2456839.5 => 67.486,
|
|
440
|
+
2457023.5 => 67.644,
|
|
441
|
+
2457204.5 => 67.861,
|
|
442
|
+
2457388.5 => 68.102,
|
|
443
|
+
2457570.5 => 68.396,
|
|
444
|
+
2457754.5 => 68.593,
|
|
445
|
+
2457935.5 => 68.824,
|
|
446
|
+
2458119.5 => 68.968,
|
|
447
|
+
2458300.5 => 69.113,
|
|
448
|
+
2458484.5 => 69.220,
|
|
449
|
+
2458665.5 => 69.358,
|
|
450
|
+
2458849.5 => 69.361,
|
|
451
|
+
2459031.5 => 69.424,
|
|
452
|
+
2459215.5 => 69.359,
|
|
453
|
+
2459396.5 => 69.351,
|
|
454
|
+
2459580.5 => 69.294,
|
|
455
|
+
2459761.5 => 69.253,
|
|
456
|
+
2459945.5 => 69.204,
|
|
457
|
+
2460126.5 => 69.220,
|
|
458
|
+
2460310.5 => 69.175,
|
|
459
|
+
2460492.5 => 69.188,
|
|
460
|
+
2460676.5 => 69.138,
|
|
461
|
+
2460857.5 => 69.139 # 2025-07-01T00:00:00+00:00
|
|
445
462
|
}.freeze
|
|
446
463
|
|
|
447
464
|
OLDEST_JD = 2378496.5
|
|
448
|
-
|
|
465
|
+
FIRST_RECENT_JD = 2451544.5
|
|
466
|
+
MOST_RECENT_JD = 2460857.5
|
|
449
467
|
|
|
450
468
|
# @param date [Date]
|
|
451
469
|
# @param decimal [Numeric] Hour of the day, in decimal hours
|
|
@@ -502,10 +520,10 @@ module Astronoby
|
|
|
502
520
|
"Expected a Numeric, Time, Date or DateTime object, got #{instant.class}"
|
|
503
521
|
end
|
|
504
522
|
|
|
505
|
-
return RECENT_LEAP_SECONDS[MOST_RECENT_JD] if jd >=
|
|
523
|
+
return RECENT_LEAP_SECONDS[MOST_RECENT_JD] if jd >= MOST_RECENT_JD
|
|
506
524
|
return 0 if jd < OLDEST_JD
|
|
507
525
|
|
|
508
|
-
if jd >=
|
|
526
|
+
if jd >= FIRST_RECENT_JD
|
|
509
527
|
closest_jd = RECENT_LEAP_SECONDS.keys.bsearch { |key| key >= jd }
|
|
510
528
|
leap_seconds = RECENT_LEAP_SECONDS[closest_jd]
|
|
511
529
|
else
|
data/lib/astronoby/velocity.rb
CHANGED
|
@@ -40,6 +40,11 @@ module Astronoby
|
|
|
40
40
|
end
|
|
41
41
|
alias_method :vector_from_mps, :vector_from_meters_per_second
|
|
42
42
|
|
|
43
|
+
def vector_from_astronomical_units_per_day(array)
|
|
44
|
+
Vector.elements(array.map { from_aupd(_1) })
|
|
45
|
+
end
|
|
46
|
+
alias_method :vector_from_aupd, :vector_from_astronomical_units_per_day
|
|
47
|
+
|
|
43
48
|
def light_speed
|
|
44
49
|
from_meters_per_second(Constants::LIGHT_SPEED_M_PER_S)
|
|
45
50
|
end
|
data/lib/astronoby/version.rb
CHANGED
data/lib/astronoby.rb
CHANGED
|
@@ -6,6 +6,7 @@ require "astronoby/constants"
|
|
|
6
6
|
require "astronoby/angle"
|
|
7
7
|
require "astronoby/angles/dms"
|
|
8
8
|
require "astronoby/angles/hms"
|
|
9
|
+
require "astronoby/angular_velocity"
|
|
9
10
|
require "astronoby/constellation"
|
|
10
11
|
require "astronoby/constellations/repository"
|
|
11
12
|
require "astronoby/constellations/data"
|
|
@@ -33,9 +34,13 @@ require "astronoby/coordinates/equatorial"
|
|
|
33
34
|
require "astronoby/coordinates/horizontal"
|
|
34
35
|
require "astronoby/corrections/light_time_delay"
|
|
35
36
|
require "astronoby/aberration"
|
|
37
|
+
require "astronoby/bodies/deep_sky_object"
|
|
38
|
+
require "astronoby/bodies/deep_sky_object_position"
|
|
36
39
|
require "astronoby/deflection"
|
|
37
40
|
require "astronoby/equinox_solstice"
|
|
38
41
|
require "astronoby/errors"
|
|
42
|
+
require "astronoby/events/extremum_event"
|
|
43
|
+
require "astronoby/events/extremum_calculator"
|
|
39
44
|
require "astronoby/events/moon_phases"
|
|
40
45
|
require "astronoby/events/rise_transit_set_event"
|
|
41
46
|
require "astronoby/events/rise_transit_set_events"
|
|
@@ -56,8 +61,14 @@ require "astronoby/reference_frames/mean_of_date"
|
|
|
56
61
|
require "astronoby/reference_frames/apparent"
|
|
57
62
|
require "astronoby/reference_frames/topocentric"
|
|
58
63
|
require "astronoby/refraction"
|
|
64
|
+
require "astronoby/stellar_propagation"
|
|
65
|
+
require "astronoby/time/sidereal_time"
|
|
59
66
|
require "astronoby/time/greenwich_sidereal_time"
|
|
67
|
+
require "astronoby/time/greenwich_mean_sidereal_time"
|
|
68
|
+
require "astronoby/time/greenwich_apparent_sidereal_time"
|
|
60
69
|
require "astronoby/time/local_sidereal_time"
|
|
70
|
+
require "astronoby/time/local_mean_sidereal_time"
|
|
71
|
+
require "astronoby/time/local_apparent_sidereal_time"
|
|
61
72
|
require "astronoby/util/maths"
|
|
62
73
|
require "astronoby/util/time"
|
|
63
74
|
require "astronoby/util/trigonometry"
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: astronoby
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.9.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Rémy Hannequin
|
|
@@ -154,9 +154,9 @@ files:
|
|
|
154
154
|
- UPGRADING.md
|
|
155
155
|
- docs/README.md
|
|
156
156
|
- docs/angles.md
|
|
157
|
-
- docs/celestial_bodies.md
|
|
158
157
|
- docs/configuration.md
|
|
159
158
|
- docs/coordinates.md
|
|
159
|
+
- docs/deep_sky_bodies.md
|
|
160
160
|
- docs/ephem.md
|
|
161
161
|
- docs/equinoxes_solstices_times.md
|
|
162
162
|
- docs/glossary.md
|
|
@@ -165,13 +165,17 @@ files:
|
|
|
165
165
|
- docs/observer.md
|
|
166
166
|
- docs/reference_frames.md
|
|
167
167
|
- docs/rise_transit_set_times.md
|
|
168
|
+
- docs/solar_system_bodies.md
|
|
168
169
|
- docs/twilight_times.md
|
|
169
170
|
- lib/astronoby.rb
|
|
170
171
|
- lib/astronoby/aberration.rb
|
|
171
172
|
- lib/astronoby/angle.rb
|
|
172
173
|
- lib/astronoby/angles/dms.rb
|
|
173
174
|
- lib/astronoby/angles/hms.rb
|
|
175
|
+
- lib/astronoby/angular_velocity.rb
|
|
174
176
|
- lib/astronoby/astronomical_models/moon_phases_periodic_terms.rb
|
|
177
|
+
- lib/astronoby/bodies/deep_sky_object.rb
|
|
178
|
+
- lib/astronoby/bodies/deep_sky_object_position.rb
|
|
175
179
|
- lib/astronoby/bodies/earth.rb
|
|
176
180
|
- lib/astronoby/bodies/jupiter.rb
|
|
177
181
|
- lib/astronoby/bodies/mars.rb
|
|
@@ -204,6 +208,8 @@ files:
|
|
|
204
208
|
- lib/astronoby/ephem.rb
|
|
205
209
|
- lib/astronoby/equinox_solstice.rb
|
|
206
210
|
- lib/astronoby/errors.rb
|
|
211
|
+
- lib/astronoby/events/extremum_calculator.rb
|
|
212
|
+
- lib/astronoby/events/extremum_event.rb
|
|
207
213
|
- lib/astronoby/events/moon_phases.rb
|
|
208
214
|
- lib/astronoby/events/rise_transit_set_calculator.rb
|
|
209
215
|
- lib/astronoby/events/rise_transit_set_event.rb
|
|
@@ -226,8 +232,14 @@ files:
|
|
|
226
232
|
- lib/astronoby/reference_frames/mean_of_date.rb
|
|
227
233
|
- lib/astronoby/reference_frames/topocentric.rb
|
|
228
234
|
- lib/astronoby/refraction.rb
|
|
235
|
+
- lib/astronoby/stellar_propagation.rb
|
|
236
|
+
- lib/astronoby/time/greenwich_apparent_sidereal_time.rb
|
|
237
|
+
- lib/astronoby/time/greenwich_mean_sidereal_time.rb
|
|
229
238
|
- lib/astronoby/time/greenwich_sidereal_time.rb
|
|
239
|
+
- lib/astronoby/time/local_apparent_sidereal_time.rb
|
|
240
|
+
- lib/astronoby/time/local_mean_sidereal_time.rb
|
|
230
241
|
- lib/astronoby/time/local_sidereal_time.rb
|
|
242
|
+
- lib/astronoby/time/sidereal_time.rb
|
|
231
243
|
- lib/astronoby/true_obliquity.rb
|
|
232
244
|
- lib/astronoby/util/maths.rb
|
|
233
245
|
- lib/astronoby/util/time.rb
|