Astronoby v0.7.0: Planets and ephemerides

tl;dr at the end After months of refactoring, Astronoby v0.7.0 is released! This new version introduces two major changes: Planets and ephemerides. Quick glossary: An ephemeris is a software or file that helps generating positions and velocities of celestial bodies The plural form is ephemerides Astronoby ❤️ Ephem 5 months ago, Ephem was released, a Ruby library to compute position and velocity vectors of the major planets of the Solar System using SPICE Kernel files (SPK). Ephem is now v0.3.0 and supports two sources of SPK: NASA/JPL Development Ephemeris IMCCE INPOP The new version of Astronoby adds Ephem as a dependency to enable the extreme precision of calculating planet coordinates. The Development Ephemeris files from the JPL are, for instance, used for actual spacecraft navigation. Planets! While only the Sun and the Moon were supported as celestial bodies in previous Astronoby versions, now all the major Solar System planets can be manipulated, from Mercury to Neptune. As an observer on Earth, it is possible to compute with great precision where a planet is in the sky, like the Sun and the Moon. Usage All the changes are documented in the release notes and the whole library is documented in the repository's Wiki, but let me give you a quick look at what is now possible with Astronoby. Download and load an ephemeris The ephemeris is the main source of data for Astronoby, which uses it to compute different kind of positions for different needs. Ephemerides can be downloaded directly using Astronoby. Astronoby::Ephem.download(name: "de440s.bsp", target: "data/ephem.bsp") This will download the file and store it at the specified location. You only need to do it once, you can then load it any time you want to compute data and events with Astronoby. ephem = Astronoby::Ephem.load("data/ephem.bsp") Deal with time with Instant Because ephemerides require extra precision and manipulate a different time scale, the new version of Astronoby introduced Astronoby::Instant, a value object to deal with time scales. You can still use Time and Date, but it is necessary to go through Instant in most calculations. time = Time.utc(2025, 11, 5) instant = Astronoby::Instant.from_time(time) instant.to_time # => 2025-11-05 00:00:00 UTC instant.to_date # => # Instantiate a planet Once you have an ephem and an instant, you have everything you need to instantiate a Solar System body. saturn = Astronoby::Saturn.new(ephem: ephem, instant: instant) From there, you can compute 5 different positions: geometric, astrometric, mean_of_date, apparent and topocentric. Most users will be interested in apparent and topocentric. The apparent position is corrected and geocentric, it describes how the object would be seen from the centre of Earth, while the topocentric position is centred as an observer on Earth. A topocentric position can be computed using an observer object that already existed in the previous versions of Astronoby: observer = Astronoby::Observer.new( latitude: Astronoby::Angle.from_degrees(55.8652), longitude: Astronoby::Angle.from_degrees(-4.3062) ) topocentric = saturn.observed_by(observer) From a topocentric position, you can access horizontal coordinates, which are basically where the object is up/down and left/right in the sky: horizontal = topocentric.horizontal horizontal.altitude.degrees.round(4) # => 20.5112 horizontal.azimuth.degrees.round(4) # => 226.8246 Rising, transit and setting times This new version also introduces a new calculator for rising, transit and setting times, performant and supporting ranges of dates. calculator = Astronoby::RiseTransitSetCalculator.new( body: Astronoby::Saturn, observer: observer, ephem: ephem ) events = calculator.events_between( Time.utc(2025, 11, 1), Time.utc(2025, 11, 3) ) events.rising_times # => [2025-11-01 15:40:09 UTC, 2025-11-02 15:36:09 UTC] events.transit_times # => [2025-11-01 21:19:55 UTC, 2025-11-02 21:15:49 UTC] events.setting_times # => [2025-11-01 03:03:49 UTC, 2025-11-02 02:59:38 UTC] It is still possible to compute Moon phases, twilight times and other data, check out the Wiki to discover all the library's features. Precision Not only does this new version enable the user to manipulate Solar System planets, but it also does it with extreme precision. Topocentric positions from Astronoby have an error margin of less than 10 arc seconds, which corresponds to half the size of Saturn in the sky when it is the closest to Earth. This precision is by far enough to guide automatically any amateur telescope. Conclusion This new version enables Astronoby to enter a new phase: computing any phenomenon with accuracy. Thanks to the help of ephemerides, Astronoby has access to extremely precise data and can use it in algorithms and provide many more features in the

May 12, 2025 - 11:26
 0
Astronoby v0.7.0: Planets and ephemerides

tl;dr at the end

After months of refactoring, Astronoby v0.7.0 is released!

This new version introduces two major changes: Planets and ephemerides.

Quick glossary:

  • An ephemeris is a software or file that helps generating positions and velocities of celestial bodies
  • The plural form is ephemerides

Astronoby ❤️ Ephem

5 months ago, Ephem was released, a Ruby library to compute position and velocity vectors of the major planets of the Solar System using SPICE Kernel files (SPK).

Ephem is now v0.3.0 and supports two sources of SPK:

The new version of Astronoby adds Ephem as a dependency to enable the extreme precision of calculating planet coordinates. The Development Ephemeris files from the JPL are, for instance, used for actual spacecraft navigation.

Planets!

While only the Sun and the Moon were supported as celestial bodies in previous Astronoby versions, now all the major Solar System planets can be manipulated, from Mercury to Neptune.

As an observer on Earth, it is possible to compute with great precision where a planet is in the sky, like the Sun and the Moon.

Usage

All the changes are documented in the release notes and the whole library is documented in the repository's Wiki, but let me give you a quick look at what is now possible with Astronoby.

Download and load an ephemeris

The ephemeris is the main source of data for Astronoby, which uses it to compute different kind of positions for different needs.

Ephemerides can be downloaded directly using Astronoby.

Astronoby::Ephem.download(name: "de440s.bsp", target: "data/ephem.bsp")

This will download the file and store it at the specified location. You only need to do it once, you can then load it any time you want to compute data and events with Astronoby.

ephem = Astronoby::Ephem.load("data/ephem.bsp")

Deal with time with Instant

Because ephemerides require extra precision and manipulate a different time scale, the new version of Astronoby introduced Astronoby::Instant, a value object to deal with time scales.

You can still use Time and Date, but it is necessary to go through Instant in most calculations.

time = Time.utc(2025, 11, 5)

instant = Astronoby::Instant.from_time(time)

instant.to_time
# => 2025-11-05 00:00:00 UTC
instant.to_date
# => #

Instantiate a planet

Once you have an ephem and an instant, you have everything you need to instantiate a Solar System body.

saturn = Astronoby::Saturn.new(ephem: ephem, instant: instant)

From there, you can compute 5 different positions: geometric, astrometric, mean_of_date, apparent and topocentric.

Most users will be interested in apparent and topocentric. The apparent position is corrected and geocentric, it describes how the object would be seen from the centre of Earth, while the topocentric position is centred as an observer on Earth.

A topocentric position can be computed using an observer object that already existed in the previous versions of Astronoby:

observer = Astronoby::Observer.new(
  latitude: Astronoby::Angle.from_degrees(55.8652),
  longitude: Astronoby::Angle.from_degrees(-4.3062)
)

topocentric = saturn.observed_by(observer)

From a topocentric position, you can access horizontal coordinates, which are basically where the object is up/down and left/right in the sky:

horizontal = topocentric.horizontal

horizontal.altitude.degrees.round(4)
# => 20.5112

horizontal.azimuth.degrees.round(4)
# => 226.8246

Rising, transit and setting times

This new version also introduces a new calculator for rising, transit and setting times, performant and supporting ranges of dates.

calculator = Astronoby::RiseTransitSetCalculator.new(
  body: Astronoby::Saturn,
  observer: observer,
  ephem: ephem
)

events = calculator.events_between(
  Time.utc(2025, 11, 1),
  Time.utc(2025, 11, 3)
)

events.rising_times
# => [2025-11-01 15:40:09 UTC, 2025-11-02 15:36:09 UTC]

events.transit_times
# => [2025-11-01 21:19:55 UTC, 2025-11-02 21:15:49 UTC]

events.setting_times
# => [2025-11-01 03:03:49 UTC, 2025-11-02 02:59:38 UTC]

It is still possible to compute Moon phases, twilight times and other data, check out the Wiki to discover all the library's features.

Precision

Not only does this new version enable the user to manipulate Solar System planets, but it also does it with extreme precision.

Topocentric positions from Astronoby have an error margin of less than 10 arc seconds, which corresponds to half the size of Saturn in the sky when it is the closest to Earth.

This precision is by far enough to guide automatically any amateur telescope.

Conclusion

This new version enables Astronoby to enter a new phase: computing any phenomenon with accuracy. Thanks to the help of ephemerides, Astronoby has access to extremely precise data and can use it in algorithms and provide many more features in the future.

While I was limited to the data provided by the few books the library was based on, with ephemerides Astronoby can be autonomous and write its own story.

Don't hesitate to reach out to me here or on GitHub if you have any question or for support to integrate this new version, I will be more than happy to help.

tl;dr

  • Astronoby v0.7.0 is out
  • It uses Ephem for extreme accuracy
  • All planets of the Solar System can be observed from Earth

Credit cover picture: https://gostargazing.co.uk