src.api.adapters.repositories.satellite_repository module
- class src.api.adapters.repositories.satellite_repository.AbstractSatelliteRepository[source]
Bases:
ABC- _abc_impl = <_abc._abc_data object>
- class src.api.adapters.repositories.satellite_repository.SqlAlchemySatelliteRepository[source]
Bases:
AbstractSatelliteRepository- _abc_impl = <_abc._abc_data object>
- _get_active_satellites(object_type: str | None = None)[source]
Retrieves active satellites based on the provided object type (optional). Only returns satellites that are active (no decay date) and have current satellite numbers (to eliminate duplicates).
- Parameters:
object_type (str) – The type of the object, either “payload”, “debris”,
body" ("rocket) –
"tba" –
"unknown". (or) –
- Returns:
A list of active satellites.
- Return type:
List[SatelliteDb]
- _get_norad_ids_from_satellite_name(name)[source]
Retrieves the NORAD IDs and the date the satellite was added to SatChecker for a given satellite name.
- Parameters:
name (str) – The name of the satellite.
- Returns:
A list of tuples, each containing the NORAD ID, date added, and a boolean indicating if it has the current satellite number.
- Return type:
list of tuple
- _get_satellite_data_by_id(id)[source]
Retrieves satellite data (rcs_size, launch date, etc. ) for a given NORAD ID.
This method queries the database to find a satellite with the specified NORAD ID that also has the current satellite number.
- Parameters:
id (int) – The NORAD ID of the satellite.
- Returns:
The satellite data if found, otherwise None.
- Return type:
- _get_satellite_data_by_name(name)[source]
Retrieves satellite data (rcs_size, launch date, etc. ) for a given satellite name.
This method queries the database to find a satellite with the specified name that also has the current satellite number.
- Parameters:
name (str) – The name of the satellite.
- Returns:
The satellite data if found, otherwise None.
- Return type:
- _get_satellite_names_from_norad_id(id)[source]
Retrieves the names and dates of satellites associated with a given NORAD ID.
- Parameters:
id (int) – The NORAD ID of the satellite.
- Returns:
A list of tuples, each containing the satellite name, date added, and a boolean indicating if it has the current satellite number.
- Return type:
list of tuple