Some suggestions for the colormap scaling#1
Conversation
…parameter Adds `normalization: str = "state_std"` to `plot_error_heatmap` and rewrites `_get_heatmap_color_values` to support two explicit modes: - `"state_std"`: RMSE / state_std, white-to-red Reds colormap - `"one_step"`: RMSE / diff_std, white-to-red Reds colormap Both modes fall back to per-variable max (also Reds, [0,1]) when their required stat is missing. The two modes never silently upgrade to each other. Removes the custom `_HEATMAP_CMAP` in favour of the built-in `"Reds"` colormap string. Updates tests accordingly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Thanks @sadamov. I reviewed this locally and I like the direction overall. Making the normalization explicit is definitely clearer than the previous silent fallback chain, and from the COSMO examples I also agree that I reran the focused heatmap tests locally on this branch and they pass on my side.
If yes, I m happy to merge this into mllam#376. |
|
2 * yes. :) I think having a CLI flag just for this is too much. But having the explicit option in the code makes it easy to understand and change in research applications. Absolute RMSE across variables (Pa vs K vs m/s) produces an unreadable colormap dominated by whichever variable has the largest physical units. Per-variable max at least preserves the relative evolution across lead times per variable. |
|
I agree with keeping the normalization choice as an explicit code-level option rather than a dedicated CLI flag, and I also agree that per-variable max is the better fallback than raw absolute RMSE across mixed-unit variables. |
11a925d
into
kshirajahere:fix/-#375-Improvements-to-plot_error_map-function
This PR replaces the implicit 3-level fallback chain in
_get_heatmap_color_valueswith an explicitnormalizationparameter onplot_error_heatmap. I think this should be a clear choice. But would argue that state_std is the better default than diff_std. There is no need however to expose this flag to the user I don't think.normalization"state_std"(default)state_std"diff_std"state_diff_std_standardizedandstate_stdBoth modes fall back to per-variable max normalization when their required stat is missing (legacy behavior). Here I think the absolute error values between variables are just too different and the heatmap is not really meaningful at that point.
I had to update the docstrings and the tests accordingly.