Skip to content

Commit

Permalink
MNT: speedup Flight._calculate_pressure_signal method
Browse files Browse the repository at this point in the history
- Initializing a Function object is complicated. Instead, let's sum two Functions
  • Loading branch information
Gui-FernandesBR committed Mar 26, 2024
1 parent 9b47dfe commit 6deb233
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions rocketpy/simulation/flight.py
Original file line number Diff line number Diff line change
Expand Up @@ -3074,17 +3074,13 @@ def _calculate_pressure_signal(self):
"Pressure - Without Noise (Pa)",
"linear",
)
parachute.noisy_pressure_signal_function = Function(
parachute.noisy_pressure_signal,
"Time (s)",
"Pressure - With Noise (Pa)",
"linear",
)
parachute.noise_signal_function = Function(
parachute.noise_signal, "Time (s)", "Pressure Noise (Pa)", "linear"
)

return None
parachute.noisy_pressure_signal_function = (
parachute.clean_pressure_signal_function
+ parachute.noise_signal_function
)

def post_process(self, interpolation="spline", extrapolation="natural"):
"""This method is **deprecated** and is only kept here for backwards
Expand Down

0 comments on commit 6deb233

Please sign in to comment.