Skip to content

Latest commit

 

History

History
129 lines (90 loc) · 2.88 KB

File metadata and controls

129 lines (90 loc) · 2.88 KB

Solar System Bodies

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
# => -148794597

Each of these bodies also provides its own equatorial radius (Astronoby::Distance).

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

Attributes of planets

For 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.

#angular_diameter

Size of the body in the sky. Returns a Astronoby::Angle object.

venus.angular_diameter.str(:dms)
# => "+0° 0′ 11.4587″"

#constellation

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"

#elongation

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
# => 41

#eastern? and #western?

Whether 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

#phase_angle

"Sun-object-Earth" angle. Returns a Astronoby::Angle object.

venus.phase_angle.degrees.round
# => 40

#illuminated_fraction

Fraction of the object's disk illuminated as seen from Earth. Returns a Float between 0 and 1.

venus.illuminated_fraction.round(2)
# => 0.88

#apparent_magnitude

Apparent brightness of the body. Returns a Float.

venus.apparent_magnitude.round(2)
# => -3.89

::absolute_magnitude

Absolute brightness of the body. Returns a Float.

Astronoby::Venus.absolute_magnitude
# => -4.384

See also