Environment Plots Class#

class rocketpy.plots.environment_plots._EnvironmentPlots[source]#

Class that holds plot methods for Environment class.

Variables:
  • _EnvironmentPlots.environment (Environment) – Environment object that will be used for the plots.

  • _EnvironmentPlots.grid (list) – Height grid for Environment plots.

__init__(environment)[source]#

Initializes _EnvironmentPlots class.

Parameters:

environment (Environment) – Instance of the Environment class

Return type:

None

_break_direction_wraparound(directions, altitudes)[source]#

Inserts NaN into direction and altitude arrays at 0°/360° wraparound points so matplotlib does not draw a horizontal line across the plot.

Parameters:
  • directions (numpy.ndarray) – Wind direction values in degrees, dtype float.

  • altitudes (numpy.ndarray) – Altitude values corresponding to each direction, dtype float.

Returns:

  • directions (numpy.ndarray) – Direction array with NaN inserted at wraparound points.

  • altitudes (numpy.ndarray) – Altitude array with NaN inserted at wraparound points.

gravity_model(*, filename=None)[source]#

Plots the gravity model graph that represents the gravitational acceleration as a function of height.

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

atmospheric_model(*, filename=None)[source]#

Plots all atmospheric model graphs available. This includes wind speed and wind direction, density and speed of sound, wind u and wind v, and pressure and temperature.

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

ensemble_member_comparison(*, filename=None)[source]#

Plots ensemble member comparisons. It requires that the environment model has been set as Ensemble.

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

info(*, filename=None)[source]#

Plots a summary of the atmospheric model, including wind speed and wind direction, density and speed of sound. This is important for the Environment.info() method.

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

all()[source]#

Prints out all graphs available about the Environment. This includes a complete description of the atmospheric model and the ensemble members comparison if the atmospheric model is an ensemble.

Return type:

None

_EnvironmentPlots__density_speed_of_sound(ax)#

Adds density and speed of sound graphs to the same axis.

Parameters:

ax (matplotlib.pyplot.axis) – Axis to add the graphs.

Returns:

ax – Axis with the graphs.

Return type:

matplotlib.pyplot.axis

_EnvironmentPlots__pressure_temperature(ax)#

Adds pressure and temperature graphs to the same axis.

Parameters:

ax (matplotlib.pyplot.axis) – Axis to add the graphs.

Returns:

ax – Axis with the graphs.

Return type:

matplotlib.pyplot.axis

_EnvironmentPlots__wind(ax)#

Adds wind speed and wind direction graphs to the same axis.

Parameters:

ax (matplotlib.pyplot.axis) – Axis to add the graphs.

Returns:

ax – Axis with the graphs.

Return type:

matplotlib.pyplot.axis

_EnvironmentPlots__wind_components(ax)#

Adds wind u and wind v graphs to the same axis.

Parameters:

ax (matplotlib.pyplot.axis) – Axis to add the graphs.

Returns:

ax – Axis with the graphs.

Return type:

matplotlib.pyplot.axis