Ground Station

class missiontools.GroundStation(lat, lon, alt=0.0)[source]

Bases: object

A ground station defined in WGS84 geodetic coordinates.

Parameters:
  • lat (float) – Geodetic latitude (deg), range [-90, 90].

  • lon (float) – Longitude (deg). Any value is accepted; cos/sin periodicity means values outside [-180, 180] are equivalent to their wrapped form.

  • alt (float, optional) – Altitude above the WGS84 ellipsoid (m). Defaults to 0 (mean sea level approximation).

Parameters:

Examples

Create a ground station and compute access against a spacecraft:

import numpy as np
from missiontools import GroundStation, Spacecraft

gs = GroundStation(lat=51.5, lon=-0.1)           # London
sc = Spacecraft(a=6_771_000, e=0, i=np.radians(51.6), ...)

passes = gs.access(sc,
                   t_start = np.datetime64('2025-01-01', 'us'),
                   t_end   = np.datetime64('2025-01-03', 'us'),
                   el_min  = 5.0)
lat: float
lon: float
alt: float = 0.0
property antennas: list

Antennas attached to this ground station (read-only copy).

add_antenna(antenna)[source]

Attach an antenna to this ground station.

Sets the antenna’s back-reference and pre-computes the ECEF boresight for ground-mounted antennas.

Parameters:

antenna (AbstractAntenna) – The antenna to attach.

Raises:
  • TypeError – If antenna is not an AbstractAntenna.

  • ValueError – If the antenna is already attached to a Spacecraft.

Return type:

None

access(spacecraft, t_start, t_end, el_min=0.0, max_step=np.timedelta64(30, 's'))[source]

Compute access intervals between this ground station and a spacecraft.

Parameters:
  • spacecraft (Spacecraft) – The spacecraft whose orbit is to be checked.

  • t_start (np.datetime64) – Start of the search window.

  • t_end (np.datetime64) – End of the search window.

  • el_min (float, optional) – Minimum elevation angle (deg). Contacts below this elevation are not reported. Default 0.

  • max_step (np.timedelta64, optional) – Maximum coarse scan step used internally. Smaller values improve detection of very short passes at the cost of runtime. Default 30 s.

Returns:

list of tuple[np.datetime64, np.datetime64] – Each tuple (start, end) is a continuous access window where the spacecraft is visible above el_min. Both timestamps are datetime64[us]. Returns an empty list if no access occurs.

Parameters:
Return type:

list[tuple[datetime64, datetime64]]