Scenarios – ephemerista.scenarios

The scenarios.py module.

This module provides the Scenario class which collects all required inputs such as assets, communications channels, points and areas of interest for orbit propagation and analyses.

class ephemerista.scenarios.Ensemble(*, trajectories, ephemerides={})

The Ensemble model.

This class collects the resulting trajectories from propagating the state of all assets within a scenario.

add_earth_attitude()

Add attitude quaternions for Earth to the ensemble.

model_config: ClassVar[ConfigDict] = {'alias_generator': <function to_camel>, 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class ephemerista.scenarios.Rectangle(coords)

A rectangle type that has a simple Geo JSON interface.

Created so we don’t use the costly to create Shapely. Polygon objects that are not needed. We only need the __geo_interface__ implementation. Note that we are checking nothing here, as we expect a well-formed rectangle.

Reference https://gist.github.com/sgillies/2217756#__geo_interface

class ephemerista.scenarios.Scenario(*, version=1, id=<factory>, name='Scenario', startTime, endTime, timeStep=60, origin=Origin(name='Earth'), frame=ReferenceFrame(abbreviation='ICRF'), assets=[], constellations=[], channels=[], pointsOfInterest=[], areasOfInterest=[], discretizationMethod='rectangles', discretizationResolution=1, autoDiscretize=True)

The Scenario model.

property all_assets: list[Asset]

All constellation assets and additional assets.

Type:

list[Asset]

channel_by_id(channel_id)

Look up a communications channel based on its UUID.

Return type:

Channel

property discretized_areas: list[Feature[Polygon, dict]]

Discretized areas of interest.

Type:

list[Feature[Polygon, dict]]

get_discretized_to_original_mapping()

Get mapping from discretized polygon ID to original area ID.

Returns:

Dictionary mapping discretized polygon index to original area index

Return type:

dict[int, int]

get_original_to_discretized_mapping()

Get mapping from original area ID to list of discretized polygon IDs.

Returns:

Dictionary mapping original area index to list of discretized polygon indices

Return type:

dict[int, list[int]]

property ground_locations: list[GroundLocation]

All ground locations from areas of interest.

Type:

list[GroundLocation]

classmethod load_from_file(path)

Load a scenario from a JSON file with version checking and migration support.

Return type:

Self

model_config: ClassVar[ConfigDict] = {'alias_generator': <function to_camel>, 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

propagate()

Propagate the state of all assets in the scenario.

Returns:

A collection of all propagated trajectories

Return type:

Ensemble

property times: list[Time]

Time steps.

Type:

list[Time]

ephemerista.scenarios.polygonize_aoi(aoi_geom_dict, res, min_elevation_deg=0.0)

Polygonize an area of interest using h3.

Parameters:
  • aoi_geom_dict (dict) – A GeoJSON-compatible dict containing a “coordinates” key, usually from a __geo_interface__

  • res (int) – h3 res parameter

  • min_elevation_deg (float) – Minimum elevation in degrees to compute the visibility between a spacecraft and the ground cells

Return type:

list[Feature[Polygon, dict]]

ephemerista.scenarios.polygonize_aoi_rectangles(aoi_geom_dict, vertex_degrees, min_elevation_deg=0.0)

Polygonize an area of interest using rectangles of equal lat/long degrees.

Polygons crossing the antimeridian are divided in two, so no malformed features are created.

Parameters:
  • aoi_geom_dict (dict) – A GeoJSON-compatible dict containing a “coordinates” key, usually from a __geo_interface__ The AOI is the bounding box of this polygon, so the rectangles are arranged as a grid.

  • vertex_degrees (int | float) – Size of the latitude and longitude vertexes in degrees

  • min_elevation_deg (float) – Minimum elevation in degrees to compute the visibility between a spacecraft and the ground cells

Return type:

list[Feature[Polygon, dict]]