radarx.retrieve.biology.biological_echo#

radarx.retrieve.biology.biological_echo(obj, model=None, *, fields=('DBZH', 'VRADH', 'WRADH'), elevations=(0.5, 1.5, 2.5, 3.5, 4.5), weather_threshold=0.45, size=608, resolution=500.0, providers=None)[source]#

Biology and weather probabilities from MistNet (ONNX).

Parameters:
  • obj (xarray.DataTree) – A WSR-88D volume with sweep_* groups (xradar). For each of elevations the sweep nearest in fixed angle that holds all fields is used (the Doppler cut of NEXRAD split cuts).

  • model (str or path or radarx.ml.Model, optional) – Default "mistnet-nexrad", the published MistNet weights converted to ONNX on first use; or an ONNX file with the same input and output, a registry name or a loaded model.

  • fields (tuple of str, optional) – Reflectivity (dBZ), radial velocity and spectrum width (m s⁻¹), as measured (velocities need not be dealiased). Default ("DBZH", "VRADH", "WRADH").

  • elevations (tuple of float, optional) – The five input elevations (degrees). Default 0.5° to 4.5° in 1° steps.

  • weather_threshold (float, optional) – Weather probability above which a gate is weather, on its own sweep or on the mean of the five sweeps. Default 0.45, the value of MISTNET_WEATHER_THRESHOLD and MISTNET_SCAN_AVERAGE_WEATHER_THRESHOLD in vol2bird (lib/constants.h), the reference implementation of Lin et al. (2019) [1]; not checked against the paper.

  • size, resolution (int, float, optional) – Cells per side and cell size (m) of the Cartesian input grid. Default 608 and 500 m, MISTNET_DIMENSION and MISTNET_RESOLUTION of vol2bird, the grid of the network input.

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

Returns:

xarray.DataTree – The root of the input and, for each of the five sweeps used, biology_probability and weather_probability (0-1) and biological_echo (bool: reflectivity present and not weather) on the sweep’s dimensions and coordinates (NaN / False beyond ±150 km). Merge them into the volume with .radarx.assign(products). Attributes ml_model, ml_model_version, ml_model_licence and ml_model_citation.

Notes

Inputs, grid, thresholds and the network follow the vol2bird implementation and the upstream weights, see the module documentation for what was checked against which file; the paper of Lin et al. (2019) [1] was not checked. Model licence: MIT (github.com/adokter/ MistNet); the licence and citation are written to the ml_model_licence and ml_model_citation attributes of the output.

Dask. This function computes the dask array: the network classifies the whole volume at once. The input is loaded into memory and the result is held in memory.

References

Examples

>>> bio = radarx.retrieve.biological_echo(dtree)
>>> dtree = dtree.radarx.assign(bio)