Skip to content

Avoid extrapolation in nearest neighbour interpolation - #212

Open
jonasbhend wants to merge 6 commits into
mainfrom
fix/extrapolation
Open

Avoid extrapolation in nearest neighbour interpolation#212
jonasbhend wants to merge 6 commits into
mainfrom
fix/extrapolation

Conversation

@jonasbhend

@jonasbhend jonasbhend commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

When truth and forecast data are mapped, forecasts are extrapolated ad infinitum even if the forecast data covers only a subset of the domain. This is currently the case for INCA forecasts and the inner verification domain (aka most of the high-resolution domain). To avoid misinterpretation of evaluation results, we propose to suppress extrapolation and report missing values for regions that are not fully covered. This PR implements this change.

Spatial coverage fraction

To allow for varying number of stations with observations by parameter, we compute the missing value fraction as the number of non-missing forecast / obs pairs divided by the number of non-missing observations. Currently the missing-value-fraction threshold is set to zero, because in this framework, we don't expect any missing forecasts other than incomplete domain coverage, which should indeed be masked.

Summary of changes

  • report distance between nearest neighbours
  • estimate native grid spacing
  • set extrapolated values to missing based on distnace with nearest neighbour and estimated grid spacing
  • compute missing value fraction for area averages of verification results and mask results where too many points are missing
  • do not mask observation metrics, as in the current implementation observation coverage is 'complete' by definition

@jonasbhend jonasbhend mentioned this pull request Jul 7, 2026
@jonasbhend
jonasbhend requested a review from dnerini July 20, 2026 12:55
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.

1 participant