earthkit.climate.atmos.cold_spell_duration_index¶
- earthkit.climate.atmos.cold_spell_duration_index(tasmin: xarray.DataArray | str = 'tasmin', tasmin_per: xarray.DataArray | str = 'tasmin_per', ds: xarray.Dataset | Any = None, *, window: int = 6, freq: str = 'YS', resample_before_rl: bool = True, bootstrap: bool = False, op: Literal['<', '<=', 'lt', 'le'] = '<', **kwargs: Any) Any¶
Cold spell duration index (csdi).
Number of days part of a percentile-defined cold spell. A cold spell occurs when the daily minimum temperature is below a given percentile for a given number of consecutive days.
Units:
csdi_{window}: days
This function wraps xclim.indicators.atmos.cold_spell_duration_index.
- Parameters:
tasmin (
xarray.DataArray | str) – Minimum daily temperature.tasmin_per (
xarray.DataArray | str) – The nth percentile of daily minimum temperature with dayofyear coordinate.window (
int) – Minimum number of days with temperature below threshold to qualify as a cold 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.bootstrap (
bool) – Flag to run bootstrapping of percentiles. Used by percentile_bootstrap decorator. Bootstrapping is only useful when the percentiles are computed on a part of the studied sample. This period, common to percentiles and the sample must be bootstrapped to avoid inhomogeneities with the rest of the time series. Keep bootstrap to False when there is no common period, as bootstrapping is computationally expensive, and it might provide the wrong results.op (
Literal[``’<’, ``'<=','lt','le']) – Comparison operation. Default: “<”.ds (
xarray.Dataset | Any) – Input dataset.**kwargs (
Any) – Additional keyword arguments.
- Returns:
The computed index.
- Return type:
Any