Astronoby provides four types of coordinates:
- Equatorial
- Ecliptic
- Horizontal
- Geodetic
Equatorial and ecliptic coordinates are available for each reference frame, horizontal coordinates are only available for a topocentric position, and geodetic coordinates are used for Earth-surface positions (ECEF ↔ WGS-84).
In Astronoby, equatorial coordinates are geocentric spherical coordinates. As per Wikipedia's definition:
defined by an origin at the centre of Earth, fundamental plane consisting of the projection of Earth's equator onto the celestial sphere (forming the celestial equator, a primary direction towards the March equinox, and a right-handed convention.
They have two main angular attributes:
Angle measured East from the Vernal Equinox, the point where the Sun crosses the celestial equator in March as it passes from the southern to the northern half of the sky. By convention, right ascension is usually displayed in hours.
ephem = Astronoby::Ephem.load("inpop19a.bsp")
time = Time.utc(1962, 7, 24)
instant = Astronoby::Instant.from_time(time)
saturn = Astronoby::Saturn.new(ephem: ephem, instant: instant)
equatorial = saturn.apparent.equatorial
equatorial.right_ascension.str(:hms)
# => "20h 45m 2.6681s"You can learn more about angles on the Angle page.
Angle measured north and south of the celestial equator in degrees, with north being positive. The North Celestial Pole is at +90° and the South Celestial Pole is at -90°.
equatorial.declination.str(:dms)
# => "-18° 46′ 16.0931″"Sometimes convenient for astronomers, a third attribute can be derived from equatorial coordinates: the hour angle. It is the angle between the meridian plane and the hour circle, meaning it depends on the observer's longitude and time. By convention, the hour angle is usually displayed in hours.
longitude = Astronoby::Angle.from_degrees(2)
equatorial.compute_hour_angle(longitude: longitude, time: time).str(:hms)
# => "23h 27m 54.1924s"In Astronoby, ecliptic coordinates are geocentric spherical coordinates. Their origin is the centre of Earth, their primary direction is towards the March equinox, and they have a right-hand convention. Ecliptic coordinates are particularly handy for representing positions of Solar System objects.
As per Wikipedia's definition:
The celestial equator and the ecliptic are slowly moving due to perturbing forces on the Earth, therefore the orientation of the primary direction, their intersection at the March equinox, is not quite fixed. A slow motion of Earth's axis, precession, causes a slow, continuous turning of the coordinate system westward about the poles of the ecliptic. Superimposed on this is a smaller motion of the ecliptic, and a small oscillation of the Earth's axis, nutation.
This primary direction depends on the reference frame used.
They have two main angular attributes:
The ecliptic latitude measures the angular distance of an object along the ecliptic from the primary direction.
ephem = Astronoby::Ephem.load("inpop19a.bsp")
time = Time.utc(1962, 7, 24)
instant = Astronoby::Instant.from_time(time)
saturn = Astronoby::Saturn.new(ephem: ephem, instant: instant)
ecliptic = saturn.apparent.ecliptic
ecliptic.latitude.str(:dms)
# => "-0° 41′ 27.5077″"The ecliptic latitude measures the angular distance of an object from the ecliptic towards the north (positive) or south (negative) ecliptic pole.
ecliptic.longitude.str(:dms)
# => "+308° 38′ 33.1535″"Horizontal coordinates are the most observer-centred and human-intuitive coordinates. They measure where an object is in the sky as seen from an observer on Earth as "up and down" and "left and right".
In Astronoby, they can only be computed from a topocentric position.
They have two main angular attributes:
The angle between the object and the observer's local horizon.
ephem = Astronoby::Ephem.load("inpop19a.bsp")
time = Time.utc(1962, 7, 24)
instant = Astronoby::Instant.from_time(time)
observer = Astronoby::Observer.new(
latitude: Astronoby::Angle.from_degrees(42),
longitude: Astronoby::Angle.from_degrees(2)
)
saturn = Astronoby::Saturn.new(ephem: ephem, instant: instant)
horizontal = saturn.observed_by(observer).horizontal
horizontal.altitude.str(:dms)
# => "+28° 46′ 38.3398″"The angle of the object around the horizon from the north and increasing eastward.
horizontal.azimuth.str(:dms)
# => "+171° 19′ 38.2567″"Geodetic coordinates describe a position on or above the Earth's surface using the WGS-84 reference ellipsoid, the same system used by GPS. They have three attributes:
The angle from the equator to the point on the ellipsoid surface, from +90° (North Pole) to -90° (South Pole).
The angle from the Greenwich meridian, from +180° to -180°, with positive angles eastward.
The distance above (or below) the WGS-84 ellipsoid surface.
Geodetic coordinates can be derived from Earth-Centered Earth-Fixed (ECEF)
Cartesian coordinates using Astronoby::Coordinates::Geodetic.from_ecef. This
is particularly useful for satellite tracking, where a propagator produces ECEF
positions via Astronoby::Teme#to_ecef:
teme = Astronoby::Teme.new(
position: Astronoby::Distance.vector_from_meters(
[5_094_180.16, 6_127_644.66, 6_380_344.53]
),
velocity: Astronoby::Velocity.vector_from_mps(
[-4746.13, 785.82, 5531.93]
),
instant: instant
)
geodetic = teme.to_ecef.geodetic
geodetic.latitude.str(:dms)
# => "+38° 48′ 3.3038″"
geodetic.longitude.str(:dms)
# => "+97° 27′ 6.7374″"
geodetic.elevation.km.round
# => 3838The conversion uses Bowring's iterative method, which converges in 2-3 iterations for typical satellite altitudes.
The forward direction (geodetic → ECEF) is handled by
[Astronoby::Observer#geocentric_position][Observer page].
- Reference Frames - for coordinate system details
- Angles - for working with angular measurements
- Observer - for location setup
- Solar System Bodies - for object positions