radarx.retrieve.tracking.cell_statistics#

radarx.retrieve.tracking.cell_statistics(cells, fields, *, stats=('mean', 'max'), n_threads=None, engine='auto')[source]#

Time series of statistics of fields inside every storm cell.

Parameters:
  • cells (xarray.Dataset or xarray.DataArray) – The cell numbers on (time, y, x): CELL_ID of track_cells() (the cells are the tracks) or CELL_LABEL of identify_cells() (the cells are numbered in every volume).

  • fields (xarray.DataArray or xarray.Dataset) – The fields on the grid of the cells (y, x and time), for example the azimuthal shear, the lightning density, the depth of the ZDR column or a DSD parameter. A field with a vertical dimension must be reduced first.

  • stats (sequence of str, optional) – Any of "mean", "max", "min", "sum" and "count" (the number of grid points with a value). Default ("mean", "max").

  • 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 – One variable <NAME>_<stat> per field and statistic on (cell, time), NaN where the cell has no grid point with a value at that time.

Raises:

ValueError – For an unknown engine or statistic, cells or fields without the dimensions time, y and x or on another grid.

Notes

Dask. This function computes the dask array: the statistics of a cell are collected over all grid points of the volume. The input is loaded into memory and the result is held in memory.

Examples

>>> series = radarx.retrieve.cell_statistics(tracks.CELL_ID, shear, stats=("max",))