radarx.retrieve.tracking.identify_cells#
- radarx.retrieve.tracking.identify_cells(obj, field=None, *, thresholds, min_area=10.0, segmentation_threshold=None, smooth=None, connectivity=8, n_threads=None, engine='auto')[source]#
Storm cells of every volume of a grid: multi-threshold features and watershed.
See
radarx.retrieve.trackingfor the method (Heikenfeld et al. 2019).- Parameters:
obj (
xarray.DataArrayorxarray.Dataset) – The field (DataArray) or a dataset with it, on the horizontal dimensionsyandx(m) with any leading (time) dimensions. A vertical dimension (z,altitude,heightorlevel) is reduced to its maximum, the composite.field (
str, optional) – Name of the field in a dataset. Default: the first ofDBZH,DBZ,reflectivityandcorrected_reflectivity.thresholds (sequence of
float) – Thresholds of the field in ascending order, for example(30, 40, 50)dBZ. A cell is found at the highest threshold it reaches.min_area (
float, optional) – Smallest area (km2) of a region above a threshold. Default 10.segmentation_threshold (
float, optional) – Value of the field down to which a cell extends. Default: the lowest threshold; it cannot be higher.smooth (
float, optional) – Width (standard deviation, grid cells) of a Gaussian filter that is applied to the field first. DefaultNone: none. A missing value counts as a value below the lowest threshold.connectivity (
{4, 8}, optional) – Whether grid points that touch at a corner are connected. Default 8.n_threads (
int, optional) – Threads for the compiled kernels. Default: all cores.engine (
{"auto", "compiled", "numpy"}, optional) – Implementation to use."auto"(default) prefers the compiled kernels and falls back to NumPy.
- Returns:
xarray.Dataset–CELL_LABEL(the number of the cell at every grid point, 0 for none, numbered from 1 in every volume in the raster order of the first point of its feature) andCELL_COUNT(the number of cells per volume).- Raises:
ValueError – For an unknown
engine, thresholds that are not ascending, asegmentation_thresholdabove the lowest threshold, aconnectivitythat is not 4 or 8 or a field without the dimensionsyandx.KeyError – If the field is not found.
Notes
Dask and extra dimensions. The fields may have extra leading dimensions (for example
timeorvolume): each sweep is processed on its own and the result has the same extra dimensions. Dask arrays stay lazy: the result is a dask array and nothing is computed until it is (the sweep dimensions are rechunked into one chunk).See also
References
Heikenfeld, M., P. J. Marinescu, M. Christensen, D. Watson-Parris, F. Senf, S. C. van den Heever, and P. Stier, 2019: tobac 1.2: towards a flexible framework for tracking and analysis of clouds in diverse datasets. Geosci. Model Dev., 12, 4551-4570, https://doi.org/10.5194/gmd-12-4551-2019
Examples
>>> cells = radarx.retrieve.identify_cells(grid, thresholds=(30, 40, 50)) >>> cells.CELL_COUNT