Skip to content

Introduce bias/diff maps and animations#1912

Open
SavvasMel wants to merge 3 commits intoecmwf:developfrom
SavvasMel:SavvasMel/develop/diff_maps
Open

Introduce bias/diff maps and animations#1912
SavvasMel wants to merge 3 commits intoecmwf:developfrom
SavvasMel:SavvasMel/develop/diff_maps

Conversation

@SavvasMel
Copy link
Contributor

@SavvasMel SavvasMel commented Feb 23, 2026

Description

This PR introduces the creation of diff maps (pred-target) or otherwise bias maps. Animations of those are also introduced in this PR.

Add to config the below:

default_streams:
  ERA5:
    channels: ["q_850", "2t"]
    evaluation:
      forecast_step: "1-4"
      sample: "all"
      ensemble: "all"
    plotting:
      sample: "all"
      forecast_step: "1-4"
      plot_maps: false
      plot_target: false
      plot_bias_maps: true  < ---------
      plot_histograms: false
      plot_animations: true

Issue Number

Closes #1772

Checklist before asking for review

  • I have performed a self-review of my code
  • My changes comply with basic sanity checks:
    • I have fixed formatting issues with ./scripts/actions.sh lint
    • I have run unit tests with ./scripts/actions.sh unit-test
    • I have documented my code and I have updated the docstrings.
    • I have added unit tests, if relevant
  • I have tried my changes with data and code:
    • I have run the integration tests with ./scripts/actions.sh integration-test
    • (bigger changes) I have run a full training and I have written in the comment the run_id(s): launch-slurm.py --time 60
    • (bigger changes and experiments) I have shared a hegdedoc in the github issue with all the configurations and runs for this experiments
  • I have informed and aligned with people impacted by my change:
    • for config changes: the MatterMost channels and/or a design doc
    • for changes of dependencies: the MatterMost software development channel

@SavvasMel
Copy link
Contributor Author

Example:

animation_jp5wyf6l_bias_0_ERA5_global_2t

if not isinstance(plot_maps, bool):
raise TypeError("plot_maps must be a boolean.")

plot_bias_maps = plot_settings.get("plot_bias_maps", False)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would enable it by default to True like plot_target now that the differences are so small.

Minor: can we change the name to plot_bias or plot_diff to match with plot_target ?

maps_config.update({var: {"vmax": float(max(list_max)), "vmin": float(min(list_min))}})

return maps_config
# Compute symmetric bias (preds - tars) ranges
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we split it into two functions? I think it will help readability and the two parts do not seem to be related right?

if not isinstance(global_plotting_opts.get(stream), oc.DictConfig):
global_plotting_opts[stream] = oc.DictConfig({})
maps_config = common_ranges(
maps_config, bias_maps_config = common_ranges(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very minor: same here, I'd shorted it to bias_config

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

generate diff plots and animations

2 participants