earthkit.climate.atmos.wet_spell_total_length

earthkit.climate.atmos.wet_spell_total_length(pr: xarray.DataArray | str = 'pr', ds: xarray.Dataset | Any = None, *, thresh: Any = '1.0 mm', window: int = 3, op: Literal['min', 'sum', 'max', 'mean'] = 'sum', freq: str = 'YS', resample_before_rl: bool = True, **kwargs: Any) Any

Wet spell total length.

The total length of dry 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_total_length: days

This function wraps xclim.indicators.atmos.wet_spell_total_length.

Parameters:
  • pr (xarray.DataArray | str) – Daily precipitation.

  • thresh (Any) – Accumulated precipitation value over which a period is considered wet.

  • window (int) – Number of days when the maximum or accumulated precipitation is over the threshold.

  • op (Literal[``’min’, ``'sum', 'max', 'mean']) – Reduce operation. min means that all days within the minimum window must exceed the threshold. sum means that the accumulated precipitation within the window must exceed the threshold. In all cases, the whole window is marked a part of a wet spell.

  • 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.

  • ds (xarray.Dataset | Any) – Input dataset.

  • **kwargs (Any) – Additional keyword arguments.

Returns:

The computed index.

Return type:

Any