Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
6bb32e6
Introduced focus area and reconstruction plots callback
icedoom888 Jan 7, 2026
bd21daa
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 7, 2026
d0f79ec
gpc passed
icedoom888 Jan 7, 2026
e59b633
Merge branch 'feature/reconstruction-plots' of github.com:ecmwf/anemo…
icedoom888 Jan 7, 2026
6bc758a
Added missing plot
icedoom888 Jan 7, 2026
621e417
Fixed import for test
icedoom888 Jan 7, 2026
470f4e7
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 7, 2026
07b1e13
Removed hardware mistake
icedoom888 Jan 7, 2026
bf21d7a
Merge branch 'feature/reconstruction-plots' of github.com:ecmwf/anemo…
icedoom888 Jan 7, 2026
8d682d3
Fixed implementation
icedoom888 Jan 8, 2026
7168266
Removed init error
icedoom888 Jan 8, 2026
dbb56c7
Added documentation for focus area
icedoom888 Jan 8, 2026
b3a2397
gpc passed
icedoom888 Jan 8, 2026
d706c14
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 8, 2026
0ea900e
Merge branch 'feature/reconstruction-plots' of github.com:ecmwf/anemo…
icedoom888 Jan 8, 2026
3c388b3
Added schemas
icedoom888 Jan 8, 2026
f98eb76
Added reconstruction schema
icedoom888 Jan 8, 2026
5567d9f
Fixed schema
icedoom888 Jan 8, 2026
199d0a1
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 8, 2026
7b48efa
Added latlot to base
icedoom888 Jan 9, 2026
bf26340
Merge branch 'feature/reconstruction-plots' of github.com:ecmwf/anemo…
icedoom888 Jan 9, 2026
1256feb
Added latlon to base
icedoom888 Jan 9, 2026
0953960
Fixed get focus mask
icedoom888 Jan 9, 2026
2207372
Fixed plotting
icedoom888 Jan 9, 2026
c629c4b
Fixed plotting
icedoom888 Jan 9, 2026
fb90178
Fixed repetition in schema
icedoom888 Jan 9, 2026
25aae51
Merge branch 'main' into feature/reconstruction-plots
icedoom888 Jan 9, 2026
f54b021
moved func to maps and added asserts
icedoom888 Jan 12, 2026
35f8b95
Merge branch 'feature/reconstruction-plots' of github.com:ecmwf/anemo…
icedoom888 Jan 12, 2026
4d8ca5e
gpc passed
icedoom888 Jan 13, 2026
7c5d66e
Refactored to keep only changes concerning focus_area
icedoom888 Jan 13, 2026
9f8b994
Refactored latlon_bounds and spatial_mask
icedoom888 Jan 13, 2026
5d1d7fe
Merge branch 'feature/focus-area' into feature/reconstruction-plots
icedoom888 Jan 13, 2026
be6396d
Refactored and rebased on focus_area PR
icedoom888 Jan 13, 2026
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
71 changes: 46 additions & 25 deletions training/docs/modules/diagnostics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,8 @@ callback, any other kwarg is passed to the callback's constructor.

Plotting callbacks are configured in a similar way, but they are
specified underneath the ``config.diagnostics.plot.callbacks`` key.

This is done to ensure seperation and ease of configuration between
experiments.

``config.diagnostics.plot`` is a broader config file specifying the
parameters to plot, as well as the plotting frequency, and
asynchronosity.
Expand All @@ -60,14 +58,36 @@ background thread, allowing plotting tasks to be offloaded to worker
threads. This setup keeps the main thread responsive, handling
plot-related tasks asynchronously and efficiently in the background.

**Focus Area**

Plotting callbacks (such as ``PlotSample``, ``PlotLoss``, and ``LongRolloutPlots``) support a ``focus_area`` parameter. This allows you to restrict the geographic scope of plots to specific regions or masks. A focus area can be defined in two ways:

