radarx.retrieve.sorting.storm_size_sorting#

radarx.retrieve.sorting.storm_size_sorting(obj, kdp=None, zdr=None, rhohv=None, *, level=None, box=None, region=None, motion=None, wind=None, min_rhohv=0.93, min_cells=10, step=0.5, n_threads=None, engine='auto')[source]#

KDP-ZDR separation vector and size sorting parameter of the volumes of a grid.

See radarx.retrieve.sorting for the method of Loeffler and Kumjian (2018) and for what the paper leaves open.

Parameters:
  • obj (xarray.Dataset) – Fields on a grid with the coordinates x (east) and y (north) in m and, if there are several volumes, time. A vertical dimension (z, altitude, height or level) is reduced to its lowest level, or the one nearest to level.

  • kdp, zdr, rhohv (str, optional) – Names of the specific differential phase (degrees km-1), the differential reflectivity (dB) and the copolar correlation coefficient. Default: the first usual name of KDP and ZDR; rhohv has no default and without it the correlation coefficient is not used.

  • level (float, optional) – Height (m) of the grid level to use. Default: the lowest.

  • box (tuple of float, optional) – Analysis region (xmin, xmax, ymin, ymax) in m. Default: the whole grid.

  • region (xarray.DataArray of bool, optional) – Analysis region as a mask on the grid (and time), for example cells == 5. Combined with box.

  • motion (tuple, xarray.Dataset or None, optional) – Storm motion (u, v) in m/s, or a dataset with u and v (scalars or one value per time, e.g. from radarx.retrieve.estimate_motion()). Default: fitted to the centroids over the volumes (needs at least two volumes with centroids).

  • wind (tuple of float, optional) – Mean environmental wind (u, v) in m/s of the sorting layer. If given, the angle to the storm-relative wind is returned.

  • min_rhohv (float, optional) – Smallest correlation coefficient of a grid point of the regions. Default 0.93. Used only with rhohv.

  • min_cells (int, optional) – Smallest number of grid points of a region (N_G of the paper). Default 10.

  • step (float, optional) – Step of the adaptive thresholds, in degrees km-1 and dB. Default 0.5.

  • n_threads (int, optional) – Threads for the compiled kernel. Default: all cores.

  • engine ({"auto", "compiled", "numpy"}, optional) – Implementation to use. "auto" (default) prefers the compiled kernel and falls back to NumPy.

Returns:

xarray.Dataset – On time (NaN where a region does not exist): KDP_THRESHOLD and ZDR_THRESHOLD, KDP_CENTROID_X, KDP_CENTROID_Y, ZDR_CENTROID_X and ZDR_CENTROID_Y (m), KDP_REGION_AREA and ZDR_REGION_AREA (km2), STORM_MOTION_U and STORM_MOTION_V (m/s), SEPARATION_DISTANCE (km), SEPARATION_BEARING (degrees clockwise from north, direction of the vector), SEPARATION_ORIENTATION (degrees, from -180 to 180, positive clockwise from the storm motion, i.e. to its right), SIZE_SORTING_PARAMETER (km, the distance times the absolute sine of the orientation) and, with wind, SORTING_WIND_ANGLE (degrees, 0 to 180).

Raises:
  • ValueError – For an unknown engine, a field with other dimensions than y, x and time (after the vertical level is chosen), a missing grid coordinate, a min_cells below 1, a step that is not positive, or a time dimension without a time coordinate when the motion is fitted.

  • KeyError – If a field is not found.

  • TypeError – If obj is not a dataset or motion is not a pair.

Notes

Dask. This function computes the dask array: the storm motion is fitted to the centroids of all volumes. The input is loaded into memory and the result is held in memory.

See also

zdr_arc, estimate_motion

References

Loeffler, S. D., and M. R. Kumjian, 2018: Quantifying the separation of enhanced ZDR and KDP regions in nonsupercell tornadic storms. Wea. Forecasting, 33, 1143-1157, https://doi.org/10.1175/WAF-D-18-0011.1

Examples

>>> res = radarx.retrieve.storm_size_sorting(grid, rhohv="RHOHV", box=(0, 20e3, 0, 20e3))
>>> res.SEPARATION_ORIENTATION