Skip to content

feat: Add logic to copy prognostics from forecaster to downscaler at overlapping timesteps - #219

Draft
MicheleCattaneo wants to merge 8 commits into
mainfrom
feat/copy-prognostic-from-forecaster
Draft

feat: Add logic to copy prognostics from forecaster to downscaler at overlapping timesteps#219
MicheleCattaneo wants to merge 8 commits into
mainfrom
feat/copy-prognostic-from-forecaster

Conversation

@MicheleCattaneo

@MicheleCattaneo MicheleCattaneo commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Adds an optional opt-in copy_prognostic_from_forecaster flag for temporal downscalers.
When enabled on a downscaler run that has a forecaster parent, overwrite the prognostic variables at the overlap steps in the downscaler's GRIB with the forecaster's values, so forecaster-alone and forecaster+downscaler metrics agree at multiples of the forecaster stride. Diagnostics (typically tp) are left untouched. It's going to be off by default, maintaining the current behavior.

Everything is defined from the downscaler's anemoi.json:

  • Overlap detection: config.training.explicit_times ({input:[0,6], target:[1..6]}): overlap_offsets = set(input) ∩ set(target) (={6}), window stride = max(input) (=6); global overlap steps = multiples of the stride within the run's steps. If the intersection is empty → log "no overlap" and no-op.
  • Detect prognostic list: data_indices.data.data.output.prognostic. output.diagnostic (such as ['tp']) is never copied.

TODO:

  • Config flag + validation
  • GRIB patching script (earthkit-data, patching both output streams, using model's metadata)
  • Snakemake wiring
  • End-to-end verification
  • Tests (maybe?)

@MicheleCattaneo MicheleCattaneo added the enhancement New feature or request label Jul 17, 2026
@MicheleCattaneo
MicheleCattaneo requested a review from dnerini July 17, 2026 16:07
@MicheleCattaneo
MicheleCattaneo marked this pull request as draft July 20, 2026 08:10
@MicheleCattaneo
MicheleCattaneo marked this pull request as ready for review July 20, 2026 15:59
@MicheleCattaneo
MicheleCattaneo marked this pull request as draft July 22, 2026 09:48
@MicheleCattaneo

Copy link
Copy Markdown
Contributor Author

As discussed with @hlasco, we will try to move the logic in an anemoi plugin. This PR will then mostly reduce to a config change and an added dependency on the plugin for the inference environment.
Please ignore the proposed changes for now!

@MicheleCattaneo

Copy link
Copy Markdown
Contributor Author

MeteoSwiss/anemoi-plugins-meteoswiss#33

Introduces the plugin

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant