Skip to content
This repository was archived by the owner on Dec 20, 2024. It is now read-only.

Exclude nans from increment and persistent error color bars #208

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft
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
5 changes: 3 additions & 2 deletions src/anemoi/training/diagnostics/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,7 @@ def error_plot_in_degrees(array1: np.ndarray, array2: np.ndarray) -> np.ndarray:
# For 'errors', only persistence and increments need identical colorbar-limits
combined_error = np.concatenate(((pred - input_), (truth - input_)))
norm = Normalize(vmin=np.nanmin(combined_data), vmax=np.nanmax(combined_data))
norm_error = TwoSlopeNorm(vmin=np.nanmin(combined_error), vcenter=0.0, vmax=np.nanmax(combined_error))
single_plot(fig, ax[1], lon, lat, truth, norm=norm, title=f"{vname} target", datashader=datashader)
single_plot(fig, ax[2], lon, lat, pred, norm=norm, title=f"{vname} pred", datashader=datashader)
single_plot(
Expand Down Expand Up @@ -688,7 +689,7 @@ def error_plot_in_degrees(array1: np.ndarray, array2: np.ndarray) -> np.ndarray:
lat,
pred - input_,
cmap="bwr",
norm=TwoSlopeNorm(vmin=combined_error.min(), vcenter=0.0, vmax=combined_error.max()),
norm=norm_error,
title=f"{vname} increment [pred - input]",
datashader=datashader,
)
Expand All @@ -699,7 +700,7 @@ def error_plot_in_degrees(array1: np.ndarray, array2: np.ndarray) -> np.ndarray:
lat,
truth - input_,
cmap="bwr",
norm=TwoSlopeNorm(vmin=combined_error.min(), vcenter=0.0, vmax=combined_error.max()),
norm=norm_error,
title=f"{vname} persist err",
datashader=datashader,
)
Expand Down
Loading