Skip to content
Merged
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
16 changes: 10 additions & 6 deletions examples/steps_blended_forecast.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,9 @@

precip_forecast = blending.steps.forecast(
precip=radar_precip,
precip_nowcast=fc_lagrangian_extrapolation,
precip_nowcast=np.array(
[fc_lagrangian_extrapolation]
), # Add an extra dimension, becuase precip_nowcast has to be 4-dimensional
precip_models=nwp_precip,
velocity=velocity_radar,
velocity_models=velocity_nwp,
Expand Down Expand Up @@ -304,7 +306,7 @@
# forecast has become more important and the forecast starts to resemble the
# NWP forecast more.

fig = plt.figure(figsize=(5, 12))
fig = plt.figure(figsize=(6, 12))

leadtimes_min = [30, 60, 90, 120, 150, 180]
n_leadtimes = len(leadtimes_min)
Expand All @@ -329,7 +331,7 @@
plot_precip_field(
fc_lagrangian_extrapolation_mmh[idx, :, :],
geodata=radar_metadata,
title=f"Extrapolated +{leadtime} min",
title=f"NWC +{leadtime} min",
axis="off",
colorscale="STEPS-NL",
colorbar=False,
Expand All @@ -355,7 +357,9 @@

precip_forecast = blending.steps.forecast(
precip=radar_precip,
precip_nowcast=fc_lagrangian_extrapolation,
precip_nowcast=np.array(
[fc_lagrangian_extrapolation]
), # Add an extra dimension, becuase precip_nowcast has to be 4-dimensional
precip_models=nwp_precip,
velocity=velocity_radar,
velocity_models=velocity_nwp,
Expand Down Expand Up @@ -387,7 +391,7 @@
# Visualize the output
# ~~~~~~~~~~~~~~~~~~~~

fig = plt.figure(figsize=(5, 12))
fig = plt.figure(figsize=(8, 12))

leadtimes_min = [30, 60, 90, 120, 150, 180]
n_leadtimes = len(leadtimes_min)
Expand Down Expand Up @@ -422,7 +426,7 @@
# Raw extrapolated nowcast
ax3 = plt.subplot(n_leadtimes, 4, n * 4 + 3)
plot_precip_field(
fc_lagrangian_extrapolation_mmh[0, idx, :, :],
fc_lagrangian_extrapolation_mmh[idx, :, :],
geodata=radar_metadata,
title=f"NWC + {leadtime} min",
axis="off",
Expand Down