adam_core.orbits.openspace.assets module¶
Utilities for generating and reading OpenSpace Asset files
- class adam_core.orbits.openspace.assets.Asset(*, identifier: str, parent: str, gui: adam_core.orbits.openspace.assets.Gui, renderable: adam_core.orbits.openspace.renderable.Renderable | None = None, transform: adam_core.orbits.openspace.translation.Transform | None = None)[source]¶
Bases:
LuaDict- renderable: Renderable | None = None¶
- adam_core.orbits.openspace.assets.create_renderable_orbital_kepler(orbits: Orbits, out_dir: str, identifier: str, gui_name: str | None = None, gui_path: str | None = None, color: Tuple[float, float, float] = (1.0, 1.0, 1.0), segment_quality: int = 10, contiguous_mode: bool | None = None, enable_max_size: bool | None = None, enable_outline: bool | None = None, max_size: float | None = None, outline_color: Tuple[float, float, float] | None = None, outline_width: float | None = None, point_size_exponent: float | None = None, rendering: Literal['Trail', 'Point', 'PointsTrails'] | None = None, render_size: int | None = None, start_render_idx: int | None = None, trail_fade: float | None = None, trail_width: float | None = None, dim_in_atmosphere: bool | None = None, enabled: bool | None = None, opacity: float | None = None, render_bin_mode: Literal['Opaque', 'Transparent', 'Both'] = None, tag: str | List[str] | None = None)[source]¶
Create a renderable orbital Kepler for a given set of orbits.
This is the best renderable to use for large numbers of orbits (e.g. > 1000).
Example
>>> from adam_core.orbits.query import query_sbdb >>> from adam_core.orbits.openspace import create_renderable_orbital_kepler >>> orbits = query_sbdb(["2013 RR165", "2018 BP1"]) >>> create_renderable_orbital_kepler(orbits, "out_dir", "openspace_example")
- Parameters:
orbits (Orbits) – The orbits to create a renderable orbitals for.
out_dir (str) – The directory to output the asset files
identifier (str) – The identifier for the asset
gui_name (str, optional) – The name of the GUI for the asset.
gui_path (str, optional) – The path of the GUI for the asset.
color (tuple, optional) – The color of the Keplerian orbital.
segment_quality (int, optional) – The segment quality for the Keplerian orbital.
contiguous_mode (bool, optional) – Whether to enable contiguous mode for the Keplerian orbital.
enable_max_size (bool, optional) – Whether to enable max size for the Keplerian orbital.
enable_outline (bool, optional) – Whether to enable outline for the Keplerian orbital.
max_size (float, optional) – The max size for the Keplerian orbital.
outline_color (tuple, optional) – The color of the outline for the Keplerian orbital.
outline_width (float, optional) – The width of the outline for the Keplerian orbital.
point_size_exponent (float, optional) – The size exponent for the Keplerian orbital.
rendering (str, optional) – The rendering type for the Keplerian orbital.
render_size (int, optional) – The render size for the Keplerian orbital.
start_render_idx (int, optional) – The start render index for the Keplerian orbital.
trail_fade (float, optional) – The trail fade for the Keplerian orbital.
trail_width (float, optional) – The trail width for the Keplerian orbital.
dim_in_atmosphere (bool, optional) – Whether to render the Keplerian orbital in the atmosphere.
enabled (bool, optional) – Whether to enable the Keplerian orbital.
opacity (float, optional) – The opacity of the Keplerian orbital.
render_bin_mode (str, optional) – The render bin mode for the Keplerian orbital.
tag (str, optional) – The tag for the Keplerian orbital.
- adam_core.orbits.openspace.assets.create_renderable_trail_orbit(orbits, out_dir: str, identifier: str, trail_head: bool | None = True, gui_name: str | None = None, gui_path: str | None = None, color: Tuple[float, float, float] = (1.0, 1.0, 1.0), resolution: int = 86400, translation_type: Literal['Kepler', 'Spice'] = 'Kepler', enable_fade: bool | None = None, line_fade_amount: float | None = None, line_length: float | None = None, line_width: float | None = None, point_size: int | None = None, rendering: Literal['Lines', 'Points', 'Lines+Points'] = None, dim_in_atmosphere: bool | None = None, enabled: bool | None = None, opacity: float | None = None, period: float | None = None, render_bin_mode: Literal['Opaque', 'Transparent', 'Both'] = None, tag: str | List[str] | None = None, spice_kernel_path: str | None = None, spice_id_mappings: dict | None = None)[source]¶
Create a renderable trail orbit for a given set of orbits. These orbits can be represented by two different “translation” types:
KeplerTranslation: This is a Keplerian translation, which takes in a set of Keplerian elements and a time (default)
SpiceTranslation: This is a translation that is based on SPICE kernel data. SpiceKernels need to be created (see. )
and passed to this function.
The Keplerian translation is the default and is the best for small numbers of orbits (e.g. < 1000). The Spice translation is the best to use for a few dozen orbits.
Example
>>> from adam_core.orbits.query import query_sbdb >>> from adam_core.orbits.openspace import create_renderable_trail_orbit >>> orbits = query_sbdb(["2013 RR165", "2018 BP1"]) >>> create_renderable_trail_orbit(orbits, "out_dir", "openspace_example", translation_type="Kepler")
- Parameters:
orbits (Orbits) – The orbits to create a renderable trail orbit for
out_dir (str) – The directory to output the asset files
identifier (str) – The identifier for the asset
trail_head (bool, optional) – Whether to include a trail head in the asset.
gui_name (str, optional) – The name of the GUI for the asset.
gui_path (str, optional) – The path of the GUI for the asset.
color (tuple, optional) – The color of the trail.
resolution (int, optional) – The resolution of the trail.
translation_type (str, optional) – The type of translation to use.
enable_fade (bool, optional) – Whether to enable fade for the trail.
line_fade_amount (float, optional) – The amount of fade for the trail.
line_length (float, optional) – The length of the trail.
line_width (float, optional) – The width of the trail.
point_size (int, optional) – The size of the points in the trail.
rendering (str, optional) – The rendering type for the trail.
dim_in_atmosphere (bool, optional) – Whether to render the trail in the atmosphere.
enabled (bool, optional) – Whether to enable the trail.
opacity (float, optional) – The opacity of the trail.
period (float, optional) – The period of the trail.
render_bin_mode (str, optional) – The render bin mode for the trail.
tag (str, optional) – The tag for the trail.
spice_kernel_path (str, optional) – The path to the SPICE kernel file.
spice_id_mappings (dict, optional) – A dictionary mapping object IDs to SPICE IDs.