earthkit.climate.atmos.precipitation.wet_spell_frequency¶
- earthkit.climate.atmos.precipitation.wet_spell_frequency(pr: xarray.DataArray | str = 'pr', ds: xarray.Dataset | Any = None, *, thresh: Any = '1.0 mm', window: int = 3, freq: str = 'YS', resample_before_rl: bool = True, op: Literal['sum', 'min', 'max', 'mean'] = 'sum', **kwargs: Any) Any¶
Wet spell frequency.
The frequency of wet periods of N days or more, during which the accumulated or maximum precipitation over a given time window of days is equal or above a given threshold.
Units:
wet_spell_frequency: dimensionless
This function wraps xclim.indicators.atmos.wet_spell_frequency.
- Parameters:
pr (
xarray.DataArray | str) – Daily precipitation.thresh (
Any) – Precipitation amount over which a period is considered dry. The value against which the threshold is compared depends on op.window (
int) – Minimum length of the spells.freq (
str) – Resampling frequency.resample_before_rl (
bool) – Determines if the resampling should take place before or after the run length encoding (or a similar algorithm) is applied to runs.op (
Literal[``’sum’, ``'min','max','mean']) – Operation to perform on the window. Default is “sum”, which checks that the sum of accumulated precipitation over the whole window is more than the threshold. “min” checks that the maximal daily precipitation amount within the window is more than the threshold. This is the same as verifying that each individual day is above the threshold.ds (
xarray.Dataset | Any) – Input dataset.**kwargs (
Any) – Additional keyword arguments.
- Returns:
The computed index.
- Return type:
Any