* **Mask Name**: A ``mask_attr_name`` string referencing a boolean mask defined within the graph data.
* **Lat/Lon Bounds**: A ``latlon_bbox`` list specifying a bounding box: ``[lat_min, lon_min, lat_max, lon_max]``.

When a focus area is applied, the plot filenames and experiment log tags will automatically include a suffix (e.g., ``_mask_attr_name`` or ``_latlon_bbox``) to distinguish them from global plots.

.. code:: yaml

# Example: Focusing on a specific geographic region
- _target_: anemoi.training.diagnostics.callbacks.plot.PlotSample
sample_idx: ${diagnostics.plot.sample_idx}
parameters: ${diagnostics.plot.parameters}
focus_area:
latlon_bbox: [30.0, -20.0, 60.0, 40.0]

**Rendering Methods**

There is an additional flag in the plotting callbacks to control the
rendering method for geospatial plots, offering a trade-off between
performance and detail. When `datashader` is set to True, Datashader is
used for rendering, which accelerates plotting through efficient
hexbining, particularly useful for large datasets. This approach can
produce smoother-looking plots due to the aggregation of data points. If
`datashader` is set to False, matplotlib.scatter is used, which provides
sharper and more detailed visuals but may be slower for large datasets.
performance and detail.

* When `datashader` is set to True, Datashader is
used for rendering, which accelerates plotting through efficient
hexbining, particularly useful for large datasets. This approach can
produce smoother-looking plots due to the aggregation of data points.
* If `datashader` is set to False, matplotlib.scatter is used, which provides
sharper and more detailed visuals but may be slower for large datasets.

**Note** - this asynchronous behaviour is only available for the
plotting callbacks.
Expand All @@ -77,9 +97,7 @@ plotting callbacks.
The progress bar callback can be configured to control how training
progress is displayed. This is particularly useful on HPC systems with
SLURM where output is written to files, as the default RichProgressBar
in PyTorch Lightning 2.6+ may not work correctly.

The progress bar is controlled by two configuration options:
in PyTorch Lightning 2.6+ may not work correctly. The progress bar is controlled by two configuration options:

- ``enable_progress_bar``: A boolean flag to enable or disable the
progress bar entirely
Expand Down Expand Up @@ -109,28 +127,31 @@ which is recommended for interactive terminals and
epoch: 5

# Parameters to plot
parameters:
parameters:
- z_500
- t_850
- u_850

Sample index
sample_idx: 0
# Sample index
sample_idx: 0

# Precipitation and related fields
precip_and_related_fields: [tp, cp]
# Precipitation and related fields
precip_and_related_fields: [tp, cp]

callbacks:
callbacks:
- _target_: anemoi.training.diagnostics.callbacks.plot.PlotLoss
# group parameters by categories when visualizing contributions to the loss
# one-parameter groups are possible to highlight individual parameters
parameter_groups:
moisture: [tp, cp, tcw]
sfc_wind: [10u, 10v]
# group parameters by categories when visualizing contributions to the loss
parameter_groups:
moisture: [tp, cp, tcw]
sfc_wind: [10u, 10v]
# Example focusing loss on a predefined mask
focus_area:
mask_attr_name: "cutout_mask"

- _target_: anemoi.training.diagnostics.callbacks.plot.PlotSample
sample_idx: ${diagnostics.plot.sample_idx}
per_sample : 6
parameters: ${diagnostics.plot.parameters}
sample_idx: ${diagnostics.plot.sample_idx}
per_sample : 6
parameters: ${diagnostics.plot.parameters}

Below is the documentation for the default callbacks provided, but it is
also possible for users to add callbacks using the same structure:
Expand Down
1 change: 1 addition & 0 deletions training/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ optional-dependencies.docs = [
"sphinx-rtd-theme",
]
optional-dependencies.plotting = [
"cartopy>=0.25",
"distinctipy>=1",
]
optional-dependencies.profile = [
Expand Down
Loading