Skip to content
Open
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
8 changes: 6 additions & 2 deletions src/services/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,17 @@ def from_env_model(cls, env: EnvironmentModel) -> Self:
elevation=env.elevation,
date=env.date,
)
# RocketPy guards pressure/temperature against None but NOT wind, so a
# custom_atmosphere with wind_u/wind_v left unset raises
# "'NoneType' object has no attribute 'shape'". Default missing wind to 0
# (only None is replaced — real 0.0 values and wind profiles pass through).
rocketpy_env.set_atmospheric_model(
type=env.atmospheric_model_type,
file=env.atmospheric_model_file,
pressure=env.pressure,
temperature=env.temperature,
wind_u=env.wind_u,
wind_v=env.wind_v,
wind_u=env.wind_u if env.wind_u is not None else 0.0,
wind_v=env.wind_v if env.wind_v is not None else 0.0,
)
return cls(environment=rocketpy_env)

Expand Down
Loading