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

Commit

Permalink
exclude nans from error colorbards
Browse files Browse the repository at this point in the history
  • Loading branch information
anaprietonem committed Dec 19, 2024
1 parent 38b75fa commit ce88b03
Showing 1 changed file with 3 additions and 2 deletions.
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

0 comments on commit ce88b03

Please sign in to comment.