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 you to get instances which provide
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
# => -148794597Each of these bodies also provides its own equatorial radius
(Astronoby::Distance).
Astronoby::Venus::EQUATORIAL_RADIUS.meters
# => 6051800For all Solar System bodies, except the Sun and the Earth, the following attributes are available. Note that dynamic values are accessible through instance methods, while absolute values are accessible through class methods.
Size of the body in the sky. Returns a Astronoby::Angle object.
venus.angular_diameter.str(:dms)
# => "+0° 0′ 11.4587″"Constellation where the body appears in the sky as seen from Earth. Returns
a Astronoby::Constellation object.
venus.constellation.name
# => "Cancer"
venus.constellation.abbreviation
# => "Cnc"Apparent angular distance between the body and the Sun, as seen from Earth
("Sun-Earth-object" angle). Returns a Astronoby::Angle object.
venus.elongation.degrees.round
# => 41Whether the body lies east of the Sun (visible in the evening) or west of it
(visible in the morning). Both return a Boolean.
venus.eastern? # => false
venus.western? # => true"Sun-object-Earth" angle. Returns a Astronoby::Angle object.
venus.phase_angle.degrees.round
# => 40Fraction of the object's disk illuminated as seen from Earth. Returns a Float
between 0 and 1.
venus.illuminated_fraction.round(2)
# => 0.88Apparent brightness of the body. Returns a Float.
venus.apparent_magnitude.round(2)
# => -3.89Absolute brightness of the body. Returns a Float.
Astronoby::Venus.absolute_magnitude
# => -4.384- Ephemerides - for understanding data sources
- Reference Frames - for coordinate systems
- Observer - for setting up observation locations
- Angles - for working with angular measurements