earthkit.climate.atmos.temperature.freezethaw_spell_mean_length¶
- earthkit.climate.atmos.temperature.freezethaw_spell_mean_length(tasmin: xarray.DataArray | str = 'tasmin', tasmax: xarray.DataArray | str = 'tasmax', ds: xarray.Dataset | Any = None, *, thresh_tasmin: Any = '0 degC', thresh_tasmax: Any = '0 degC', window: int = 1, freq: str = 'YS', resample_before_rl: bool = True, **kwargs: Any) Any¶
Freeze-thaw spell mean length.
Average length of daily freeze-thaw spells. A freeze-thaw spell is defined as a number of consecutive days where maximum daily temperatures are above a given threshold and minimum daily temperatures are at or below a given threshold, usually 0°C for both.
Units:
freezethaw_spell_mean_length: days
This function wraps xclim.indicators.atmos.freezethaw_spell_mean_length.
- Parameters:
tasmin (
xarray.DataArray | str) – Minimum daily temperature.tasmax (
xarray.DataArray | str) – Maximum daily temperature.thresh_tasmin (
Any) – The temperature threshold needed to trigger a freeze event.thresh_tasmax (
Any) – The temperature threshold needed to trigger a thaw event.window (
int) – The minimal length of spells to be included in the statistics.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