earthkit.climate.atmos.temperature.freezethaw_spell_frequency

earthkit.climate.atmos.temperature.freezethaw_spell_frequency(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, op_tasmin: Literal['<', '<=', 'lt', 'le'] = '<=', op_tasmax: Literal['>', '>=', 'gt', 'ge'] = '>', freq: str = 'YS', resample_before_rl: bool = True, **kwargs: Any) Any

Freeze-thaw spell frequency.

Frequency 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_frequency: days

This function wraps xclim.indicators.atmos.freezethaw_spell_frequency.

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.

  • op_tasmin (Literal[``’<’, ``'<=', 'lt', 'le']) – Comparison operation for tasmin. Default: “<=”.

  • op_tasmax (Literal[``’>’, ``'>=', 'gt', 'ge']) – Comparison operation for tasmax. Default: “>”.

  • 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