spherapy

module util.spacetrack

Functions to fetch TLEs from Spacetrack.

Attributes:

Global Variables


function updateTLEs

updateTLEs(
    sat_id_list: list[int],
    user: None | str = None,
    passwd: None | str = None
)  list[int]

Fetch most recent TLE for satcat IDs from spacetrack.

Fetch most recent TLEs for provided list of satcat IDs, and append to file.
If no TLE file yet exists, will download all historical TLEs Will try MAX_RETRIES before raising a TimeoutError

Args:

Returns:

Raises: TimeoutError


function getTLEFilePath

getTLEFilePath(sat_id: int)  Path

Gives path to file where spacetrack TLE is stored.

Spacetrack TLEs are stored in {satcadID}.tle

Args:

Returns: path to file


function getStoredEpochs

getStoredEpochs(sat_id: int)  None | tuple[datetime, datetime | None]

Return the start and end epoch for {sat_id}.tle .

Args:

Returns: (first epoch datetime, last epoch datetime) None if no spacetrack tle stored for sat_id


function doCredentialsExist

doCredentialsExist()  bool

Checks if spacetrack credentials have been loaded into Spherapy.

Returns: bool:


class InvalidCredentialsError

Error indicating invalid credentials used to access spacetrack.

method __init__

__init__(message: str)