Skip to content

Ground Stations

Ground-based tracking and observation support.

Quick Example

import lox_space as lox

# Define a ground station
gs = lox.EllipsoidLocation(
    frame="IAU_EARTH",          # any body-fixed frame, e.g. "ITRF"
    longitude=0.0 * lox.rad,    # Greenwich
    latitude=51.5 * lox.deg,    # ~51.5° N
    altitude=0.0 * lox.km,
)

# The frame's conventional ellipsoid is a default, not a constraint
gs_wgs84 = lox.EllipsoidLocation(
    frame="IAU_EARTH",
    longitude=0.0 * lox.rad,
    latitude=51.5 * lox.deg,
    altitude=0.0 * lox.km,
    ellipsoid=lox.Ellipsoid.WGS84,
)

# Calculate observables for a spacecraft state
obs = gs.observables(state)
print(f"Azimuth: {obs.azimuth().to_degrees():.2f} deg")
print(f"Elevation: {obs.elevation().to_degrees():.2f} deg")
print(f"Range: {obs.range().to_kilometers():.1f} km")

# Set an operational minimum elevation on a ground station
station = lox.GroundStation("ESOC", gs, min_elevation=5 * lox.deg)

# Or add a measured horizon profile; visibility uses the maximum of the
# horizon and the minimum elevation at each azimuth. Azimuths are normalised
# to [-pi, pi) and sorted, so [0, 2*pi) data works just as well.
import numpy as np
azimuth = np.linspace(0.0, 2 * np.pi, 36, endpoint=False)
elevation = np.full(36, 0.1)  # radians
mask = lox.HorizonMask(azimuth, elevation)
station = lox.GroundStation("ESOC", gs, min_elevation=5 * lox.deg, horizon_mask=mask)

EllipsoidLocation

Represents a location on the surface of a celestial body.

Parameters:

  • frame

    Body-fixed frame as Frame or str (e.g. "IAU_EARTH", "ITRF").

  • longitude

    Geodetic longitude as Angle.

  • latitude

    Geodetic latitude as Angle.

  • altitude

    Altitude above the reference ellipsoid as Distance.

  • ellipsoid

    Reference ellipsoid, overriding the one conventionally paired with the frame.

Examples:

>>> darmstadt = lox.EllipsoidLocation(
...     "IAU_EARTH",
...     longitude=8.6512 * lox.deg,
...     latitude=49.8728 * lox.deg,
...     altitude=0.108 * lox.km,
... )

Methods:

  • altitude

    Return the altitude above the reference ellipsoid.

  • body_fixed_position

    Return the body-fixed Cartesian position as a numpy array in m.

  • coordinates

    Return the geodetic coordinates as a (longitude, latitude, altitude) tuple.

  • ellipsoid

    Return the reference ellipsoid the coordinates are referenced to.

  • frame

    Return the body-fixed frame the coordinates are referenced to.

  • latitude

    Return the geodetic latitude.

  • longitude

    Return the geodetic longitude.

  • observables

    Compute observables to a target state.

  • origin

    Return the central body (origin).

  • rotation_to_topocentric

    Return the rotation matrix from body-fixed to topocentric frame.

altitude

altitude() -> Distance

Return the altitude above the reference ellipsoid.

body_fixed_position

body_fixed_position() -> ndarray

Return the body-fixed Cartesian position as a numpy array in m.

coordinates

coordinates() -> tuple[Angle, Angle, Distance]

Return the geodetic coordinates as a (longitude, latitude, altitude) tuple.

ellipsoid

ellipsoid() -> Ellipsoid

Return the reference ellipsoid the coordinates are referenced to.

frame

frame() -> Frame

Return the body-fixed frame the coordinates are referenced to.

latitude

latitude() -> Angle

Return the geodetic latitude.

longitude

longitude() -> Angle

Return the geodetic longitude.

observables

observables(
    state: Cartesian,
    provider: EOPProvider | None = None,
    frame: str | Frame | None = None,
) -> Observables

Compute observables to a target state.

origin

origin() -> Origin

Return the central body (origin).

rotation_to_topocentric

rotation_to_topocentric() -> ndarray

Return the rotation matrix from body-fixed to topocentric frame.


Ellipsoid

A reference ellipsoid, defined by its equatorial radius and flattening.

Parameters:

  • equatorial_radius

    Semi-major axis as Distance.

  • flattening

    Flattening factor in [0, 1).

Examples:

>>> lox.Ellipsoid.WGS84
>>> lox.Ellipsoid(6378137.0 * lox.m, 1 / 298.257223563)

Methods:

equatorial_radius

equatorial_radius() -> Distance

Return the equatorial radius.

flattening

flattening() -> float

Return the flattening factor.


HorizonMask

A measured horizon profile for visibility analysis.

A horizon mask captures the physical skyline around a ground station as elevation over azimuth. Visibility additionally honours the station's operational min_elevation floor; detection tests elevation against the maximum of both.

Parameters:

  • azimuth

    Array of azimuth angles in radians. The values are normalised to [-π, π) and sorted, so any convention works: [0, 2π), [-π, π], unsorted data, and profiles that do or do not repeat their wrap-around point. The mask is periodic, with the segment between the last and the first point spanning the seam at ±π.

  • elevation

    Array of horizon elevations in radians.

Raises:

  • ValueError

    If the arrays have different lengths, if they are empty, or if two points normalise to the same azimuth but carry different elevations.

Examples:

>>> mask = lox.HorizonMask(azimuth, elevation)

Methods:

  • azimuth

    Return the azimuth grid in radians, normalised to [-π, π) and sorted.

  • elevation

    Return the horizon elevations in radians.

  • elevation_at

    Return the horizon elevation at the given azimuth.

azimuth

azimuth() -> list[float]

Return the azimuth grid in radians, normalised to [-π, π) and sorted.

elevation

elevation() -> list[float]

Return the horizon elevations in radians.

elevation_at

elevation_at(azimuth: Angle) -> Angle

Return the horizon elevation at the given azimuth.


Observables

Observation data from a ground station to a target.

Parameters:

  • azimuth

    Azimuth angle as Angle.

  • elevation

    Elevation angle as Angle.

  • range

    Distance to target as Distance.

  • range_rate

    Rate of change of range as Velocity.

Methods:

  • azimuth

    Return the azimuth angle.

  • elevation

    Return the elevation angle.

  • range

    Return the range (distance).

  • range_rate

    Return the range rate.

azimuth

azimuth() -> Angle

Return the azimuth angle.

elevation

elevation() -> Angle

Return the elevation angle.

range

range() -> Distance

Return the range (distance).

range_rate

range_rate() -> Velocity

Return the range rate.


Pass

Represents a visibility pass between a ground station and spacecraft.

A Pass contains the visibility interval (start and end times) along with observables computed at regular intervals throughout the pass.

Methods:

  • interpolate

    Interpolate observables at a specific time within the pass.

  • interval

    Return the visibility interval for this pass.

  • observables

    Return the observables at each time sample.

  • times

    Return the time samples during this pass.

interpolate

interpolate(time: Time) -> Observables | None

Interpolate observables at a specific time within the pass.

interval

interval() -> Interval

Return the visibility interval for this pass.

observables

observables() -> list[Observables]

Return the observables at each time sample.

times

times() -> list[Time]

Return the time samples during this pass.