src.api.services.fov_service module

src.api.services.fov_service._cache_results(cache_key: str, all_results: list[dict[str, Any]], points_in_fov: int, performance_metrics: dict[str, Any]) None[source]

Cache FOV calculation results for future use.

Parameters:
  • cache_key – Unique key for the cache entry

  • all_results – List of satellite pass results

  • points_in_fov – Number of points found in field of view

  • performance_metrics – Performance metrics dictionary

src.api.services.fov_service._calculate_performance_metrics(total_time: float, retrieval_time: float, calc_time: float, satellites_processed: int, points_in_fov: int, jd_times: ndarray, count: int, execution_time: float) dict[str, Any][source]

Calculate and log performance metrics for FOV calculations.

Parameters:
  • total_time – Total execution time in seconds

  • retrieval_time – Time spent retrieving orbital data in seconds

  • calc_time – Time spent on propagation (or other FOV)

  • seconds (calculations in) –

  • satellites_processed – Number of satellites processed

  • points_in_fov – Number of points found in field of view

  • jd_times – List of Julian day times used in calculations

  • count – Total number of satellites available

  • execution_time – Time spent on propagation execution

Returns:

Performance metrics dictionary

Return type:

dict[str, Any]

src.api.services.fov_service._check_cache_for_results(cache_key: str, start_time: float, api_source: str, api_version: str, group_by: str, *, ra: float | None = None, dec: float | None = None, fov_radius: float | None = None, duration: float | None = None, location: EarthLocation | None = None) dict[str, Any] | None[source]

Check cache for FOV calculation results and return formatted data if found.

Parameters:
  • cache_key – Unique key for the cache entry

  • start_time – Start time for performance calculation

  • api_source – Source of the API call

  • api_version – Version of the API

  • group_by – Grouping strategy for results

  • ra – RA in degrees (for logging)

  • dec – Dec in degrees (for logging)

  • fov_radius – FOV radius in degrees (for logging)

  • duration – Duration in seconds (for logging)

  • location – Observer location (for logging)

Returns:

Formatted cached results if found, None otherwise

Return type:

dict[str, Any] | None

src.api.services.fov_service._create_jd_list(mid_obs_time_jd: Time, start_time_jd: Time, duration: float) ndarray[source]

Create a list of Julian day times for FOV calculations.

Parameters:
  • mid_obs_time_jd – Middle observation time (as Time object)

  • start_time_jd – Start time (as Time object)

  • duration – Duration in seconds

Returns:

Array of Julian day times for propagation calculations

Return type:

np.ndarray

src.api.services.fov_service._get_tdm_prediction_points(tdm_repo: AbstractTdmPredictionRepository, time_jd: Time, duration: float, site: str, constellation: str) tuple[list[TdmPredictionPoint], int, float][source]
src.api.services.fov_service._get_tle_data(tle_repo: AbstractTLERepository, time_jd: Time, constellation: str, data_source: str, use_generated_tles: bool) tuple[list[TLE], int, float][source]
src.api.services.fov_service._log_fov_parameters(async_mode: bool, ra: float, dec: float, fov_radius: float, duration: float, location: EarthLocation, mid_obs_time_jd: Time, start_time_jd: Time, group_by: str, include_tles: bool, skip_cache: bool)[source]
src.api.services.fov_service.get_satellite_passes_in_fov(tle_repo: AbstractTLERepository, location: EarthLocation, mid_obs_time_jd: Time, start_time_jd: Time, duration: float, ra: float, dec: float, fov_radius: float, group_by: str, include_tles: bool, skip_cache: bool, constellation: str, data_source: str, illuminated_only: bool, use_generated_tles: bool, api_source: str, api_version: str) dict[str, Any][source]

Get all satellite passes in the field of view.

Parameters:
  • tle_repo – Repository for TLE data

  • location – Observer’s location

  • mid_obs_time_jd – Middle observation time (as Time object)

  • start_time_jd – Start time (as Time object)

  • duration – Duration in seconds

  • ra – Right ascension of FOV center in degrees

  • dec – Declination of FOV center in degrees

  • fov_radius – Radius of FOV in degrees

  • group_by – Grouping strategy (‘satellite’ or ‘time’)

  • include_tles – Whether to include TLE data in results

  • skip_cache – Whether to skip cache and force recalculation

  • constellation – Constellation of the satellites to include in the response

  • data_source – Data source for TLEs

  • illuminated_only – Whether to include only illuminated satellites

  • api_source – Source of the API call

  • api_version – Version of the API

Returns:

Formatted results either grouped by satellite or chronologically

Return type:

dict

src.api.services.fov_service.get_satellite_passes_in_fov_async(tle_repo: AbstractTLERepository, location: EarthLocation, mid_obs_time_jd: Time, start_time_jd: Time, duration: float, ra: float, dec: float, fov_radius: float, group_by: str, include_tles: bool, skip_cache: bool, constellation: str, data_source: str, illuminated_only: bool, use_generated_tles: bool, api_source: str, api_version: str) dict[str, Any][source]
src.api.services.fov_service.get_satellite_passes_in_fov_tdm(tdm_repo: AbstractTdmPredictionRepository, site: str, location: EarthLocation, mid_obs_time_jd: Time, start_time_jd: Time, duration: float, ra: float, dec: float, fov_radius: float, group_by: str, constellation: str, api_source: str, api_version: str) dict[str, Any][source]
src.api.services.fov_service.get_satellites_above_horizon(tle_repo: AbstractTLERepository, location: EarthLocation, julian_dates: list[Time], min_altitude: float, min_range: float, max_range: float, illuminated_only: bool = False, constellation: str | None = None, api_source: str = '', api_version: str = '') dict[str, Any][source]

Get all satellites above the horizon at a specific time.

Parameters:
  • tle_repo – Repository for TLE data

  • location – Observer’s location

  • time_jd – Time to check (as Time object)

  • min_altitude – Minimum altitude in degrees (default: 0.0 = horizon)

  • min_range – Minimum range in kilometers

  • max_range – Maximum range in kilometers

  • illuminated_only – Whether to only return illuminated satellites

  • constellation – Constellation of the satellites to include in the response

  • api_source – Source of the API call

  • api_version – Version of the API

Returns:

Formatted results containing satellite positions and metadata

Return type:

dict