Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion rocketpy/AeroSurfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -1464,7 +1464,6 @@ def geometricInfo(self):
return None

def aerodynamicInfo(self):

print(f"\nTail name: {self.name}")
print(f"Tail Center of Pressure Position in Local Coordinates: {self.cp} m")
print(f"Tail Lift Coefficient Slope: {self.clalpha:.3f} 1/rad")
Expand Down
53 changes: 1 addition & 52 deletions rocketpy/Environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import warnings
from datetime import datetime, timedelta

import matplotlib.pyplot as plt
import numpy as np
import numpy.ma as ma
import pytz
Expand Down Expand Up @@ -3022,58 +3021,8 @@ def info(self):
None
"""

# All prints
self.prints.all()

# Plot graphs
print("\n\nAtmospheric Model Plots")
# Create height grid
grid = np.linspace(self.elevation, self.maxExpectedHeight)

# Create figure
plt.figure(figsize=(9, 4.5))

# Create wind speed and wind direction subplot
ax1 = plt.subplot(121)
ax1.plot(
[self.windSpeed(i) for i in grid], grid, "#ff7f0e", label="Speed of Sound"
)
ax1.set_xlabel("Wind Speed (m/s)", color="#ff7f0e")
ax1.tick_params("x", colors="#ff7f0e")
ax1up = ax1.twiny()
ax1up.plot(
[self.windDirection(i) for i in grid],
grid,
color="#1f77b4",
label="Density",
)
ax1up.set_xlabel("Wind Direction (°)", color="#1f77b4")
ax1up.tick_params("x", colors="#1f77b4")
ax1up.set_xlim(0, 360)
ax1.set_ylabel("Height Above Sea Level (m)")
ax1.grid(True)

# Create density and speed of sound subplot
ax2 = plt.subplot(122)
ax2.plot(
[self.speedOfSound(i) for i in grid],
grid,
"#ff7f0e",
label="Speed of Sound",
)
ax2.set_xlabel("Speed of Sound (m/s)", color="#ff7f0e")
ax2.tick_params("x", colors="#ff7f0e")
ax2up = ax2.twiny()
ax2up.plot(
[self.density(i) for i in grid], grid, color="#1f77b4", label="Density"
)
ax2up.set_xlabel("Density (kg/m³)", color="#1f77b4")
ax2up.tick_params("x", colors="#1f77b4")
ax2.set_ylabel("Height Above Sea Level (m)")
ax2.grid(True)

plt.subplots_adjust(wspace=0.5)
plt.show()
self.plots.info()
return None

def allInfo(self):
Expand Down
16 changes: 7 additions & 9 deletions rocketpy/EnvironmentAnalysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,6 @@ def parsePressureLevelData(self):

# Loop through time and save all values
for timeIndex, timeNum in enumerate(timeNumArray):

dateString, hourString, dateTime = self.__timeNumToDateString(
timeNum, timeNumArray.units, calendar="gregorian"
)
Expand Down Expand Up @@ -820,7 +819,6 @@ def parseSurfaceData(self):

# Loop through time and save all values
for timeIndex, timeNum in enumerate(timeNumArray):

dateString, hourString, dateTime = self.__timeNumToDateString(
timeNum, timeNumArray.units, calendar="gregorian"
)
Expand Down Expand Up @@ -2138,7 +2136,7 @@ def plot_wind_gust_distribution_over_average_day(self):
gs = fig.add_gridspec(nrows, ncols, hspace=0, wspace=0, left=0.12)
axs = gs.subplots(sharex=True, sharey=True)
x_min, x_max, y_min, y_max = 0, 0, 0, 0
for (i, j) in [(i, j) for i in range(nrows) for j in range(ncols)]:
for i, j in [(i, j) for i in range(nrows) for j in range(ncols)]:
hour = hours[i * ncols + j]
ax = axs[i, j]
ax.set_title(f"{float(hour):05.2f}".replace(".", ":"), y=0.8)
Expand Down Expand Up @@ -2300,7 +2298,7 @@ def plot_sustained_surface_wind_speed_distribution_over_average_day(
gs = fig.add_gridspec(nrows, ncols, hspace=0, wspace=0, left=0.12)
axs = gs.subplots(sharex=True, sharey=True)
x_min, x_max, y_min, y_max = 0, 0, 0, 0
for (i, j) in [(i, j) for i in range(nrows) for j in range(ncols)]:
for i, j in [(i, j) for i in range(nrows) for j in range(ncols)]:
hour = hours[i * ncols + j]
ax = axs[i, j]
ax.set_title(f"{float(hour):05.2f}".replace(".", ":"), y=0.8)
Expand Down Expand Up @@ -2344,7 +2342,7 @@ def plot_sustained_surface_wind_speed_distribution_over_average_day(
)

if windSpeedLimit:
for (i, j) in [(i, j) for i in range(nrows) for j in range(ncols)]:
for i, j in [(i, j) for i in range(nrows) for j in range(ncols)]:
# Clear Sky Range Altitude Limits j]
ax = axs[i, j]
ax.vlines(
Expand Down Expand Up @@ -2677,7 +2675,7 @@ def plot_wind_profile_over_average_day(self, clear_range_limits=False):
gs = fig.add_gridspec(nrows, ncols, hspace=0, wspace=0, left=0.12)
axs = gs.subplots(sharex=True, sharey=True)
x_min, x_max, y_min, y_max = 0, 0, np.inf, 0
for (i, j) in [(i, j) for i in range(nrows) for j in range(ncols)]:
for i, j in [(i, j) for i in range(nrows) for j in range(ncols)]:
hour = hours[i * ncols + j]
ax = axs[i, j]
ax.plot(*self.average_wind_profile_at_given_hour[hour], "r-")
Expand Down Expand Up @@ -2710,7 +2708,7 @@ def plot_wind_profile_over_average_day(self, clear_range_limits=False):
)

if clear_range_limits:
for (i, j) in [(i, j) for i in range(nrows) for j in range(ncols)]:
for i, j in [(i, j) for i in range(nrows) for j in range(ncols)]:
# Clear Sky Range Altitude Limits
ax = axs[i, j]
ax.fill_between(
Expand Down Expand Up @@ -2819,7 +2817,7 @@ def plot_wind_heading_profile_over_average_day(self, clear_range_limits=False):
gs = fig.add_gridspec(nrows, ncols, hspace=0, wspace=0, left=0.12)
axs = gs.subplots(sharex=True, sharey=True)
x_min, x_max, y_min, y_max = 0, 0, np.inf, 0
for (i, j) in [(i, j) for i in range(nrows) for j in range(ncols)]:
for i, j in [(i, j) for i in range(nrows) for j in range(ncols)]:
hour = hours[i * ncols + j]
ax = axs[i, j]
ax.plot(*self.average_wind_heading_profile_at_given_hour[hour], "r-")
Expand All @@ -2844,7 +2842,7 @@ def plot_wind_heading_profile_over_average_day(self, clear_range_limits=False):
)

if clear_range_limits:
for (i, j) in [(i, j) for i in range(nrows) for j in range(ncols)]:
for i, j in [(i, j) for i in range(nrows) for j in range(ncols)]:
# Clear Sky range limits
ax = axs[i, j]
ax.fill_between(
Expand Down
2 changes: 0 additions & 2 deletions rocketpy/Parachute.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,11 @@ def __str__(self):
)

def info(self):

self.prints.all()

return None

def allInfo(self):

self.info()
# self.plots.all() # Parachutes still doesn't have plots

Expand Down
1 change: 0 additions & 1 deletion rocketpy/plots/compare/compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ def create_comparison_figure(
raise AttributeError(f"Invalid attribute {y_attributes[i]}.")

for i, subplot in enumerate(ax):

# Set the labels for the x and y axis
subplot.set_xlabel(x_labels[i])
subplot.set_ylabel(y_labels[i])
Expand Down
4 changes: 0 additions & 4 deletions rocketpy/plots/compare/compare_flights.py
Original file line number Diff line number Diff line change
Expand Up @@ -1204,7 +1204,6 @@ def compare_trajectories_3d(

# Iterate through trajectories
for index, flight in enumerate(flights):

x, y, z = flight

# Update mx and min values to set the limits of the plot
Expand Down Expand Up @@ -1383,7 +1382,6 @@ def __plot_xy(

# Iterate through trajectories
for index, flight in enumerate(flights):

x, y, _ = flight

# Update mx and min values to set the limits of the plot
Expand Down Expand Up @@ -1447,7 +1445,6 @@ def __plot_xz(

# Iterate through trajectories
for index, flight in enumerate(flights):

x, _, z = flight

# Update mx and min values to set the limits of the plot
Expand Down Expand Up @@ -1514,7 +1511,6 @@ def __plot_yz(

# Iterate through trajectories
for index, flight in enumerate(flights):

_, y, z = flight

# Update mx and min values to set the limits of the plot
Expand Down
Loading