ostk.astrodynamics.viewer.Viewer

class Viewer(
interval: Interval,
cesium_token: str | None = None,
width: str = '1500px',
height: str = '800px',
zoom_to_entity: bool = True,
track_entity: bool = True,
)

Bases: object

Methods

add_celestial_body_direction

Add the celestial direction to the viewer.

add_ground_tracks

Add ground tracks to the viewer.

add_label

Add label to Viewer.

add_line

Add line to Viewer.

add_moving_point

Add a moving point to the Viewer.

add_orbit

Add Orbit to Viewer.

add_profile

Add Profile to Viewer.

add_target

Add target to Viewer.

render

Render Viewer as HTML string.

Attributes

interval

add_orbit(
orbit: Orbit,
step: Duration,
name: str = 'Satellite',
show_orbital_track: bool = False,
color: str | None = None,
image: str | None = None,
) Viewer

Add Orbit to Viewer.

Parameters:
  • orbit (Orbit) -- Orbit to be added.

  • step (Duration) -- Step between two consecutive states.

  • name (str, optional) -- Name of the orbit. Defaults to "Satellite".

  • show_orbital_track (bool, optional) -- Whether to show the orbital track. Defaults to False.

  • color (str, optional) -- Color of the orbit. Defaults to None.

  • image (str, optional) -- Logo to be added. Defaults to None.

Returns:

The Viewer.

Return type:

Viewer

add_profile(
profile: Profile,
step: Duration,
show_orbital_track: bool = False,
cesium_asset_id: int | None = None,
sensors: list[Sensor] | None = None,
show_xyz_axes: bool = False,
) Viewer

Add Profile to Viewer.

Parameters:
  • profile (Profile) -- Profile to be added.

  • step (Duration) -- Step between two consecutive states.

  • show_orbital_track (bool, optional) -- Whether to show the orbital track. Defaults to False.

  • cesium_asset_id (int, optional) -- The Cesium asset ID. Defaults to None.

  • sensors (list[Sensor], optional) -- Sensors to be added to the asset. Defaults to None.

  • show_xyz_axes (bool, optional) -- Whether to show the XYZ axes. Defaults to False.

Returns:

The Viewer.

Return type:

Viewer

add_celestial_body_direction(
profile_or_trajectory: Profile | Trajectory,
celestial: Celestial,
time_step: Duration | None = None,
color: str | None = None,
) Viewer

Add the celestial direction to the viewer.

Parameters:
  • profile_or_trajectory (Profile | Trajectory) -- The profile or trajectory to be added.

  • celestial (Celestial, optional) -- The celestial body to be used.

  • time_step (Duration) -- The duration of each step in the grid. Default to None. If None, the default step duration is used.

  • color (str, optional) -- The color of the celestial body direction. Defaults to None. If None, the color depends on the celestial body (for the Earth, Sun and Moon). Otherwise, use the default color (RED).

Returns:

The Viewer.

Return type:

Viewer

add_ground_tracks(
profile_or_trajectory: Profile | Trajectory,
time_step: Duration | None = None,
show_current_position: bool = True,
) Viewer

Add ground tracks to the viewer.

Parameters:
  • profile_or_trajectory (Profile | Trajectory) -- The profile or trajectory to be added.

  • time_step (Duration, optional) -- The duration of each step in the grid. Default to None. If None, the default step duration is used.

  • show_current_position (bool, optional) -- Whether to show the current position as a point. Defaults to True.

Returns:

The Viewer.

Return type:

Viewer

add_target(
position: Position,
size: int | None = None,
color: str | None = None,
label: str | None = None,
) Viewer

Add target to Viewer.

Parameters:
  • position (Position) -- Target position.

  • size (int, optional) -- Target size. Defaults to None.

  • color (str, optional) -- Target color. Defaults to None.

  • label (str, optional) -- Target label. Defaults to None.

Returns:

The Viewer.

Return type:

Viewer

add_line(
positions: list[Position],
size: int | None = None,
color: str | None = None,
) Viewer

Add line to Viewer.

Parameters:
  • positions (list[Position]) -- Line positions.

  • size (int, optional) -- Line size. Defaults to None.

  • color (str, optional) -- Line color. Defaults to None.

Returns:

The Viewer.

Return type:

Viewer

add_moving_point(
instants: list[Instant],
llas: list[LLA],
color: str | None = None,
size: int | None = None,
) Viewer

Add a moving point to the Viewer.

Parameters:
  • instants (list[Instant]) -- The list of instants.

  • llas (list[LLA]) -- The list of Longitude, Latitude, Altitude (LLA) coordinates.

  • color (str, optional) -- The color of the point. Defaults to None. If None, the default color is used.

  • size (int, optional) -- The size of the point. Defaults to None. If None, the default size is used.

Returns:

The Viewer.

Return type:

Viewer

add_label(
position: Position,
text: str,
size: int | None = None,
color: str | None = None,
) Viewer

Add label to Viewer.

Parameters:
  • position (Position) -- Label position.

  • text (str) -- Label text.

  • size (int, optional) -- Label size. Defaults to None.

  • color (str, optional) -- Label color. Defaults to None.

Returns:

The Viewer.

Return type:

Viewer

render() str

Render Viewer as HTML string.

Returns:

Rendered HTML string.

Return type:

str