Skip to content

Add parametric ensemble nowcasting and calibrated stochastic rainfall generation - #578

Open
alanseed wants to merge 5 commits into
pySTEPS:masterfrom
alanseed:parametric-nowcasting
Open

alanseed wants to merge 5 commits into
pySTEPS:masterfrom
alanseed:parametric-nowcasting

Conversation

@alanseed

Copy link
Copy Markdown

Adds a parametric ensemble nowcast method that accepts three chronological NumPy rain-rate fields, estimates its parameters internally, and returns an ensemble in mm/h. Users can select it through nowcasts.get_method("parametric") without a database or an external workflow.

Related to #472.

Changes

  • Add rainfall marginal and spectral estimators, Lagrangian correlation estimates, and AR(2) persistence utilities.
  • Add a calibrated stochastic rainfall generator with reproducible random streams and calibration diagnostics.
  • Add the three-observation engine, including motion estimation or supplied velocity, configurable regional defaults, diagnostics, and lead-wise callbacks.
  • Add API documentation, user guides, synthetic and Swiss radar nowcast examples, and a companion calibrated-noise example.

The contribution stops at the NumPy nowcast interface. Database storage, operational orchestration, NWP blending, and a separate non-parametric engine remain outside its scope. No new runtime dependencies are introduced; default motion estimation uses the existing OpenCV dependency.

Scientific basis and validation

Defaults retain the evaluated source configuration and can be overridden for other regions. The supporting manuscript is being prepared for submission to QJRMS; it is not yet a published reference. Source revisions, numerical fixtures, and configuration provenance are recorded under doc/proposals/.

  • 154 estimator, calibrated-generator, and engine tests pass in the dedicated Python 3.12 pysteps environment.
  • The implementation was also checked using an extracted wheel and real radar histories. With identical selected parameters, complete forecasts matched the reference implementation exactly. Estimating parameters independently introduced small numerical differences, documented with their forecast effects in doc/proposals/parametric_engine.md and its validation reports.
  • The Swiss nowcast and calibrated-noise examples were run with the sample radar data and their figures inspected.
  • Complete repository test suite.
  • Repository-wide Black check.
  • Sphinx documentation and gallery build.

Review

Feedback is welcome on the public API, placement of the reusable components, documentation of the regional defaults, and whether maintainers would prefer the components submitted as separate pull requests.

@alanseed alanseed self-assigned this Oct 14, 2026
@codecov

codecov Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.09579% with 64 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.58%. Comparing base (f4ebd1d) to head (e747357).

Files with missing lines Patch % Lines
pysteps/nowcasts/parametric.py 94.26% 14 Missing ⚠️
pysteps/noise/parametric.py 91.30% 12 Missing ⚠️
pysteps/timeseries/parametric.py 91.11% 12 Missing ⚠️
pysteps/utils/spectral.py 86.66% 10 Missing ⚠️
pysteps/utils/statistics.py 90.32% 6 Missing ⚠️
pysteps/postprocessing/probmatching.py 88.37% 5 Missing ⚠️
pysteps/nowcasts/_cascade_advection.py 85.71% 3 Missing ⚠️
pysteps/tests/test_nowcasts_parametric.py 99.58% 1 Missing ⚠️
pysteps/tests/test_parametric_estimators.py 99.44% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #578      +/-   ##
==========================================
+ Coverage   84.76%   85.58%   +0.82%     
==========================================
  Files         170      178       +8     
  Lines       15114    16418    +1304     
==========================================
+ Hits        12811    14051    +1240     
- Misses       2303     2367      +64     
Flag Coverage Δ
unit_tests 85.58% <95.09%> (+0.82%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@alanseed
alanseed marked this pull request as ready for review October 19, 2026 00:00

This branch has not been deployed

No deployments
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