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.sortingfor the method of Loeffler and Kumjian (2018) and for what the paper leaves open.- Parameters:
obj (
xarray.Dataset) – Fields on a grid with the coordinatesx(east) andy(north) in m and, if there are several volumes,time. A vertical dimension (z,altitude,heightorlevel) is reduced to its lowest level, or the one nearest tolevel.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;rhohvhas 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 (
tupleoffloat, optional) – Analysis region(xmin, xmax, ymin, ymax)in m. Default: the whole grid.region (
xarray.DataArrayofbool, optional) – Analysis region as a mask on the grid (and time), for examplecells == 5. Combined withbox.motion (
tuple,xarray.DatasetorNone, optional) – Storm motion(u, v)in m/s, or a dataset withuandv(scalars or one value per time, e.g. fromradarx.retrieve.estimate_motion()). Default: fitted to the centroids over the volumes (needs at least two volumes with centroids).wind (
tupleoffloat, 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 withrhohv.min_cells (
int, optional) – Smallest number of grid points of a region (N_Gof 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– Ontime(NaN where a region does not exist):KDP_THRESHOLDandZDR_THRESHOLD,KDP_CENTROID_X,KDP_CENTROID_Y,ZDR_CENTROID_XandZDR_CENTROID_Y(m),KDP_REGION_AREAandZDR_REGION_AREA(km2),STORM_MOTION_UandSTORM_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, withwind,SORTING_WIND_ANGLE(degrees, 0 to 180).- Raises:
ValueError – For an unknown
engine, a field with other dimensions thany,xandtime(after the vertical level is chosen), a missing grid coordinate, amin_cellsbelow 1, astepthat 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
objis not a dataset ormotionis 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_motionReferences
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