radarx.retrieve.tornado.tornado_probability#

radarx.retrieve.tornado.tornado_probability(obj, model=None, *, stride=(30, 60), batch_size=16, providers=None, **kwargs)[source]#

Tornado probability from the TorNet CNN baseline (ONNX).

Parameters:
  • obj (xarray.DataTree or xarray.Dataset) – A WSR-88D volume (see tornet_inputs()), or a Dataset of prepared inputs as returned by tornet_inputs().

  • model (str or path or radarx.ml.Model, optional) – Model to run. Default "tornet-baseline-v1", the published TorNet weights converted to ONNX on first use. A path to an ONNX file with the same inputs and outputs, a name in the radarx model registry or a loaded model can be given instead.

  • stride (tuple of int, optional) – Step (rays, gates) between the 120 x 240 chips that tile the sweep. Default (30, 60), a quarter of the chip.

  • batch_size (int, optional) – Chips per inference call. Default 16.

  • providers (list of str, optional) – ONNX Runtime execution providers. Default: CPU.

  • **kwargs – Passed to tornet_inputs() (elevations, field, dealias, nyquist_velocity, kdp, max_range, tolerance).

Returns:

xarray.Dataset – tornado_probability (0-1, float32) on the (azimuth, range) grid of tornet_inputs(): for every gate the logistic function of the network’s logit map (16 x 16 gates per cell) of the chips that cover it, the maximum over overlapping chips. chip_probability on chip: the TorNet output (logistic of the maximum logit) of every chip, with the azimuth and range of the chip centre. Attributes ml_model, ml_model_version, ml_model_licence and ml_model_citation.

Raises:

ValueError – If the volume has no dual-polarisation sweep at an elevation: the network needs RHOHV and ZDR (and reflectivity) from a sweep within tolerance degrees of each of the two elevations (0.5 and 0.9 degrees by default), and the velocity field from a Doppler sweep there. A volume with only reflectivity and velocity, such as a WSR-88D volume from before the dual-polarisation upgrade of 2011-2013, is refused.

Notes

The network was trained on samples centred on storm cells, about 6.8 % of them confirmed tornadoes (Veillette et al. 2025 [1], section 2c), so its output is a likelihood on the TorNet sample distribution rather than a calibrated frequency for arbitrary gates. The paper (section 3c.4) shows that the raw likelihood is over-confident for mid-range values (0.2-0.7) and under-confident above 0.8, and fits an isotonic calibration (Brier score 0.0423 before and 0.0404 after on the test set); that calibration is not applied here.

Skill of the network (TorNet test set, from the paper, not measured here). Table 2 (i) of the arXiv preprint (“confirmed tornadoes versus all nulls”, test set of 31 467 samples, mean of five random seeds) gives for the CNN an area under the ROC curve of 0.8742 and a maximum critical success index of 0.3380 (the maxima taken over all thresholds); for comparison the operational TVS gives 0.6308 and 0.2002. Those numbers belong to chips of the TorNet test set, not to the full-scan output of this function, and the published version of the paper may differ. The model file used here is the released one (Hugging Face tornet-ml/tornado_detector_baseline_v1, MIT licence), which is not necessarily one of the five seeds of the table.

Dask. This function computes the dask array: the result combines the gates of all sweeps of the volume. The input is loaded into memory and the result is held in memory.

References

Examples

>>> out = radarx.retrieve.tornado_probability(dtree)
>>> out.tornado_probability.plot()