ADCS.helpers.plot.orbit.animationplot module

class ADCS.helpers.plot.orbit.animationplot.AnimationPlot(*, time='time_s', title='3D Animation (PyVista)', texture_path=None, texture_alignment_angle_deg=-180.0, smooth_factor=4, min_smooth_N=1000, show_true_orbit=True, show_est_orbit=True, show_body_axes=True, show_env_vectors=True, goal=None, window_size=(1200, 900), axis_scale_body=0.3, axis_scale_sun=0.8, axis_scale_mag=0.6, axis_scale_goal=1.0, axis_scale_base_mult=0.5)[source]

Bases: Subplot

Interactive three-dimensional orbit and attitude animation using PyVista.

This class provides a high-level visualization of spacecraft motion and attitude in a dedicated PyVista render window. It is designed to integrate with the Subplot interface while rendering outside of Matplotlib. The animation shows the Earth, spacecraft orbit, attitude axes, environmental vectors, and optional goal indicators.

Goal visualization supports mixed goal types from the simulation history:

  • Vector goals are rendered as a single goal direction arrow.

  • Quaternion goals are rendered as a goal attitude triad (axes).

The goal history is preferred from sim.target_hist (Nx4) but legacy vector-only histories (Nx3) such as sim.eci_target_hist are supported.

Parameters:
  • time (str) – Name of the simulation attribute containing the time vector in seconds.

  • title (str) – Title displayed in the placeholder subplot and window title.

  • texture_path (str or pathlib.Path or None) – Optional path to an Earth texture image file. If None, a default texture is used.

  • texture_alignment_angle_deg (float) – Rotation angle applied to the Earth texture around the Z-axis, in degrees.

  • smooth_factor (int) – Factor by which the original simulation timeline is densified for smoother animation playback.

  • min_smooth_N (int) – Minimum number of animation frames after smoothing.

  • show_true_orbit (bool) – If True, the true spacecraft orbit is displayed.

  • show_est_orbit (bool) – If True, the estimated spacecraft orbit is displayed when available.

  • show_body_axes (bool) – If True, the spacecraft body-fixed axes are rendered.

  • show_env_vectors (bool) – If True, environmental vectors such as Sun and magnetic field are rendered.

  • goal (object or None) – Optional goal object. If it is a coordinate-based goal, a corresponding marker is displayed on the Earth.

  • window_size (tuple[int, int]) – Size of the PyVista render window in pixels as (width, height).

  • axis_scale_body (float) – Scaling factor for spacecraft body axes.

  • axis_scale_sun (float) – Scaling factor for the Sun direction vector.

  • axis_scale_mag (float) – Scaling factor for the magnetic field vector.

  • axis_scale_goal (float) – Scaling factor for the goal direction vector and goal triad axes.

  • axis_scale_base_mult (float) – Base scaling multiplier applied relative to the Earth radius.

plot(ax, sim)[source]
Return type:

None