Skip to content

Disaggregation of temporally coarse forecasts results in NaNs - #247

Open
jonasbhend wants to merge 3 commits into
mainfrom
fix/unavailable_aggregated_values
Open

Disaggregation of temporally coarse forecasts results in NaNs#247
jonasbhend wants to merge 3 commits into
mainfrom
fix/unavailable_aggregated_values

Conversation

@jonasbhend

@jonasbhend jonasbhend commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

When disaggregating forecasts with 6hourly resolution to hourly, the necessary input data is not available. This PR fixes the default behaviour (error) to allow plotting of meteograms and dashboards for diverse datasets of forecasters (6-hourly) and temporal downscalers (1-hourly).

Summary of changes

  • ensure only available lead times are loaded from grib files
  • reindex before cumsum to avoid error

@jonasbhend
jonasbhend requested a review from dnerini August 11, 2026 11:46
@dnerini

dnerini commented Aug 12, 2026

Copy link
Copy Markdown
Member

hi @jonasbhend, the code changes look good to me, but I'm not entirely sure I understand the problem. Is this issue affecting baselines or ML runs? can you provide a concrete example scenario that would trigger it?

existing = [p for p in all_paths if p.exists()]
missing = [p for p in all_paths if not p.exists()]
if missing:
LOG.debug(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

should there be some way to distinguish "expected coarser resolution" from "unexpected missing data"? should this be LOG.warning instead of debug to avoid that real data problems go unnoticed?

@jonasbhend jonasbhend changed the title Disaggregation of coarse data results in NaNs Disaggregation of temporally coarse forecasts results in NaNs Aug 13, 2026
@jonasbhend

Copy link
Copy Markdown
Contributor Author

hi @jonasbhend, the code changes look good to me, but I'm not entirely sure I understand the problem. Is this issue affecting baselines or ML runs? can you provide a concrete example scenario that would trigger it?

The concrete example is this config with a forecaster and a temporal downscaler being evaluated side-by-side (something we have done before). With explicit aggregations (i.e. TOT_PREC1 and TOT_PREC6), this will result in an error for both the experiment and meteogram use cases:

# yaml-language-server: $schema=../workflow/tools/config.schema.json
description: |
  Evaluate skill of Varda-single-1.0 against ground observations.

config_label: varda-single-1.0

dates:
  start: 2025-03-01T00:00
  end: 2025-03-03T00:00
  frequency: 24h

runs:
  - temporal_downscaler:
      checkpoint: https://service.meteoswiss.ch/mlstore#/models/sruc-m-2-interpolator/versions/3
      label: Varda-single-1.0
      steps: 0/120/1
      config: resources/inference/configs/sgm-temporal-downscaler-global_trimedge_multi.yaml
      extra_requirements:
        - anemoi-datasets==0.5.35
        # NOTE this pins the merge commit that introduced 'copy-prognostic-from-forecaster'
        # TODO pin a release tag once the plugins are versioned. Do not pin the main branch to avoid stale code (changes do to main to not change the evalml hash)
        - git+https://github.com/MeteoSwiss/anemoi-plugins-meteoswiss.git@b4835d76346e1e5ec0181884520da00e317fbfbc
        # - anemoi-inference==0.11.0
      forecaster:
        checkpoint: https://service.meteoswiss.ch/mlstore#/models/sruc-m-1-forecaster/versions/4
        config: resources/inference/configs/sgm-multidataset-forecaster-global-ich1-oper.yaml
        steps: 0/120/6
  - forecaster:
      label: Forecaster
      checkpoint: https://service.meteoswiss.ch/mlstore#/models/sruc-m-1-forecaster/versions/4
      config: resources/inference/configs/sgm-multidataset-forecaster-global-ich1-oper.yaml
      steps: 0/120/6

experiment:
  params:
    - TOT_PREC1
    - TOT_PREC6
...

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants