Celestial Bodies - rhannequin/astronoby GitHub Wiki

Currently, Astronoby only supports the following major bodies of the Solar System:

  • the Sun (Astronoby::Sun)
  • planets from Mercury to Neptune, including the Earth (Astronoby::Earth, ...)
  • the Moon (Astronoby::Moon)

Given an ephemeris (Astronoby::Ephem) and an instant object (Astronoby::Instant), these classes enable to get instances which provides positions in different reference frames.

You can learn more about ephemerides and reference frames.

ephem = Astronoby::Ephem.load("inpop19a.bsp")
time = Time.utc(2021, 7, 8)
instant = Astronoby::Instant.from_time(time)

venus = Astronoby::Venus.new(ephem: ephem, instant: instant)
apparent_position = venus.apparent.position

apparent_position.x.km.round
# => -148794622

Each of these bodies also provide their own equatorial radius (Astronoby::Distance).

Astronoby::Venus::EQUATORIAL_RADIUS.meters
# => 6051800