Feature/global trends figs: global_trends trend-fields figure + teleconnections HadISST SST reference - #54
Open
armellereca wants to merge 4 commits into
Open
Feature/global trends figs: global_trends trend-fields figure + teleconnections HadISST SST reference#54armellereca wants to merge 4 commits into
armellereca wants to merge 4 commits into
Conversation
The global_trends diagnostic previously produced only the observed trend
plus model-obs trend *difference* panels per variable/period. Add a second
figure ({var}_{period}_trend_fields) rendering the observed trend and each
simulated trend field directly on a shared symmetric colorbar (no
differencing), so absolute warming/cooling and precipitation-change
patterns can be compared side by side.
- Reuses already-computed field data (model annual_regrid/seasonal_regrids,
benchmark MMM and individual CMIP6 regrids) and the shared field colorbar
range — no extra computation.
- Obs panel label now derived from var_info.obs_dataset instead of hardcoded
ERA5.
- run() skip-existing check expects both combined and fields figure ids.
- LLM figure-type prompt updated to describe both trend-map variants.
- Tests updated for the new figure count (5 -> 10 per variable).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The SST-based teleconnection indices (ENSO Nino 3.4, IOD, PDO) loaded their obs reference from tos -> ESA-CCI, whose configured file only spans 1990-2014. Against models running from 1980 this left the observed ENSO index empty before ~1990, and the panel — hardcoded as "ERA5" — was actually ESA-CCI. Add an optional obs_dataset/obs_variable override to ModeDefinition and point the three SST modes at ERA5 sst (full 1940-2024 record, already configured). This fills the pre-1990 gap and makes the "ERA5" label truthful. Deseasonalised anomalies are unit-invariant, so K-vs-K needs no conversion. Non-SST modes (SLP/wind) already resolve to ERA5 and are unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
HadISST provides a long, homogeneous SST record (1870-present) better suited to variability-mode analysis than ERA5 SST. Point the ENSO/IOD/PDO obs override at HADISST/sst and add a per-mode obs_label so the observation panel, spectrum, seasonal-variance legend, pattern panel, and metadata stats keys all read "HadISST" for SST modes while non-SST modes keep "ERA5". Fixes the pre-1990 gap that ESA-CCI (1990-2014 only) left in the observed ENSO index. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
HadISST flags land/sea-ice cells with sentinel fill values (-1000.0, -1e30). Mask any non-physical SST to NaN right after loading the obs override so sentinels cannot corrupt Nino/IOD box means or the PDO North-Pacific EOF. The mask window covers either °C or K storage. Both EOF paths already drop non-finite columns and box means skip NaN, so the change is safe downstream. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two independent diagnostic improvements for the EERIE/CMIP6 evaluation:
global_trends: add an absolute trend-fields figure alongside the existing trend-difference figure.teleconnections: use HadISST as the SST reference for the SST-based variability modes (ENSO, IOD, PDO), replacing ESA-CCI whose file only spans 1990–2014.1. Global trends — absolute trend fields
The
global_trendsdiagnostic previously produced only the observed trend plus model−obs trend difference panels per variable/period. It now also emits a second figure,{var}_{period}_trend_fields, showing the observed trend and each simulated trend field directly on a shared symmetric colorbar (no differencing), so absolute warming/cooling and precipitation-change patterns can be compared side by side.annual_regrid/seasonal_regrids, benchmark MMM and individual CMIP6 regrids) and the shared field colorbar range — no extra computation.var_info.obs_datasetinstead of hardcoded ERA5.run()'s skip-existing check covers bothcombinedandfieldsfigure ids.groupmetadata field) — no template changes needed.2. Teleconnections — HadISST SST reference
The SST-based teleconnection indices (ENSO Niño 3.4, IOD, PDO) loaded their obs reference from
tos → ESA-CCI, whose configured file only spans 1990–2014. Against models running from 1980 this left the observed ENSO index empty before ~1990, and the panel — hardcoded as "ERA5" — was actually ESA-CCI.obs_dataset/obs_variableoverride toModeDefinitionand pointed the three SST modes at HadISST (HADISST/sst, full 1870–present record). Non-SST modes (SLP/wind) already resolve to ERA5 and are unchanged.obs_labelso the observation panel, spectrum legend, seasonal-variance legend, pattern panel, and metadata stats keys all read "HadISST" for SST modes and "ERA5" for the rest.-1000.0,-1e30). These are masked to NaN right after loading the override so they cannot corrupt Niño/IOD box means or the PDO North-Pacific EOF. Both EOF paths already drop non-finite columns and box means skip NaN, so the change is safe downstream.Tests
global_trends: updated figure-count assertions (5 → 10 per variable), skip-existing pre-creation, and the summary-stats filter.teleconnections: added aload()method to the mock obs loader, registry assertions for the HadISST override + labels, and a fill-value masking test.tests/test_global_trends.py(107) andtests/test_teleconnections.py(69) pass.Regeneration
Full-resolution runs — execute in a compute environment, not the login node:
🤖 Generated with Claude Code