HailCast-ML
A web map for following thunderstorms and estimating hail risk from open radar data, physical hail indices and a gradient boosting model.
- Role
- Author
- When
- August 2026 to September 2026
- Stack
- TypeScript, Vite, Leaflet, Chart.js, Python, scikit-learn
- Source code private
Context
Hail is one of the most damaging weather events in northern Italy, and the Po Valley sees some of the strongest summer thunderstorms in Europe. Public radar data is available, but turning a reflectivity map into "is hail likely to reach this town in the next hour?" takes several steps. HailCast-ML is an experiment in putting those steps together in a browser.
What I built
Radar map. A Leaflet map with selectable basemaps and animated radar overlays from the RainViewer global mosaic and the national radar network of the Italian Civil Protection Department, including past frames and short term projections.
Physical hail indices. For a storm cell, the app computes the Severe Hail Index (SHI) and the Maximum Estimated Size of Hail (MESH) following Witt et al. (1998), and the Probability of Hail (POH) following Waldvogel et al. (1979). These are standard radar based indices; the formulas and their derivation are documented in the repository.
Atmospheric context. Instability and wind shear indicators (CAPE, Lifted Index, 0 to 6 km bulk shear, freezing level) come from Open-Meteo forecast soundings and are shown in a telemetry drawer with a vertical reflectivity profile.
Storm tracking. Cell centroids are tracked between frames to estimate speed and direction, and uncertainty cones are projected at 15, 30, 45 and 60 minutes. Searching for a town (geocoded with Nominatim) returns distance, estimated arrival time and a risk card.
Machine learning. A Python training pipeline (scikit-learn gradient boosting) and a small decision tree ensemble written in TypeScript, which runs in the browser, combine radar and atmospheric features into a hail probability.
Limitations
The model is trained on a synthetic dataset generated in the training script from the physical relationships above, not on observed hail reports. It shows how such a pipeline fits together, but its probabilities are not a validated forecast and should not be used to make decisions. For real warnings, follow the official weather services.