src.api.services.tasks.ephemeris_tasks module

(task)src.api.services.tasks.ephemeris_tasks.generate_position_data(location: astropy.coordinates.earth.EarthLocation, dates: list[astropy.time.core.Time], tle_line_1: str, tle_line_2: str, date_collected: str, tle_epoch_date: str, name: str, intl_designator: str, min_altitude: float, max_altitude: float, api_source: str, api_version: str, catalog_id: str = '', data_source: str = '', propagation_strategy: str = 'skyfield') dict[str, Any] | list[dict[str, Any]]

Create a list of results for a given satellite and date range.

This function propagates the satellite for each date in the given range, processes the results, and returns a list of results.

Parameters:
  • location (EarthLocation) – The location of the observer.

  • dates (list[Time]) – The dates for which to propagate the satellite.

  • tle_line_1 (str) – The first line of the TLE data for the satellite.

  • tle_line_2 (str) – The second line of the TLE data for the satellite.

  • date_collected (str) – The date the TLE data was collected.

  • tle_epoch_date (str) – The date the TLE was created.

  • name (str) – The name of the satellite.

  • min_altitude (float) – The minimum altitude for the results.

  • max_altitude (float) – The maximum altitude for the results.

  • catalog_id (str, optional) – The catalog ID of the satellite. Defaults to “”.

  • data_source (str, optional) – The data source of the TLE data. Defaults to “”.

Returns:

Either a dictionary with results or a list of results for the given satellite and date range.

Return type:

dict[str, Any] | list[dict[str, Any]]

(task)src.api.services.tasks.ephemeris_tasks.process_results(data_points: list[tuple[float, ...]], min_altitude: float, max_altitude: float, date_collected: str, tle_epoch_date: str, name: str, intl_designator: str, catalog_id: str, data_source: str, api_source: str, api_version: str) dict[str, Any]

Process the results of the satellite propagation.

This function filters the satellite position data based on the altitude range and adds the remaining metadata to the results.

Parameters:
  • data_points (list[tuple[float, float]]) – The satellite position results.

  • min_altitude (float) – The minimum altitude.

  • max_altitude (float) – The maximum altitude.

  • date_collected (str) – The date the data was collected.

  • tle_epoch_date (str) – The date the TLE was created.

  • name (str) – The name of the satellite.

  • catalog_id (str) – The catalog ID of the satellite.

  • data_source (str) – The data source.

Returns:

Either the processed results dictionary or an info message dictionary.

Return type:

dict[str, Any]

(task)src.api.services.tasks.ephemeris_tasks.propagate_satellite_new(tle_line_1, tle_line_2, lat, long, height, jd)

Propagates satellite and observer states using a test propagation strategy.

Parameters:
  • tle_line_1 (str) – The first line of the Two-Line Element set representing the satellite.

  • tle_line_2 (str) – The second line of the Two-Line Element set representing the satellite.

  • lat (float) – The latitude of the observer’s location, in degrees.

  • long (float) – The longitude of the observer’s location, in degrees.

  • height (float) – The height of the observer’s location, in meters above the WGS84 ellipsoid.

  • jd (Time) – The Julian Date at which to propagate the satellite.

Returns:

A dictionary containing the propagated state of the satellite and the observer.

Return type:

dict

(task)src.api.services.tasks.ephemeris_tasks.propagate_satellite_sgp4(tle_line_1, tle_line_2, lat, long, height, jd)

Propagates satellite and observer states using the SGP4 model.

Parameters:
  • tle_line_1 (str) – The first line of the Two-Line Element set representing

  • satellite. (the) –

  • tle_line_2 (str) – The second line of the Two-Line Element set representing

  • satellite.

  • lat (float) – The latitude of the observer’s location, in degrees.

  • long (float) – The longitude of the observer’s location, in degrees.

  • height (float) – The height of the observer’s location, in meters above the

  • ellipsoid. (WGS84) –

  • jd (float | list[float]) – The Julian Date(s) at which to propagate

  • satellite.

Returns:

A list of tuples containing the propagated state of the satellite and the observer.

Return type:

list[tuple]

(task)src.api.services.tasks.ephemeris_tasks.propagate_satellite_skyfield(tle_line_1, tle_line_2, lat, long, height, jd)

Propagates satellite and observer states using the Skyfield library.

Parameters:
  • tle_line_1 (str) – The first line of the Two-Line Element set representing

  • satellite. (the) –

  • tle_line_2 (str) – The second line of the Two-Line Element set representing

  • satellite.

  • lat (float) – The latitude of the observer’s location, in degrees.

  • long (float) – The longitude of the observer’s location, in degrees.

  • height (float) – The height of the observer’s location, in meters above the

  • ellipsoid. (WGS84) –

  • jd (float | list[float]) – The Julian Date(s) at which to propagate

  • satellite.

Returns:

A list of tuples containing the propagated state of the satellite and the observer.

Return type:

list[tuple]