Class: Astronoby::Ephem
- Inherits:
-
Object
- Object
- Astronoby::Ephem
- Defined in:
- lib/astronoby/ephem.rb
Class Method Summary collapse
-
.download(name:, target:) ⇒ Boolean
Download an ephemeris file.
-
.load(target) ⇒ ::Ephem::SPK
Load an ephemeris file.
Class Method Details
.download(name:, target:) ⇒ Boolean
Download an ephemeris file.
16 17 18 |
# File 'lib/astronoby/ephem.rb', line 16 def self.download(name:, target:) ::Ephem::Download.call(name: name, target: target) end |
.load(target) ⇒ ::Ephem::SPK
Load an ephemeris file.
27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/astronoby/ephem.rb', line 27 def self.load(target) spk = ::Ephem::SPK.open(target) unless ::Ephem::SPK::TYPES.include?(spk&.type) raise( EphemerisError, "#{target} is not a valid type. Accepted: #{::Ephem::SPK::TYPES.join(", ")}" ) end spk end |