Flight Plots Class#
- class rocketpy.plots.flight_plots._FlightPlots[source]#
Class that holds plot methods for Flight class.
- Variables:
_FlightPlots.flight (
Flight) – Flight object that will be used for the plots._FlightPlots.first_event_time (
float) – Time of first event._FlightPlots.first_event_time_index (
int) – Time index of first event.
- __init__(flight)[source]#
Initializes _FlightPlots class.
- Parameters:
flight (
Flight) – Instance of the Flight class- Return type:
None
- property first_event_time#
Time of the first flight event.
- property first_event_time_index#
Time index of the first flight event.
- trajectory_3d(*, filename=None)[source]#
Plot a 3D graph of the trajectory
- Parameters:
filename (
str | None, optional) – The path the plot should be saved to. By default None, in which case the plot will be shown instead of saved. Supported file endings are: eps, jpg, jpeg, pdf, pgf, png, ps, raw, rgba, svg, svgz, tif, tiff and webp (these are the formats supported by matplotlib).- Return type:
None
- _resolve_animation_model_path(file_name)[source]#
Resolve model path, defaulting to the built-in STL when omitted.
- _validate_animation_inputs(file_name, start, stop, time_step)[source]#
Validate shared input parameters for 3D animation methods.
- static _rotation_from_quaternion(q0, q1, q2, q3)[source]#
Convert unit quaternion to axis-angle representation in degrees.
- _create_animation_box(start, scale=1.0)[source]#
Create a world box with minimum visible dimensions.
- static _require_interactive_vedo_backend(vedo)[source]#
Ensure vedo can open an interactive VTK window for the animation.
The animations drive an interactive render loop, which needs a desktop window. In Jupyter/headless environments vedo defaults to the
"2d"backend, where everyrender()call fails with the cryptic"No active Plotter found for the 2d backend". Fail early with a clear, actionable message instead.
- animate_trajectory(file_name=None, start=0, stop=None, time_step=0.1, **kwargs)[source]#
Animate 6-DOF trajectory and attitude using vedo.
- Parameters:
file_name (
str | None, optional) – Path to a 3D model file representing the rocket, usually.stl. If None, RocketPy uses a built-in default STL model. Default is None.start (
int,float, optional) – Animation start time in seconds. Default is 0.stop (
int,float | None, optional) – Animation end time in seconds. If None, usesflight.t_final. Default is None.time_step (
float, optional) – Animation frame step in seconds. Must be greater than 0. Default is 0.1.**kwargs (
dict, optional) – Additional keyword arguments passed tovedo.Plotter.show.
- animate_rotate(file_name=None, start=0, stop=None, time_step=0.1, **kwargs)[source]#
Animate rocket attitude (rotation-only view) using vedo.
- Parameters:
file_name (
str | None, optional) – Path to a 3D model file representing the rocket, usually.stl. If None, RocketPy uses a built-in default STL model. Default is None.start (
int,float, optional) – Animation start time in seconds. Default is 0.stop (
int,float | None, optional) – Animation end time in seconds. If None, usesflight.t_final. Default is None.time_step (
float, optional) – Animation frame step in seconds. Must be greater than 0. Default is 0.1.**kwargs (
dict, optional) – Additional keyword arguments passed tovedo.Plotter.show.
- linear_kinematics_data(*, filename=None)[source]#
Prints out all Kinematics graphs available about the Flight
- Parameters:
filename (
str | None, optional) – The path the plot should be saved to. By default None, in which case the plot will be shown instead of saved. Supported file endings are: eps, jpg, jpeg, pdf, pgf, png, ps, raw, rgba, svg, svgz, tif, tiff and webp (these are the formats supported by matplotlib).- Return type:
None
- attitude_data(*, filename=None)[source]#
Prints out all Angular position graphs available about the Flight
- Parameters:
filename (
str | None, optional) – The path the plot should be saved to. By default None, in which case the plot will be shown instead of saved. Supported file endings are: eps, jpg, jpeg, pdf, pgf, png, ps, raw, rgba, svg, svgz, tif, tiff and webp (these are the formats supported by matplotlib).- Return type:
None
- flight_path_angle_data(*, filename=None)[source]#
Prints out Flight path and Rocket Attitude angle graphs available about the Flight
- Parameters:
filename (
str | None, optional) – The path the plot should be saved to. By default None, in which case the plot will be shown instead of saved. Supported file endings are: eps, jpg, jpeg, pdf, pgf, png, ps, raw, rgba, svg, svgz, tif, tiff and webp (these are the formats supported by matplotlib).- Return type:
None
- angular_kinematics_data(*, filename=None)[source]#
Prints out all Angular velocity and acceleration graphs available about the Flight
- Parameters:
filename (
str | None, optional) – The path the plot should be saved to. By default None, in which case the plot will be shown instead of saved. Supported file endings are: eps, jpg, jpeg, pdf, pgf, png, ps, raw, rgba, svg, svgz, tif, tiff and webp (these are the formats supported by matplotlib).- Return type:
None
- rail_buttons_bending_moments(*, filename=None)[source]#
Prints out Rail Buttons Bending Moments graphs.
- Parameters:
filename (
str | None, optional) – The path the plot should be saved to. By default None, in which case the plot will be shown instead of saved. Supported file endings are: eps, jpg, jpeg, pdf, pgf, png, ps, raw, rgba, svg, svgz, tif, tiff and webp (these are the formats supported by matplotlib).- Return type:
None
- rail_buttons_forces(*, filename=None)[source]#
Prints out all Rail Buttons Forces graphs available about the Flight.
- Parameters:
filename (
str | None, optional) – The path the plot should be saved to. By default None, in which case the plot will be shown instead of saved. Supported file endings are: eps, jpg, jpeg, pdf, pgf, png, ps, raw, rgba, svg, svgz, tif, tiff and webp (these are the formats supported by matplotlib).- Return type:
None
- aerodynamic_forces(*, filename=None)[source]#
Prints out all Forces and Moments graphs available about the Flight
- Parameters:
filename (
str | None, optional) – The path the plot should be saved to. By default None, in which case the plot will be shown instead of saved. Supported file endings are: eps, jpg, jpeg, pdf, pgf, png, ps, raw, rgba, svg, svgz, tif, tiff and webp (these are the formats supported by matplotlib).- Return type:
None
- energy_data(*, filename=None)[source]#
Prints out all Energy components graphs available about the Flight
- Parameters:
filename (
str | None, optional) – The path the plot should be saved to. By default None, in which case the plot will be shown instead of saved. Supported file endings are: eps, jpg, jpeg, pdf, pgf, png, ps, raw, rgba, svg, svgz, tif, tiff and webp (these are the formats supported by matplotlib).- Return type:
None
- fluid_mechanics_data(*, filename=None)[source]#
Prints out a summary of the Fluid Mechanics graphs available about the Flight
- Parameters:
filename (
str | None, optional) – The path the plot should be saved to. By default None, in which case the plot will be shown instead of saved. Supported file endings are: eps, jpg, jpeg, pdf, pgf, png, ps, raw, rgba, svg, svgz, tif, tiff and webp (these are the formats supported by matplotlib).- Return type:
None
- stability_and_control_data(*, filename=None)[source]#
Prints out Rocket Stability and Control parameters graphs available about the Flight
- Parameters:
filename (
str | None, optional) – The path the plot should be saved to. By default None, in which case the plot will be shown instead of saved. Supported file endings are: eps, jpg, jpeg, pdf, pgf, png, ps, raw, rgba, svg, svgz, tif, tiff and webp (these are the formats supported by matplotlib).- Return type:
None
- pressure_rocket_altitude(*, filename=None)[source]#
Plots out pressure at rocket’s altitude.
- Parameters:
filename (
str | None, optional) – The path the plot should be saved to. By default None, in which case the plot will be shown instead of saved. Supported file endings are: eps, jpg, jpeg, pdf, pgf, png, ps, raw, rgba, svg, svgz, tif, tiff and webp (these are the formats supported by matplotlib).- Return type:
None
- pressure_signals()[source]#
Plots out all Parachute Trigger Pressure Signals. This function can be called also for plot pressure data for flights without Parachutes, in this case the Pressure Signals will be simply the pressure provided by the atmosphericModel, at Flight z positions. This means that no noise will be considered if at least one parachute has not been added.
This function aims to help the engineer to visually check if there are anomalies with the Flight Simulation.
- Return type:
None
- static _FlightPlots__signed_angle_ylim(angle_function, t_start, t_end, margin=5)#
Return
(ymin, ymax)limits for a signed angle plotted betweent_startandt_end. The range is based only on the samples inside that time window so the full (positive and negative) oscillation is visible, unlike a fixed floor at zero which would clip it.