across.tools.tle

Submodules

Classes

TLEFetch

Fetches Two-Line Element (TLE) data for one or more satellites at a specific epoch.

Functions

get_tle(satellites[, spacetrack_user, spacetrack_pwd, ...])

Gets the Two-Line Element (TLE) data for one or more satellites at a specific epoch.

Package Contents

class TLEFetch(satellites, spacetrack_user=None, spacetrack_pwd=None, spacetrack_base_url=None)[source]

Fetches Two-Line Element (TLE) data for one or more satellites at a specific epoch. Requires a Space-Track.org account to access the TLE data. If no spacetrack user or password is provided, the class will attempt to use the environment variables SPACETRACK_USER and SPACETRACK_PWD.

Parameters:
  • satellites (list[NoradSatellite]) – List of satellites to query, each with ‘name’ and ‘id’ keys. Only the id is used to query against spacetrack_client.gp norad_cat_id

  • spacetrack_user (str, optional) – Space-Track.org username. Falls back to SPACETRACK_USER config.

  • spacetrack_pwd (str, optional) – Space-Track.org password. Falls back to SPACETRACK_PWD config.

  • spacetrack_base_url (str, optional) – Optional Space-Track API base URL override. Default is None.

satellites

List of satellites with name and NORAD ID.

Type:

list[NoradSatellite]

spacetrack_user

Space-Track.org username

Type:

str, optional

spacetrack_pwd

Space-Track.org password

Type:

str, optional

spacetrack_base_url

Space-Track API base URL override

Type:

str, optional

get()[source]

Get TLEs for given epoch

Raises:
  • TypeError

    • satellites must be a list of dicts with ‘name’ and ‘id’ keys

    • each satellite must be a dict

    • each satellite dict must have ‘name’ and ‘id’ keys

    • satellite ‘name’ must be a string

    • satellite ‘id’ must be an integer

  • ValueError

    • satellites list cannot be empty

satellites: list[NoradSatellite]
spacetrack_user: str | None
spacetrack_pwd: str | None
spacetrack_base_url: str | None
static _extract_norad_id_from_tle1(tle1)[source]

Extract NORAD ID from the first segment of TLE line 1.

get()[source]

Return TLE data for requested NORAD ID(s), within +/- 7 days.

Aggregates response by NORAD ID by scanning the first section of TLE line 1, and only the newest TLE for each requested NORAD ID is retained.

Returns:

TLE objects matching the requested NORAD ID(s). Empty when no data is found.

Return type:

list[TLE]

Raises:

SpaceTrackAuthenticationError – If space-track.org authentication fails.

get_tle(satellites, spacetrack_user=None, spacetrack_pwd=None, spacetrack_base_url=None)[source]

Gets the Two-Line Element (TLE) data for one or more satellites at a specific epoch. Credentials for space-track.org can be provided as arguments, or they can be set as environment variables SPACETRACK_USER and SPACETRACK_PWD.

Parameters:
  • satellites (list[NoradSatellite]) – List of satellites to query, each with ‘name’ and ‘id’ keys.

  • spacetrack_user (str, optional) – space-Track.org username.

  • spacetrack_pwd (str, optional) – space-Track.org password.

  • spacetrack_base_url (str, optional) – Optional Space-Track API base URL override.

Returns:

TLE objects matching the requested satellites. Empty if no data is found.

Return type:

list[TLE]

Raises:
  • TypeError

    • satellites must be a list of dicts with ‘name’ and ‘id’ keys

    • each satellite must be a dict

    • each satellite dict must have ‘name’ and ‘id’ keys

    • satellite ‘name’ must be a string

    • satellite ‘id’ must be an integer

  • ValueError

    • satellites list cannot be empty