Skip to content

Commit 2ceca6a

Browse files
Enh: Added windspeed forecast comparation plots and env configuration option
1 parent e5c920c commit 2ceca6a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

rocketpy/EnvironmentAnalysis.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ def __init__(
7272
load_previous_data=None,
7373
forecast_comparaison=False,
7474
forecast_date=None,
75+
forecast_args=None
7576
):
7677
"""Constructor for the EnvironmentAnalysis class.
7778
Parameters
@@ -224,8 +225,8 @@ def __init__(
224225
longitude=self.longitude,
225226
elevation=self.elevation,
226227
)
227-
Env.setAtmosphericModel(type="Ensemble", file="GEFS")
228-
Env.selectEnsembleMember(1)
228+
forecast_args = forecast_args or {'type': 'Forecast', 'file': 'GFS'}
229+
Env.setAtmosphericModel(**forecast_args)
229230
self.forecast[hour] = Env
230231

231232

@@ -2549,8 +2550,8 @@ def plot_wind_profile_over_average_day(self, SAcup_altitude_constraints=False):
25492550

25502551
if self.forecast:
25512552
forecast = self.forecast
2552-
x = self.average_wind_profile_at_given_hour[hour][0]
2553-
y = forecast[hour].windSpeed.getValue(x)
2553+
y = self.average_wind_profile_at_given_hour[hour][1]
2554+
x = forecast[hour].windSpeed.getValue(y) * convert_units(1, "m/s", self.unit_system['wind_speed'])
25542555
ax.plot(x, y, "b--")
25552556

25562557
ax.label_outer()

0 commit comments

Comments
 (0)