Skip to content

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

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

alanseed wants to merge 8 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.17804% with 65 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.61%. Comparing base (f4ebd1d) to head (1c70c12).

Files with missing lines Patch % Lines
pysteps/nowcasts/parametric.py 94.27% 15 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.62% 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.61%   +0.85%     
==========================================
  Files         170      178       +8     
  Lines       15114    16461    +1347     
==========================================
+ Hits        12811    14093    +1282     
- Misses       2303     2368      +65     
Flag Coverage Δ
unit_tests 85.61% <95.17%> (+0.85%) ⬆️

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
@RubenImhoff

Copy link
Copy Markdown
Contributor

Many thanks for this contribution, @alanseed! I will have a look at this soon. I probably have to reserve some time for it, because it requires a thorough review (and especially understanding) of the used method. Any chance you are planning to visit (in person or virtually) the next pysteps hackathon? Then we can always discuss there, too. :)

@RubenImhoff

Copy link
Copy Markdown
Contributor

@ladc and @dnerini, I have also added you as reviewers for now, just to have an extra pair of eyes looking at it.

@alanseed

alanseed commented Oct 22, 2026 via email

Copy link
Copy Markdown
Author

@ladc

ladc commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Hi @alanseed, thank you very much for this contribution! I will make time for it during and after the hackathon next week - the preparations for which are now in full swing :)
I'd be very interested to hear your presentation, so we need to account for our time zone difference. We are currently living in UTC+1. What time slots would be acceptable for you? Our evening would also be fine for us. All the best!

@alanseed

Copy link
Copy Markdown
Author

hi @ladc I am on UTC+11 (AEDT) so either 9:00 or 20:00 your local time would work for me just fine on any day of the hackathon.

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.

3 participants