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.Datasetorxarray.DataArray) – The cell numbers on(time, y, x):CELL_IDoftrack_cells()(the cells are the tracks) orCELL_LABELofidentify_cells()(the cells are numbered in every volume).fields (
xarray.DataArrayorxarray.Dataset) – The fields on the grid of the cells (y,xandtime), 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
engineor statistic, cells or fields without the dimensionstime,yandxor 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.
See also
Examples
>>> series = radarx.retrieve.cell_statistics(tracks.CELL_ID, shear, stats=("max",))