icclim.generic#

Generic indices.

The generic indices public API, via icclim.generic package, is generated from the icclim.generic.registry.GenericIndicatorRegistry registry definitions. icclim’s generic indices are a generalization of the climate indices found in ECAD and DCSC’s registries. They can be computed on any dataset and make use of the Threshold interface to enable the creation of personalized indices. The parameters of the functions are specialized to each index but are all taken from icclim.main.index general function. The generic indices exposed by icclim.generic are specialized entry points built from icclim.main.index for generic indicator definitions.

Examples

>>> from icclim.generic import count_occurrences
>>> from icclim import build_threshold
>>> thresh = build_threshold(">= 25 °C and <= 30 °C")
>>> result = count_occurrences("tas.nc", thresh).compute()
>>> print(result.count_occurrences)

Submodules#

Package Contents#

icclim’s API for generic indices.

This module has been auto-generated. To modify these, edit the extractor tool in tools/extract-icclim-funs.py. This module exposes each climate index as individual functions for convenience.

count_occurrences

Count occurrences when threshold(s) are met (e.g. SU, Tx90p, RR1).

max_consecutive_occurrence

Count the maximum number of consecutive occurrences when threshold(s) are met (e.g. CDD, CSU, CWD).

sum_of_spell_lengths

Sum the lengths of each consecutive occurrence spell when threshold(s) are met.

excess

Compute the excess over the given threshold.

deficit

Compute the deficit below the given threshold.

fraction_of_total

Compute the fraction of values meeting threshold(s) over the sum of every values (e.g. R75pTOT, R95pTOT).

maximum

Maximum of values that met threshold(s), if threshold(s) are given (e.g. Txx, Tnx).

minimum

Minimum of values that met threshold(s), if threshold(s) are given (e.g. Txn, Tnn).

average

Average of values that met threshold(s), if threshold(s) are given (e.g. Tx, Tn).

sum

Sum of values that met threshold(s), if threshold(s) are given (e.g. PRCPTOT, RR).

standard_deviation

Standard deviation of values that met threshold(s), if threshold(s) are given.

max_of_rolling_sum

Maximum of rolling sum over time dimension (e.g. RX5DAY: maximum 5 days window of precipitation accumulation).

min_of_rolling_sum

Minimum of rolling sum over time dimension.

max_of_rolling_average

Maximum of rolling average over time dimension.

min_of_rolling_average

Minimum of rolling average over time dimension.

mean_of_difference

Average of the difference between two variables, or one variable and it's reference period values (e.g. DTR: mean(tasmax - tasmin)).

difference_of_extremes

Difference of extremes between two variables, or one variable and it's reference period values.

mean_of_absolute_one_time_step_difference

Average of the absolute one time step by one time step difference between two variables, or one variable and it's reference period values (e.g. vDTR: mean((tasmax[i] - tasmin[i]) - (tasmax[i-1] - tasmin[i-1]) ; where i is the day of measure).

difference_of_means

Difference of the average between two variables, or one variable and it's reference period values (e.g. anomaly: mean(tasmax) - mean(tasmax_ref])).

percentile

Percentile of a variable.

custom_index

Compute custom indices using simple operators.

icclim._generated._generic.average(in_files: InFileLike, var_name: str | Sequence[str] | None = None, slice_mode: FrequencyLike | Frequency = 'year', time_range: Sequence[dt.datetime | str] | None = None, out_file: str | None = None, threshold: str | Threshold | Sequence[str | Threshold] | None = None, bootstrap: bool | None = None, ignore_Feb29th: bool = False, out_unit: str | None = None, netcdf_version: str | NetcdfVersion = 'NETCDF4', save_thresholds: bool = False, logs_verbosity: Verbosity | str = 'LOW', date_event: bool = False, run_index: str | None = 'first', allow_partial_seasons: bool | Literal['start', 'end'] | None = None, completeness: CompletenessLike = None, allow_missing_periods: bool | None = None, allow_partial_final_period: bool = False) → Dataset[source]#

Average of values that met threshold(s), if threshold(s) are given (e.g. Tx, Tn).

average: Average of values that met threshold(s), if threshold(s) are given (e.g. Tx, Tn).

Parameters:
  • in_files (str | list[str] | Dataset | DataArray | InputDictionary) – Absolute path(s) to NetCDF dataset(s), including OPeNDAP URLs, or path to zarr store, or xarray.Dataset or xarray.DataArray.

  • var_name (str | list[str] | None) – optional Target variable name to process corresponding to in_files. If None (default) on ECA&D index, the variable is guessed based on the climate index wanted. Mandatory for the deprecated user_index bridge.

  • slice_mode (FrequencyLike | Frequency) – Type of temporal aggregation: The possible values are {"year", "month", "DJF", "MAM", "JJA", "SON", "ONDJFM" or "AMJJAS", ("season", [1,2,3]), ("month", [1,2,3,])} (where season and month lists can be customized) or any valid pandas frequency. A season can also be defined between two exact dates: ("season", ("19 july", "14 august")). Spatially varying seasons can be defined by providing a tuple of two xarray.DataArray objects (start day-of-year and end day-of-year): (start_da, end_da). Default is “year”. See slice_mode for details.

  • time_range (list[datetime.datetime ] | list[str] | tuple[str, str] | None) – optional Temporal range: upper and lower bounds for temporal subsetting. If None, whole period of input files will be processed. The dates can either be given as instance of datetime.datetime or as string values. For strings, many format are accepted. Default is None.

  • out_file (str | None) – Output NetCDF file name (default: “icclim_out.nc” in the current directory). Default is “icclim_out.nc”. If the input in_files is a Dataset, out_file field is ignored. Use the function returned value instead to retrieve the computed value. If out_file already exists, icclim will overwrite it!

  • threshold (float | list[float] | None) – optional User defined threshold for certain indices. Default depend on the index, see their individual definition. When a list of threshold is provided, the index will be computed for each thresholds.

  • bootstrap (bool | None) – optional Override bootstrap behavior for day-of-year percentile thresholds. Use None (default) to rely on icclim’s overlap-based bootstrap logic, False to disable bootstrap, or True to force it when supported by the threshold type. For dask-backed percentile count indices, icclim automatically uses bounded spatial tiles so users do not have to find a working dask chunking strategy by trial and error. The safe path derives its spatial tile size from ICCLIM_BOOTSTRAP_SAFE_TILE_MEMORY (default: 2GB), unless ICCLIM_BOOTSTRAP_SAFE_TILE_CELLS is set as an expert override. Set ICCLIM_BOOTSTRAP_MODE=default only for diagnostics to keep the reference bootstrap dask graph path. bootstrap=False should only be used as an explicit user shortcut for fast exploratory assessments, because disabling bootstrap removes the overlap correction and can bias percentile-based results.

  • run_index (str | None) – optional The index to use for the run length encoding (e.g. “first”, “last”, “mid”). Default is “first”. Ignored for non spell indices.

  • ignore_Feb29th (bool) – optional Ignoring or not February 29th (default: False).

  • out_unit (str | None) – optional Output unit for certain indices: “days” or “%” (default: “days”).

  • netcdf_version (str | NetcdfVersion) – optional NetCDF version to create (default: “NETCDF3_CLASSIC”).

  • save_thresholds (bool) – optional True if the thresholds should be saved within the resulting netcdf file (default: False).

  • date_event (bool) – When True the date of the event (such as when a maximum is reached) will be stored in coordinates variables. warning This option may significantly slow down computation.

  • logs_verbosity (str | Verbosity) – optional Configure how verbose icclim is. Possible values: {"LOW", "HIGH", "SILENT"} (default: “LOW”)

  • allow_partial_seasons (bool | "start" | "end") – Flag indicating whether to allow partial seasons to be included in the index calculation. - True: Unmasks both the first and last periods. - False: Masks any incomplete periods (standard behavior). - “start”: Unmasks only the first period. - “end”: Unmasks only the last period. Default is False.

  • completeness ({"ecad", "wmo", "strict", "none"} | float | None) – Completeness rule used to decide whether an output period has enough source observations to be calculated. None selects the ECA&D ATBD profile automatically: at least 350 daily values for a year, 175 for a half-year, 85 for a three-month season, and 25 for a month. strict requires every expected value. wmo applies the aggregation-specific WMO-No. 1203 rules: the 11-day/5-consecutive-day monthly rule for means and counts, complete data for sums, and no completeness mask for simple extrema. Unclassified operations, unsupported period types, non-daily WMO inputs, and spatially varying seasons safely fall back to strict. none always computes from available values, and a fraction in (0, 1] sets a configurable minimum valid fraction. Do not combine this parameter with the legacy allow_missing_periods parameter.

  • allow_missing_periods (bool | None) – Compatibility parameter for 7.2 workflows. An explicit False selects strict completeness, while True computes from available source values. None delegates to completeness and therefore uses ECA&D by default. When neither parameter is explicit, icclim warns if an irregular source time coordinate is detected or an already-eager mask shows an incomplete period. Lazy inputs are not evaluated solely to emit a warning.

  • allow_partial_final_period (bool) – When True, incomplete historical output periods are still masked, but the final output period is allowed to be computed from available source timesteps. This is useful for an ongoing month or year at the end of a time series. Ignored when allow_missing_periods=True.

Notes

This function has been auto-generated.

icclim._generated._generic.count_occurrences(in_files: InFileLike, var_name: str | Sequence[str] | None = None, slice_mode: FrequencyLike | Frequency = 'year', time_range: Sequence[dt.datetime | str] | None = None, out_file: str | None = None, threshold: str | Threshold | Sequence[str | Threshold] | None = None, bootstrap: bool | None = None, ignore_Feb29th: bool = False, out_unit: str | None = None, netcdf_version: str | NetcdfVersion = 'NETCDF4', save_thresholds: bool = False, logs_verbosity: Verbosity | str = 'LOW', date_event: bool = False, run_index: str | None = 'first', allow_partial_seasons: bool | Literal['start', 'end'] | None = None, completeness: CompletenessLike = None, allow_missing_periods: bool | None = None, allow_partial_final_period: bool = False) → Dataset[source]#

Count occurrences when threshold(s) are met (e.g. SU, Tx90p, RR1).

count_occurrences: Count occurrences when threshold(s) are met (e.g. SU, Tx90p, RR1).

Parameters:
  • in_files (str | list[str] | Dataset | DataArray | InputDictionary) – Absolute path(s) to NetCDF dataset(s), including OPeNDAP URLs, or path to zarr store, or xarray.Dataset or xarray.DataArray.

  • var_name (str | list[str] | None) – optional Target variable name to process corresponding to in_files. If None (default) on ECA&D index, the variable is guessed based on the climate index wanted. Mandatory for the deprecated user_index bridge.

  • slice_mode (FrequencyLike | Frequency) – Type of temporal aggregation: The possible values are {"year", "month", "DJF", "MAM", "JJA", "SON", "ONDJFM" or "AMJJAS", ("season", [1,2,3]), ("month", [1,2,3,])} (where season and month lists can be customized) or any valid pandas frequency. A season can also be defined between two exact dates: ("season", ("19 july", "14 august")). Spatially varying seasons can be defined by providing a tuple of two xarray.DataArray objects (start day-of-year and end day-of-year): (start_da, end_da). Default is “year”. See slice_mode for details.

  • time_range (list[datetime.datetime ] | list[str] | tuple[str, str] | None) – optional Temporal range: upper and lower bounds for temporal subsetting. If None, whole period of input files will be processed. The dates can either be given as instance of datetime.datetime or as string values. For strings, many format are accepted. Default is None.

  • out_file (str | None) – Output NetCDF file name (default: “icclim_out.nc” in the current directory). Default is “icclim_out.nc”. If the input in_files is a Dataset, out_file field is ignored. Use the function returned value instead to retrieve the computed value. If out_file already exists, icclim will overwrite it!

  • threshold (float | list[float] | None) – optional User defined threshold for certain indices. Default depend on the index, see their individual definition. When a list of threshold is provided, the index will be computed for each thresholds.

  • bootstrap (bool | None) – optional Override bootstrap behavior for day-of-year percentile thresholds. Use None (default) to rely on icclim’s overlap-based bootstrap logic, False to disable bootstrap, or True to force it when supported by the threshold type. For dask-backed percentile count indices, icclim automatically uses bounded spatial tiles so users do not have to find a working dask chunking strategy by trial and error. The safe path derives its spatial tile size from ICCLIM_BOOTSTRAP_SAFE_TILE_MEMORY (default: 2GB), unless ICCLIM_BOOTSTRAP_SAFE_TILE_CELLS is set as an expert override. Set ICCLIM_BOOTSTRAP_MODE=default only for diagnostics to keep the reference bootstrap dask graph path. bootstrap=False should only be used as an explicit user shortcut for fast exploratory assessments, because disabling bootstrap removes the overlap correction and can bias percentile-based results.

  • run_index (str | None) – optional The index to use for the run length encoding (e.g. “first”, “last”, “mid”). Default is “first”. Ignored for non spell indices.

  • ignore_Feb29th (bool) – optional Ignoring or not February 29th (default: False).

  • out_unit (str | None) – optional Output unit for certain indices: “days” or “%” (default: “days”).

  • netcdf_version (str | NetcdfVersion) – optional NetCDF version to create (default: “NETCDF3_CLASSIC”).

  • save_thresholds (bool) – optional True if the thresholds should be saved within the resulting netcdf file (default: False).

  • date_event (bool) – When True the date of the event (such as when a maximum is reached) will be stored in coordinates variables. warning This option may significantly slow down computation.

  • logs_verbosity (str | Verbosity) – optional Configure how verbose icclim is. Possible values: {"LOW", "HIGH", "SILENT"} (default: “LOW”)

  • allow_partial_seasons (bool | "start" | "end") – Flag indicating whether to allow partial seasons to be included in the index calculation. - True: Unmasks both the first and last periods. - False: Masks any incomplete periods (standard behavior). - “start”: Unmasks only the first period. - “end”: Unmasks only the last period. Default is False.

  • completeness ({"ecad", "wmo", "strict", "none"} | float | None) – Completeness rule used to decide whether an output period has enough source observations to be calculated. None selects the ECA&D ATBD profile automatically: at least 350 daily values for a year, 175 for a half-year, 85 for a three-month season, and 25 for a month. strict requires every expected value. wmo applies the aggregation-specific WMO-No. 1203 rules: the 11-day/5-consecutive-day monthly rule for means and counts, complete data for sums, and no completeness mask for simple extrema. Unclassified operations, unsupported period types, non-daily WMO inputs, and spatially varying seasons safely fall back to strict. none always computes from available values, and a fraction in (0, 1] sets a configurable minimum valid fraction. Do not combine this parameter with the legacy allow_missing_periods parameter.

  • allow_missing_periods (bool | None) – Compatibility parameter for 7.2 workflows. An explicit False selects strict completeness, while True computes from available source values. None delegates to completeness and therefore uses ECA&D by default. When neither parameter is explicit, icclim warns if an irregular source time coordinate is detected or an already-eager mask shows an incomplete period. Lazy inputs are not evaluated solely to emit a warning.

  • allow_partial_final_period (bool) – When True, incomplete historical output periods are still masked, but the final output period is allowed to be computed from available source timesteps. This is useful for an ongoing month or year at the end of a time series. Ignored when allow_missing_periods=True.

Notes

This function has been auto-generated.

icclim._generated._generic.custom_index(user_index: UserIndexDict, in_files: InFileLike, var_name: str | Sequence[str] | None = None, slice_mode: FrequencyLike | Frequency = 'year', time_range: Sequence[dt.datetime | str] | None = None, out_file: str | None = None, base_period_time_range: Sequence[dt.datetime] | Sequence[str] | None = None, bootstrap: bool | None = None, doy_window_width: int = 5, only_leap_years: bool = False, ignore_Feb29th: bool = False, interpolation: str | QuantileInterpolation = 'median_unbiased', out_unit: str | None = None, netcdf_version: str | NetcdfVersion = 'NETCDF4', save_thresholds: bool = False, logs_verbosity: Verbosity | str = 'LOW', date_event: bool = False, min_spell_length: int | None = 6, rolling_window_width: int | None = 5, sampling_method: SamplingMethodLike = 'resample', run_index: str | None = 'first', allow_partial_seasons: bool | Literal['start', 'end'] | None = None, completeness: CompletenessLike = None, allow_missing_periods: bool | None = None, allow_partial_final_period: bool = False) → Dataset[source]#

Compute custom indices using simple operators.

Use the user_index parameter to describe how the index should be computed. You can find some examples in icclim documentation at Create your own index with user_index

Parameters:
  • in_files (str | list[str] | Dataset | DataArray | InputDictionary) – Absolute path(s) to NetCDF dataset(s), including OPeNDAP URLs, or path to zarr store, or xarray.Dataset or xarray.DataArray.

  • var_name (str | list[str] | None) – optional Target variable name to process corresponding to in_files. If None (default) on ECA&D index, the variable is guessed based on the climate index wanted. Mandatory for the deprecated user_index bridge.

  • slice_mode (FrequencyLike | Frequency) – Type of temporal aggregation: The possible values are {"year", "month", "DJF", "MAM", "JJA", "SON", "ONDJFM" or "AMJJAS", ("season", [1,2,3]), ("month", [1,2,3,])} (where season and month lists can be customized) or any valid pandas frequency. A season can also be defined between two exact dates: ("season", ("19 july", "14 august")). Spatially varying seasons can be defined by providing a tuple of two xarray.DataArray objects (start day-of-year and end day-of-year): (start_da, end_da). Default is “year”. See slice_mode for details.

  • time_range (list[datetime.datetime ] | list[str] | tuple[str, str] | None) – optional Temporal range: upper and lower bounds for temporal subsetting. If None, whole period of input files will be processed. The dates can either be given as instance of datetime.datetime or as string values. For strings, many format are accepted. Default is None.

  • out_file (str | None) – Output NetCDF file name (default: “icclim_out.nc” in the current directory). Default is “icclim_out.nc”. If the input in_files is a Dataset, out_file field is ignored. Use the function returned value instead to retrieve the computed value. If out_file already exists, icclim will overwrite it!

  • base_period_time_range (list[datetime.datetime ] | list[str] | tuple[str, str] | None) – optional Temporal range of the reference period. The dates can either be given as instance of datetime.datetime or as string values. It is used either: #. to compute percentiles if threshold is filled. When missing, the studied period is used to compute percentiles. The study period is either the dataset filtered by time_range or the whole dataset if time_range is missing. For day of year percentiles (doy_per), on extreme percentiles the overlapping period between base_period_time_range and the study period is bootstrapped. #. to compute a reference period for indices such as difference_of_mean (that is, an anomaly) if a single variable is given in input.

  • bootstrap (bool | None) – optional Override bootstrap behavior for day-of-year percentile thresholds. Use None (default) to rely on icclim’s overlap-based bootstrap logic, False to disable bootstrap, or True to force it when supported by the threshold type. For dask-backed percentile count indices, icclim automatically uses bounded spatial tiles so users do not have to find a working dask chunking strategy by trial and error. The safe path derives its spatial tile size from ICCLIM_BOOTSTRAP_SAFE_TILE_MEMORY (default: 2GB), unless ICCLIM_BOOTSTRAP_SAFE_TILE_CELLS is set as an expert override. Set ICCLIM_BOOTSTRAP_MODE=default only for diagnostics to keep the reference bootstrap dask graph path. bootstrap=False should only be used as an explicit user shortcut for fast exploratory assessments, because disabling bootstrap removes the overlap correction and can bias percentile-based results.

  • doy_window_width (int) – optional Window width used to aggregate day-of-year values when computing day of year percentiles (doy_per) Default: 5 (5 days).

  • min_spell_length (int) – optional Minimum spell duration to be taken into account when computing the sum_of_spell_lengths.

  • rolling_window_width (int) – optional Window width of the rolling window for indicators such as {max_of_rolling_sum, max_of_rolling_average, min_of_rolling_sum, min_of_rolling_average}

  • run_index (str | None) – optional The index to use for the run length encoding (e.g. “first”, “last”, “mid”). Default is “first”. Ignored for non spell indices.

  • only_leap_years (bool) – optional Option for February 29th (default: False).

  • ignore_Feb29th (bool) – optional Ignoring or not February 29th (default: False).

  • interpolation (str | QuantileInterpolation | None) – optional Interpolation method to compute percentile values: {"linear", "median_unbiased"} Default is “median_unbiased”, a.k.a type 8 or method 8. Ignored for non-percentile-based indices.

  • out_unit (str | None) – optional Output unit for certain indices: “days” or “%” (default: “days”).

  • netcdf_version (str | NetcdfVersion) – optional NetCDF version to create (default: “NETCDF3_CLASSIC”).

  • save_thresholds (bool) – optional True if the thresholds should be saved within the resulting netcdf file (default: False).

  • date_event (bool) – When True the date of the event (such as when a maximum is reached) will be stored in coordinates variables. warning This option may significantly slow down computation.

  • logs_verbosity (str | Verbosity) – optional Configure how verbose icclim is. Possible values: {"LOW", "HIGH", "SILENT"} (default: “LOW”)

  • sampling_method (str) – Choose whether the output sampling configured in slice_mode is a groupby operation or a resample operation (as per xarray definitions). Possible values: {"groupby", "resample", "groupby_ref_and_resample_study"} (default: “resample”) groupby_ref_and_resample_study may only be used when computing the difference_of_means (a.k.a the anomaly).

  • allow_partial_seasons (bool | "start" | "end") – Flag indicating whether to allow partial seasons to be included in the index calculation. - True: Unmasks both the first and last periods. - False: Masks any incomplete periods (standard behavior). - “start”: Unmasks only the first period. - “end”: Unmasks only the last period. Default is False.

  • completeness ({"ecad", "wmo", "strict", "none"} | float | None) – Completeness rule used to decide whether an output period has enough source observations to be calculated. None selects the ECA&D ATBD profile automatically: at least 350 daily values for a year, 175 for a half-year, 85 for a three-month season, and 25 for a month. strict requires every expected value. wmo applies the aggregation-specific WMO-No. 1203 rules: the 11-day/5-consecutive-day monthly rule for means and counts, complete data for sums, and no completeness mask for simple extrema. Unclassified operations, unsupported period types, non-daily WMO inputs, and spatially varying seasons safely fall back to strict. none always computes from available values, and a fraction in (0, 1] sets a configurable minimum valid fraction. Do not combine this parameter with the legacy allow_missing_periods parameter.

  • allow_missing_periods (bool | None) – Compatibility parameter for 7.2 workflows. An explicit False selects strict completeness, while True computes from available source values. None delegates to completeness and therefore uses ECA&D by default. When neither parameter is explicit, icclim warns if an irregular source time coordinate is detected or an already-eager mask shows an incomplete period. Lazy inputs are not evaluated solely to emit a warning.

  • allow_partial_final_period (bool) – When True, incomplete historical output periods are still masked, but the final output period is allowed to be computed from available source timesteps. This is useful for an ongoing month or year at the end of a time series. Ignored when allow_missing_periods=True.

Notes

This function has been auto-generated.

icclim._generated._generic.deficit(in_files: InFileLike, var_name: str | Sequence[str] | None = None, slice_mode: FrequencyLike | Frequency = 'year', time_range: Sequence[dt.datetime | str] | None = None, out_file: str | None = None, threshold: str | Threshold | Sequence[str | Threshold] | None = None, bootstrap: bool | None = None, ignore_Feb29th: bool = False, out_unit: str | None = None, netcdf_version: str | NetcdfVersion = 'NETCDF4', save_thresholds: bool = False, logs_verbosity: Verbosity | str = 'LOW', date_event: bool = False, run_index: str | None = 'first', allow_partial_seasons: bool | Literal['start', 'end'] | None = None, completeness: CompletenessLike = None, allow_missing_periods: bool | None = None, allow_partial_final_period: bool = False) → Dataset[source]#

Compute the deficit below the given threshold. The deficit is sum(t - x[x<t]) where x is the studied variable and t the threshold (e.g. HD17).

deficit: Compute the deficit below the given threshold. The deficit is sum(t - x[x<t]) where x is the studied variable and t the threshold (e.g. HD17).

Parameters:
  • in_files (str | list[str] | Dataset | DataArray | InputDictionary) – Absolute path(s) to NetCDF dataset(s), including OPeNDAP URLs, or path to zarr store, or xarray.Dataset or xarray.DataArray.

  • var_name (str | list[str] | None) – optional Target variable name to process corresponding to in_files. If None (default) on ECA&D index, the variable is guessed based on the climate index wanted. Mandatory for the deprecated user_index bridge.

  • slice_mode (FrequencyLike | Frequency) – Type of temporal aggregation: The possible values are {"year", "month", "DJF", "MAM", "JJA", "SON", "ONDJFM" or "AMJJAS", ("season", [1,2,3]), ("month", [1,2,3,])} (where season and month lists can be customized) or any valid pandas frequency. A season can also be defined between two exact dates: ("season", ("19 july", "14 august")). Spatially varying seasons can be defined by providing a tuple of two xarray.DataArray objects (start day-of-year and end day-of-year): (start_da, end_da). Default is “year”. See slice_mode for details.

  • time_range (list[datetime.datetime ] | list[str] | tuple[str, str] | None) – optional Temporal range: upper and lower bounds for temporal subsetting. If None, whole period of input files will be processed. The dates can either be given as instance of datetime.datetime or as string values. For strings, many format are accepted. Default is None.

  • out_file (str | None) – Output NetCDF file name (default: “icclim_out.nc” in the current directory). Default is “icclim_out.nc”. If the input in_files is a Dataset, out_file field is ignored. Use the function returned value instead to retrieve the computed value. If out_file already exists, icclim will overwrite it!

  • threshold (float | list[float] | None) – optional User defined threshold for certain indices. Default depend on the index, see their individual definition. When a list of threshold is provided, the index will be computed for each thresholds.

  • bootstrap (bool | None) – optional Override bootstrap behavior for day-of-year percentile thresholds. Use None (default) to rely on icclim’s overlap-based bootstrap logic, False to disable bootstrap, or True to force it when supported by the threshold type. For dask-backed percentile count indices, icclim automatically uses bounded spatial tiles so users do not have to find a working dask chunking strategy by trial and error. The safe path derives its spatial tile size from ICCLIM_BOOTSTRAP_SAFE_TILE_MEMORY (default: 2GB), unless ICCLIM_BOOTSTRAP_SAFE_TILE_CELLS is set as an expert override. Set ICCLIM_BOOTSTRAP_MODE=default only for diagnostics to keep the reference bootstrap dask graph path. bootstrap=False should only be used as an explicit user shortcut for fast exploratory assessments, because disabling bootstrap removes the overlap correction and can bias percentile-based results.

  • run_index (str | None) – optional The index to use for the run length encoding (e.g. “first”, “last”, “mid”). Default is “first”. Ignored for non spell indices.

  • ignore_Feb29th (bool) – optional Ignoring or not February 29th (default: False).

  • out_unit (str | None) – optional Output unit for certain indices: “days” or “%” (default: “days”).

  • netcdf_version (str | NetcdfVersion) – optional NetCDF version to create (default: “NETCDF3_CLASSIC”).

  • save_thresholds (bool) – optional True if the thresholds should be saved within the resulting netcdf file (default: False).

  • date_event (bool) – When True the date of the event (such as when a maximum is reached) will be stored in coordinates variables. warning This option may significantly slow down computation.

  • logs_verbosity (str | Verbosity) – optional Configure how verbose icclim is. Possible values: {"LOW", "HIGH", "SILENT"} (default: “LOW”)

  • allow_partial_seasons (bool | "start" | "end") – Flag indicating whether to allow partial seasons to be included in the index calculation. - True: Unmasks both the first and last periods. - False: Masks any incomplete periods (standard behavior). - “start”: Unmasks only the first period. - “end”: Unmasks only the last period. Default is False.

  • completeness ({"ecad", "wmo", "strict", "none"} | float | None) – Completeness rule used to decide whether an output period has enough source observations to be calculated. None selects the ECA&D ATBD profile automatically: at least 350 daily values for a year, 175 for a half-year, 85 for a three-month season, and 25 for a month. strict requires every expected value. wmo applies the aggregation-specific WMO-No. 1203 rules: the 11-day/5-consecutive-day monthly rule for means and counts, complete data for sums, and no completeness mask for simple extrema. Unclassified operations, unsupported period types, non-daily WMO inputs, and spatially varying seasons safely fall back to strict. none always computes from available values, and a fraction in (0, 1] sets a configurable minimum valid fraction. Do not combine this parameter with the legacy allow_missing_periods parameter.

  • allow_missing_periods (bool | None) – Compatibility parameter for 7.2 workflows. An explicit False selects strict completeness, while True computes from available source values. None delegates to completeness and therefore uses ECA&D by default. When neither parameter is explicit, icclim warns if an irregular source time coordinate is detected or an already-eager mask shows an incomplete period. Lazy inputs are not evaluated solely to emit a warning.

  • allow_partial_final_period (bool) – When True, incomplete historical output periods are still masked, but the final output period is allowed to be computed from available source timesteps. This is useful for an ongoing month or year at the end of a time series. Ignored when allow_missing_periods=True.

Notes

This function has been auto-generated.

icclim._generated._generic.difference_of_extremes(in_files: InFileLike, var_name: str | Sequence[str] | None = None, slice_mode: FrequencyLike | Frequency = 'year', time_range: Sequence[dt.datetime | str] | None = None, out_file: str | None = None, threshold: str | Threshold | Sequence[str | Threshold] | None = None, bootstrap: bool | None = None, ignore_Feb29th: bool = False, out_unit: str | None = None, netcdf_version: str | NetcdfVersion = 'NETCDF4', save_thresholds: bool = False, logs_verbosity: Verbosity | str = 'LOW', date_event: bool = False, run_index: str | None = 'first', allow_partial_seasons: bool | Literal['start', 'end'] | None = None, completeness: CompletenessLike = None, allow_missing_periods: bool | None = None, allow_partial_final_period: bool = False) → Dataset[source]#

Difference of extremes between two variables, or one variable and it’s reference period values. The extremes are always maximum for the first variable and minimum for the second variable (e.g. ETR: max(tasmax) - min(tasmin)).

difference_of_extremes: Difference of extremes between two variables, or one variable and it’s reference period values. The extremes are always maximum for the first variable and minimum for the second variable (e.g. ETR: max(tasmax) - min(tasmin)).

Parameters:
  • in_files (str | list[str] | Dataset | DataArray | InputDictionary) – Absolute path(s) to NetCDF dataset(s), including OPeNDAP URLs, or path to zarr store, or xarray.Dataset or xarray.DataArray.

  • var_name (str | list[str] | None) – optional Target variable name to process corresponding to in_files. If None (default) on ECA&D index, the variable is guessed based on the climate index wanted. Mandatory for the deprecated user_index bridge.

  • slice_mode (FrequencyLike | Frequency) – Type of temporal aggregation: The possible values are {"year", "month", "DJF", "MAM", "JJA", "SON", "ONDJFM" or "AMJJAS", ("season", [1,2,3]), ("month", [1,2,3,])} (where season and month lists can be customized) or any valid pandas frequency. A season can also be defined between two exact dates: ("season", ("19 july", "14 august")). Spatially varying seasons can be defined by providing a tuple of two xarray.DataArray objects (start day-of-year and end day-of-year): (start_da, end_da). Default is “year”. See slice_mode for details.

  • time_range (list[datetime.datetime ] | list[str] | tuple[str, str] | None) – optional Temporal range: upper and lower bounds for temporal subsetting. If None, whole period of input files will be processed. The dates can either be given as instance of datetime.datetime or as string values. For strings, many format are accepted. Default is None.

  • out_file (str | None) – Output NetCDF file name (default: “icclim_out.nc” in the current directory). Default is “icclim_out.nc”. If the input in_files is a Dataset, out_file field is ignored. Use the function returned value instead to retrieve the computed value. If out_file already exists, icclim will overwrite it!

  • threshold (float | list[float] | None) – optional User defined threshold for certain indices. Default depend on the index, see their individual definition. When a list of threshold is provided, the index will be computed for each thresholds.

  • bootstrap (bool | None) – optional Override bootstrap behavior for day-of-year percentile thresholds. Use None (default) to rely on icclim’s overlap-based bootstrap logic, False to disable bootstrap, or True to force it when supported by the threshold type. For dask-backed percentile count indices, icclim automatically uses bounded spatial tiles so users do not have to find a working dask chunking strategy by trial and error. The safe path derives its spatial tile size from ICCLIM_BOOTSTRAP_SAFE_TILE_MEMORY (default: 2GB), unless ICCLIM_BOOTSTRAP_SAFE_TILE_CELLS is set as an expert override. Set ICCLIM_BOOTSTRAP_MODE=default only for diagnostics to keep the reference bootstrap dask graph path. bootstrap=False should only be used as an explicit user shortcut for fast exploratory assessments, because disabling bootstrap removes the overlap correction and can bias percentile-based results.

  • run_index (str | None) – optional The index to use for the run length encoding (e.g. “first”, “last”, “mid”). Default is “first”. Ignored for non spell indices.

  • ignore_Feb29th (bool) – optional Ignoring or not February 29th (default: False).

  • out_unit (str | None) – optional Output unit for certain indices: “days” or “%” (default: “days”).

  • netcdf_version (str | NetcdfVersion) – optional NetCDF version to create (default: “NETCDF3_CLASSIC”).

  • save_thresholds (bool) – optional True if the thresholds should be saved within the resulting netcdf file (default: False).

  • date_event (bool) – When True the date of the event (such as when a maximum is reached) will be stored in coordinates variables. warning This option may significantly slow down computation.

  • logs_verbosity (str | Verbosity) – optional Configure how verbose icclim is. Possible values: {"LOW", "HIGH", "SILENT"} (default: “LOW”)

  • allow_partial_seasons (bool | "start" | "end") – Flag indicating whether to allow partial seasons to be included in the index calculation. - True: Unmasks both the first and last periods. - False: Masks any incomplete periods (standard behavior). - “start”: Unmasks only the first period. - “end”: Unmasks only the last period. Default is False.

  • completeness ({"ecad", "wmo", "strict", "none"} | float | None) – Completeness rule used to decide whether an output period has enough source observations to be calculated. None selects the ECA&D ATBD profile automatically: at least 350 daily values for a year, 175 for a half-year, 85 for a three-month season, and 25 for a month. strict requires every expected value. wmo applies the aggregation-specific WMO-No. 1203 rules: the 11-day/5-consecutive-day monthly rule for means and counts, complete data for sums, and no completeness mask for simple extrema. Unclassified operations, unsupported period types, non-daily WMO inputs, and spatially varying seasons safely fall back to strict. none always computes from available values, and a fraction in (0, 1] sets a configurable minimum valid fraction. Do not combine this parameter with the legacy allow_missing_periods parameter.

  • allow_missing_periods (bool | None) – Compatibility parameter for 7.2 workflows. An explicit False selects strict completeness, while True computes from available source values. None delegates to completeness and therefore uses ECA&D by default. When neither parameter is explicit, icclim warns if an irregular source time coordinate is detected or an already-eager mask shows an incomplete period. Lazy inputs are not evaluated solely to emit a warning.

  • allow_partial_final_period (bool) – When True, incomplete historical output periods are still masked, but the final output period is allowed to be computed from available source timesteps. This is useful for an ongoing month or year at the end of a time series. Ignored when allow_missing_periods=True.

Notes

This function has been auto-generated.

icclim._generated._generic.difference_of_means(in_files: InFileLike, var_name: str | Sequence[str] | None = None, slice_mode: FrequencyLike | Frequency = 'year', time_range: Sequence[dt.datetime | str] | None = None, out_file: str | None = None, threshold: str | Threshold | Sequence[str | Threshold] | None = None, bootstrap: bool | None = None, ignore_Feb29th: bool = False, out_unit: str | None = None, netcdf_version: str | NetcdfVersion = 'NETCDF4', save_thresholds: bool = False, logs_verbosity: Verbosity | str = 'LOW', date_event: bool = False, sampling_method: SamplingMethodLike = 'resample', run_index: str | None = 'first', allow_partial_seasons: bool | Literal['start', 'end'] | None = None, completeness: CompletenessLike = None, allow_missing_periods: bool | None = None, allow_partial_final_period: bool = False) → Dataset[source]#

Difference of the average between two variables, or one variable and it’s reference period values (e.g. anomaly: mean(tasmax) - mean(tasmax_ref])).

difference_of_means: Difference of the average between two variables, or one variable and it’s reference period values (e.g. anomaly: mean(tasmax) - mean(tasmax_ref])).

Parameters:
  • in_files (str | list[str] | Dataset | DataArray | InputDictionary) – Absolute path(s) to NetCDF dataset(s), including OPeNDAP URLs, or path to zarr store, or xarray.Dataset or xarray.DataArray.

  • var_name (str | list[str] | None) – optional Target variable name to process corresponding to in_files. If None (default) on ECA&D index, the variable is guessed based on the climate index wanted. Mandatory for the deprecated user_index bridge.

  • slice_mode (FrequencyLike | Frequency) – Type of temporal aggregation: The possible values are {"year", "month", "DJF", "MAM", "JJA", "SON", "ONDJFM" or "AMJJAS", ("season", [1,2,3]), ("month", [1,2,3,])} (where season and month lists can be customized) or any valid pandas frequency. A season can also be defined between two exact dates: ("season", ("19 july", "14 august")). Spatially varying seasons can be defined by providing a tuple of two xarray.DataArray objects (start day-of-year and end day-of-year): (start_da, end_da). Default is “year”. See slice_mode for details.

  • time_range (list[datetime.datetime ] | list[str] | tuple[str, str] | None) – optional Temporal range: upper and lower bounds for temporal subsetting. If None, whole period of input files will be processed. The dates can either be given as instance of datetime.datetime or as string values. For strings, many format are accepted. Default is None.

  • out_file (str | None) – Output NetCDF file name (default: “icclim_out.nc” in the current directory). Default is “icclim_out.nc”. If the input in_files is a Dataset, out_file field is ignored. Use the function returned value instead to retrieve the computed value. If out_file already exists, icclim will overwrite it!

  • threshold (float | list[float] | None) – optional User defined threshold for certain indices. Default depend on the index, see their individual definition. When a list of threshold is provided, the index will be computed for each thresholds.

  • bootstrap (bool | None) – optional Override bootstrap behavior for day-of-year percentile thresholds. Use None (default) to rely on icclim’s overlap-based bootstrap logic, False to disable bootstrap, or True to force it when supported by the threshold type. For dask-backed percentile count indices, icclim automatically uses bounded spatial tiles so users do not have to find a working dask chunking strategy by trial and error. The safe path derives its spatial tile size from ICCLIM_BOOTSTRAP_SAFE_TILE_MEMORY (default: 2GB), unless ICCLIM_BOOTSTRAP_SAFE_TILE_CELLS is set as an expert override. Set ICCLIM_BOOTSTRAP_MODE=default only for diagnostics to keep the reference bootstrap dask graph path. bootstrap=False should only be used as an explicit user shortcut for fast exploratory assessments, because disabling bootstrap removes the overlap correction and can bias percentile-based results.

  • run_index (str | None) – optional The index to use for the run length encoding (e.g. “first”, “last”, “mid”). Default is “first”. Ignored for non spell indices.

  • ignore_Feb29th (bool) – optional Ignoring or not February 29th (default: False).

  • out_unit (str | None) – optional Output unit for certain indices: “days” or “%” (default: “days”).

  • netcdf_version (str | NetcdfVersion) – optional NetCDF version to create (default: “NETCDF3_CLASSIC”).

  • save_thresholds (bool) – optional True if the thresholds should be saved within the resulting netcdf file (default: False).

  • date_event (bool) – When True the date of the event (such as when a maximum is reached) will be stored in coordinates variables. warning This option may significantly slow down computation.

  • logs_verbosity (str | Verbosity) – optional Configure how verbose icclim is. Possible values: {"LOW", "HIGH", "SILENT"} (default: “LOW”)

  • sampling_method (str) – Choose whether the output sampling configured in slice_mode is a groupby operation or a resample operation (as per xarray definitions). Possible values: {"groupby", "resample", "groupby_ref_and_resample_study"} (default: “resample”) groupby_ref_and_resample_study may only be used when computing the difference_of_means (a.k.a the anomaly).

  • allow_partial_seasons (bool | "start" | "end") – Flag indicating whether to allow partial seasons to be included in the index calculation. - True: Unmasks both the first and last periods. - False: Masks any incomplete periods (standard behavior). - “start”: Unmasks only the first period. - “end”: Unmasks only the last period. Default is False.

  • completeness ({"ecad", "wmo", "strict", "none"} | float | None) – Completeness rule used to decide whether an output period has enough source observations to be calculated. None selects the ECA&D ATBD profile automatically: at least 350 daily values for a year, 175 for a half-year, 85 for a three-month season, and 25 for a month. strict requires every expected value. wmo applies the aggregation-specific WMO-No. 1203 rules: the 11-day/5-consecutive-day monthly rule for means and counts, complete data for sums, and no completeness mask for simple extrema. Unclassified operations, unsupported period types, non-daily WMO inputs, and spatially varying seasons safely fall back to strict. none always computes from available values, and a fraction in (0, 1] sets a configurable minimum valid fraction. Do not combine this parameter with the legacy allow_missing_periods parameter.

  • allow_missing_periods (bool | None) – Compatibility parameter for 7.2 workflows. An explicit False selects strict completeness, while True computes from available source values. None delegates to completeness and therefore uses ECA&D by default. When neither parameter is explicit, icclim warns if an irregular source time coordinate is detected or an already-eager mask shows an incomplete period. Lazy inputs are not evaluated solely to emit a warning.

  • allow_partial_final_period (bool) – When True, incomplete historical output periods are still masked, but the final output period is allowed to be computed from available source timesteps. This is useful for an ongoing month or year at the end of a time series. Ignored when allow_missing_periods=True.

Notes

This function has been auto-generated.

icclim._generated._generic.excess(in_files: InFileLike, var_name: str | Sequence[str] | None = None, slice_mode: FrequencyLike | Frequency = 'year', time_range: Sequence[dt.datetime | str] | None = None, out_file: str | None = None, threshold: str | Threshold | Sequence[str | Threshold] | None = None, bootstrap: bool | None = None, ignore_Feb29th: bool = False, out_unit: str | None = None, netcdf_version: str | NetcdfVersion = 'NETCDF4', save_thresholds: bool = False, logs_verbosity: Verbosity | str = 'LOW', date_event: bool = False, run_index: str | None = 'first', allow_partial_seasons: bool | Literal['start', 'end'] | None = None, completeness: CompletenessLike = None, allow_missing_periods: bool | None = None, allow_partial_final_period: bool = False) → Dataset[source]#

Compute the excess over the given threshold. The excess is sum(x[x>t] - t) where x is the studied variable and t the threshold (e.g. GD4).

excess: Compute the excess over the given threshold. The excess is sum(x[x>t] - t) where x is the studied variable and t the threshold (e.g. GD4).

Parameters:
  • in_files (str | list[str] | Dataset | DataArray | InputDictionary) – Absolute path(s) to NetCDF dataset(s), including OPeNDAP URLs, or path to zarr store, or xarray.Dataset or xarray.DataArray.

  • var_name (str | list[str] | None) – optional Target variable name to process corresponding to in_files. If None (default) on ECA&D index, the variable is guessed based on the climate index wanted. Mandatory for the deprecated user_index bridge.

  • slice_mode (FrequencyLike | Frequency) – Type of temporal aggregation: The possible values are {"year", "month", "DJF", "MAM", "JJA", "SON", "ONDJFM" or "AMJJAS", ("season", [1,2,3]), ("month", [1,2,3,])} (where season and month lists can be customized) or any valid pandas frequency. A season can also be defined between two exact dates: ("season", ("19 july", "14 august")). Spatially varying seasons can be defined by providing a tuple of two xarray.DataArray objects (start day-of-year and end day-of-year): (start_da, end_da). Default is “year”. See slice_mode for details.

  • time_range (list[datetime.datetime ] | list[str] | tuple[str, str] | None) – optional Temporal range: upper and lower bounds for temporal subsetting. If None, whole period of input files will be processed. The dates can either be given as instance of datetime.datetime or as string values. For strings, many format are accepted. Default is None.

  • out_file (str | None) – Output NetCDF file name (default: “icclim_out.nc” in the current directory). Default is “icclim_out.nc”. If the input in_files is a Dataset, out_file field is ignored. Use the function returned value instead to retrieve the computed value. If out_file already exists, icclim will overwrite it!

  • threshold (float | list[float] | None) – optional User defined threshold for certain indices. Default depend on the index, see their individual definition. When a list of threshold is provided, the index will be computed for each thresholds.

  • bootstrap (bool | None) – optional Override bootstrap behavior for day-of-year percentile thresholds. Use None (default) to rely on icclim’s overlap-based bootstrap logic, False to disable bootstrap, or True to force it when supported by the threshold type. For dask-backed percentile count indices, icclim automatically uses bounded spatial tiles so users do not have to find a working dask chunking strategy by trial and error. The safe path derives its spatial tile size from ICCLIM_BOOTSTRAP_SAFE_TILE_MEMORY (default: 2GB), unless ICCLIM_BOOTSTRAP_SAFE_TILE_CELLS is set as an expert override. Set ICCLIM_BOOTSTRAP_MODE=default only for diagnostics to keep the reference bootstrap dask graph path. bootstrap=False should only be used as an explicit user shortcut for fast exploratory assessments, because disabling bootstrap removes the overlap correction and can bias percentile-based results.

  • run_index (str | None) – optional The index to use for the run length encoding (e.g. “first”, “last”, “mid”). Default is “first”. Ignored for non spell indices.

  • ignore_Feb29th (bool) – optional Ignoring or not February 29th (default: False).

  • out_unit (str | None) – optional Output unit for certain indices: “days” or “%” (default: “days”).

  • netcdf_version (str | NetcdfVersion) – optional NetCDF version to create (default: “NETCDF3_CLASSIC”).

  • save_thresholds (bool) – optional True if the thresholds should be saved within the resulting netcdf file (default: False).

  • date_event (bool) – When True the date of the event (such as when a maximum is reached) will be stored in coordinates variables. warning This option may significantly slow down computation.

  • logs_verbosity (str | Verbosity) – optional Configure how verbose icclim is. Possible values: {"LOW", "HIGH", "SILENT"} (default: “LOW”)

  • allow_partial_seasons (bool | "start" | "end") – Flag indicating whether to allow partial seasons to be included in the index calculation. - True: Unmasks both the first and last periods. - False: Masks any incomplete periods (standard behavior). - “start”: Unmasks only the first period. - “end”: Unmasks only the last period. Default is False.

  • completeness ({"ecad", "wmo", "strict", "none"} | float | None) – Completeness rule used to decide whether an output period has enough source observations to be calculated. None selects the ECA&D ATBD profile automatically: at least 350 daily values for a year, 175 for a half-year, 85 for a three-month season, and 25 for a month. strict requires every expected value. wmo applies the aggregation-specific WMO-No. 1203 rules: the 11-day/5-consecutive-day monthly rule for means and counts, complete data for sums, and no completeness mask for simple extrema. Unclassified operations, unsupported period types, non-daily WMO inputs, and spatially varying seasons safely fall back to strict. none always computes from available values, and a fraction in (0, 1] sets a configurable minimum valid fraction. Do not combine this parameter with the legacy allow_missing_periods parameter.

  • allow_missing_periods (bool | None) – Compatibility parameter for 7.2 workflows. An explicit False selects strict completeness, while True computes from available source values. None delegates to completeness and therefore uses ECA&D by default. When neither parameter is explicit, icclim warns if an irregular source time coordinate is detected or an already-eager mask shows an incomplete period. Lazy inputs are not evaluated solely to emit a warning.

  • allow_partial_final_period (bool) – When True, incomplete historical output periods are still masked, but the final output period is allowed to be computed from available source timesteps. This is useful for an ongoing month or year at the end of a time series. Ignored when allow_missing_periods=True.

Notes

This function has been auto-generated.

icclim._generated._generic.fraction_of_total(in_files: InFileLike, var_name: str | Sequence[str] | None = None, slice_mode: FrequencyLike | Frequency = 'year', time_range: Sequence[dt.datetime | str] | None = None, out_file: str | None = None, threshold: str | Threshold | Sequence[str | Threshold] | None = None, bootstrap: bool | None = None, ignore_Feb29th: bool = False, out_unit: str | None = None, netcdf_version: str | NetcdfVersion = 'NETCDF4', save_thresholds: bool = False, logs_verbosity: Verbosity | str = 'LOW', date_event: bool = False, run_index: str | None = 'first', allow_partial_seasons: bool | Literal['start', 'end'] | None = None, completeness: CompletenessLike = None, allow_missing_periods: bool | None = None, allow_partial_final_period: bool = False) → Dataset[source]#

Compute the fraction of values meeting threshold(s) over the sum of every values (e.g. R75pTOT, R95pTOT).

fraction_of_total: Compute the fraction of values meeting threshold(s) over the sum of every values (e.g. R75pTOT, R95pTOT).

Parameters:
  • in_files (str | list[str] | Dataset | DataArray | InputDictionary) – Absolute path(s) to NetCDF dataset(s), including OPeNDAP URLs, or path to zarr store, or xarray.Dataset or xarray.DataArray.

  • var_name (str | list[str] | None) – optional Target variable name to process corresponding to in_files. If None (default) on ECA&D index, the variable is guessed based on the climate index wanted. Mandatory for the deprecated user_index bridge.

  • slice_mode (FrequencyLike | Frequency) – Type of temporal aggregation: The possible values are {"year", "month", "DJF", "MAM", "JJA", "SON", "ONDJFM" or "AMJJAS", ("season", [1,2,3]), ("month", [1,2,3,])} (where season and month lists can be customized) or any valid pandas frequency. A season can also be defined between two exact dates: ("season", ("19 july", "14 august")). Spatially varying seasons can be defined by providing a tuple of two xarray.DataArray objects (start day-of-year and end day-of-year): (start_da, end_da). Default is “year”. See slice_mode for details.

  • time_range (list[datetime.datetime ] | list[str] | tuple[str, str] | None) – optional Temporal range: upper and lower bounds for temporal subsetting. If None, whole period of input files will be processed. The dates can either be given as instance of datetime.datetime or as string values. For strings, many format are accepted. Default is None.

  • out_file (str | None) – Output NetCDF file name (default: “icclim_out.nc” in the current directory). Default is “icclim_out.nc”. If the input in_files is a Dataset, out_file field is ignored. Use the function returned value instead to retrieve the computed value. If out_file already exists, icclim will overwrite it!

  • threshold (float | list[float] | None) – optional User defined threshold for certain indices. Default depend on the index, see their individual definition. When a list of threshold is provided, the index will be computed for each thresholds.

  • bootstrap (bool | None) – optional Override bootstrap behavior for day-of-year percentile thresholds. Use None (default) to rely on icclim’s overlap-based bootstrap logic, False to disable bootstrap, or True to force it when supported by the threshold type. For dask-backed percentile count indices, icclim automatically uses bounded spatial tiles so users do not have to find a working dask chunking strategy by trial and error. The safe path derives its spatial tile size from ICCLIM_BOOTSTRAP_SAFE_TILE_MEMORY (default: 2GB), unless ICCLIM_BOOTSTRAP_SAFE_TILE_CELLS is set as an expert override. Set ICCLIM_BOOTSTRAP_MODE=default only for diagnostics to keep the reference bootstrap dask graph path. bootstrap=False should only be used as an explicit user shortcut for fast exploratory assessments, because disabling bootstrap removes the overlap correction and can bias percentile-based results.

  • run_index (str | None) – optional The index to use for the run length encoding (e.g. “first”, “last”, “mid”). Default is “first”. Ignored for non spell indices.

  • ignore_Feb29th (bool) – optional Ignoring or not February 29th (default: False).

  • out_unit (str | None) – optional Output unit for certain indices: “days” or “%” (default: “days”).

  • netcdf_version (str | NetcdfVersion) – optional NetCDF version to create (default: “NETCDF3_CLASSIC”).

  • save_thresholds (bool) – optional True if the thresholds should be saved within the resulting netcdf file (default: False).

  • date_event (bool) – When True the date of the event (such as when a maximum is reached) will be stored in coordinates variables. warning This option may significantly slow down computation.

  • logs_verbosity (str | Verbosity) – optional Configure how verbose icclim is. Possible values: {"LOW", "HIGH", "SILENT"} (default: “LOW”)

  • allow_partial_seasons (bool | "start" | "end") – Flag indicating whether to allow partial seasons to be included in the index calculation. - True: Unmasks both the first and last periods. - False: Masks any incomplete periods (standard behavior). - “start”: Unmasks only the first period. - “end”: Unmasks only the last period. Default is False.

  • completeness ({"ecad", "wmo", "strict", "none"} | float | None) – Completeness rule used to decide whether an output period has enough source observations to be calculated. None selects the ECA&D ATBD profile automatically: at least 350 daily values for a year, 175 for a half-year, 85 for a three-month season, and 25 for a month. strict requires every expected value. wmo applies the aggregation-specific WMO-No. 1203 rules: the 11-day/5-consecutive-day monthly rule for means and counts, complete data for sums, and no completeness mask for simple extrema. Unclassified operations, unsupported period types, non-daily WMO inputs, and spatially varying seasons safely fall back to strict. none always computes from available values, and a fraction in (0, 1] sets a configurable minimum valid fraction. Do not combine this parameter with the legacy allow_missing_periods parameter.

  • allow_missing_periods (bool | None) – Compatibility parameter for 7.2 workflows. An explicit False selects strict completeness, while True computes from available source values. None delegates to completeness and therefore uses ECA&D by default. When neither parameter is explicit, icclim warns if an irregular source time coordinate is detected or an already-eager mask shows an incomplete period. Lazy inputs are not evaluated solely to emit a warning.

  • allow_partial_final_period (bool) – When True, incomplete historical output periods are still masked, but the final output period is allowed to be computed from available source timesteps. This is useful for an ongoing month or year at the end of a time series. Ignored when allow_missing_periods=True.

Notes

This function has been auto-generated.

icclim._generated._generic.max_consecutive_occurrence(in_files: InFileLike, var_name: str | Sequence[str] | None = None, slice_mode: FrequencyLike | Frequency = 'year', time_range: Sequence[dt.datetime | str] | None = None, out_file: str | None = None, threshold: str | Threshold | Sequence[str | Threshold] | None = None, bootstrap: bool | None = None, ignore_Feb29th: bool = False, out_unit: str | None = None, netcdf_version: str | NetcdfVersion = 'NETCDF4', save_thresholds: bool = False, logs_verbosity: Verbosity | str = 'LOW', date_event: bool = False, run_index: str | None = 'first', allow_partial_seasons: bool | Literal['start', 'end'] | None = None, completeness: CompletenessLike = None, allow_missing_periods: bool | None = None, allow_partial_final_period: bool = False) → Dataset[source]#

Count the maximum number of consecutive occurrences when threshold(s) are met (e.g. CDD, CSU, CWD).

max_consecutive_occurrence: Count the maximum number of consecutive occurrences when threshold(s) are met (e.g. CDD, CSU, CWD).

Parameters:
  • in_files (str | list[str] | Dataset | DataArray | InputDictionary) – Absolute path(s) to NetCDF dataset(s), including OPeNDAP URLs, or path to zarr store, or xarray.Dataset or xarray.DataArray.

  • var_name (str | list[str] | None) – optional Target variable name to process corresponding to in_files. If None (default) on ECA&D index, the variable is guessed based on the climate index wanted. Mandatory for the deprecated user_index bridge.

  • slice_mode (FrequencyLike | Frequency) – Type of temporal aggregation: The possible values are {"year", "month", "DJF", "MAM", "JJA", "SON", "ONDJFM" or "AMJJAS", ("season", [1,2,3]), ("month", [1,2,3,])} (where season and month lists can be customized) or any valid pandas frequency. A season can also be defined between two exact dates: ("season", ("19 july", "14 august")). Spatially varying seasons can be defined by providing a tuple of two xarray.DataArray objects (start day-of-year and end day-of-year): (start_da, end_da). Default is “year”. See slice_mode for details.

  • time_range (list[datetime.datetime ] | list[str] | tuple[str, str] | None) – optional Temporal range: upper and lower bounds for temporal subsetting. If None, whole period of input files will be processed. The dates can either be given as instance of datetime.datetime or as string values. For strings, many format are accepted. Default is None.

  • out_file (str | None) – Output NetCDF file name (default: “icclim_out.nc” in the current directory). Default is “icclim_out.nc”. If the input in_files is a Dataset, out_file field is ignored. Use the function returned value instead to retrieve the computed value. If out_file already exists, icclim will overwrite it!

  • threshold (float | list[float] | None) – optional User defined threshold for certain indices. Default depend on the index, see their individual definition. When a list of threshold is provided, the index will be computed for each thresholds.

  • bootstrap (bool | None) – optional Override bootstrap behavior for day-of-year percentile thresholds. Use None (default) to rely on icclim’s overlap-based bootstrap logic, False to disable bootstrap, or True to force it when supported by the threshold type. For dask-backed percentile count indices, icclim automatically uses bounded spatial tiles so users do not have to find a working dask chunking strategy by trial and error. The safe path derives its spatial tile size from ICCLIM_BOOTSTRAP_SAFE_TILE_MEMORY (default: 2GB), unless ICCLIM_BOOTSTRAP_SAFE_TILE_CELLS is set as an expert override. Set ICCLIM_BOOTSTRAP_MODE=default only for diagnostics to keep the reference bootstrap dask graph path. bootstrap=False should only be used as an explicit user shortcut for fast exploratory assessments, because disabling bootstrap removes the overlap correction and can bias percentile-based results.

  • run_index (str | None) – optional The index to use for the run length encoding (e.g. “first”, “last”, “mid”). Default is “first”. Ignored for non spell indices.

  • ignore_Feb29th (bool) – optional Ignoring or not February 29th (default: False).

  • out_unit (str | None) – optional Output unit for certain indices: “days” or “%” (default: “days”).

  • netcdf_version (str | NetcdfVersion) – optional NetCDF version to create (default: “NETCDF3_CLASSIC”).

  • save_thresholds (bool) – optional True if the thresholds should be saved within the resulting netcdf file (default: False).

  • date_event (bool) – When True the date of the event (such as when a maximum is reached) will be stored in coordinates variables. warning This option may significantly slow down computation.

  • logs_verbosity (str | Verbosity) – optional Configure how verbose icclim is. Possible values: {"LOW", "HIGH", "SILENT"} (default: “LOW”)

  • allow_partial_seasons (bool | "start" | "end") – Flag indicating whether to allow partial seasons to be included in the index calculation. - True: Unmasks both the first and last periods. - False: Masks any incomplete periods (standard behavior). - “start”: Unmasks only the first period. - “end”: Unmasks only the last period. Default is False.

  • completeness ({"ecad", "wmo", "strict", "none"} | float | None) – Completeness rule used to decide whether an output period has enough source observations to be calculated. None selects the ECA&D ATBD profile automatically: at least 350 daily values for a year, 175 for a half-year, 85 for a three-month season, and 25 for a month. strict requires every expected value. wmo applies the aggregation-specific WMO-No. 1203 rules: the 11-day/5-consecutive-day monthly rule for means and counts, complete data for sums, and no completeness mask for simple extrema. Unclassified operations, unsupported period types, non-daily WMO inputs, and spatially varying seasons safely fall back to strict. none always computes from available values, and a fraction in (0, 1] sets a configurable minimum valid fraction. Do not combine this parameter with the legacy allow_missing_periods parameter.

  • allow_missing_periods (bool | None) – Compatibility parameter for 7.2 workflows. An explicit False selects strict completeness, while True computes from available source values. None delegates to completeness and therefore uses ECA&D by default. When neither parameter is explicit, icclim warns if an irregular source time coordinate is detected or an already-eager mask shows an incomplete period. Lazy inputs are not evaluated solely to emit a warning.

  • allow_partial_final_period (bool) – When True, incomplete historical output periods are still masked, but the final output period is allowed to be computed from available source timesteps. This is useful for an ongoing month or year at the end of a time series. Ignored when allow_missing_periods=True.

Notes

This function has been auto-generated.

icclim._generated._generic.max_of_rolling_average(in_files: InFileLike, var_name: str | Sequence[str] | None = None, slice_mode: FrequencyLike | Frequency = 'year', time_range: Sequence[dt.datetime | str] | None = None, out_file: str | None = None, threshold: str | Threshold | Sequence[str | Threshold] | None = None, bootstrap: bool | None = None, ignore_Feb29th: bool = False, out_unit: str | None = None, netcdf_version: str | NetcdfVersion = 'NETCDF4', save_thresholds: bool = False, logs_verbosity: Verbosity | str = 'LOW', date_event: bool = False, rolling_window_width: int | None = 5, run_index: str | None = 'first', allow_partial_seasons: bool | Literal['start', 'end'] | None = None, completeness: CompletenessLike = None, allow_missing_periods: bool | None = None, allow_partial_final_period: bool = False) → Dataset[source]#

Maximum of rolling average over time dimension.

max_of_rolling_average: Maximum of rolling average over time dimension.

Parameters:
  • in_files (str | list[str] | Dataset | DataArray | InputDictionary) – Absolute path(s) to NetCDF dataset(s), including OPeNDAP URLs, or path to zarr store, or xarray.Dataset or xarray.DataArray.

  • var_name (str | list[str] | None) – optional Target variable name to process corresponding to in_files. If None (default) on ECA&D index, the variable is guessed based on the climate index wanted. Mandatory for the deprecated user_index bridge.

  • slice_mode (FrequencyLike | Frequency) – Type of temporal aggregation: The possible values are {"year", "month", "DJF", "MAM", "JJA", "SON", "ONDJFM" or "AMJJAS", ("season", [1,2,3]), ("month", [1,2,3,])} (where season and month lists can be customized) or any valid pandas frequency. A season can also be defined between two exact dates: ("season", ("19 july", "14 august")). Spatially varying seasons can be defined by providing a tuple of two xarray.DataArray objects (start day-of-year and end day-of-year): (start_da, end_da). Default is “year”. See slice_mode for details.

  • time_range (list[datetime.datetime ] | list[str] | tuple[str, str] | None) – optional Temporal range: upper and lower bounds for temporal subsetting. If None, whole period of input files will be processed. The dates can either be given as instance of datetime.datetime or as string values. For strings, many format are accepted. Default is None.

  • out_file (str | None) – Output NetCDF file name (default: “icclim_out.nc” in the current directory). Default is “icclim_out.nc”. If the input in_files is a Dataset, out_file field is ignored. Use the function returned value instead to retrieve the computed value. If out_file already exists, icclim will overwrite it!

  • threshold (float | list[float] | None) – optional User defined threshold for certain indices. Default depend on the index, see their individual definition. When a list of threshold is provided, the index will be computed for each thresholds.

  • bootstrap (bool | None) – optional Override bootstrap behavior for day-of-year percentile thresholds. Use None (default) to rely on icclim’s overlap-based bootstrap logic, False to disable bootstrap, or True to force it when supported by the threshold type. For dask-backed percentile count indices, icclim automatically uses bounded spatial tiles so users do not have to find a working dask chunking strategy by trial and error. The safe path derives its spatial tile size from ICCLIM_BOOTSTRAP_SAFE_TILE_MEMORY (default: 2GB), unless ICCLIM_BOOTSTRAP_SAFE_TILE_CELLS is set as an expert override. Set ICCLIM_BOOTSTRAP_MODE=default only for diagnostics to keep the reference bootstrap dask graph path. bootstrap=False should only be used as an explicit user shortcut for fast exploratory assessments, because disabling bootstrap removes the overlap correction and can bias percentile-based results.

  • rolling_window_width (int) – optional Window width of the rolling window for indicators such as {max_of_rolling_sum, max_of_rolling_average, min_of_rolling_sum, min_of_rolling_average}

  • run_index (str | None) – optional The index to use for the run length encoding (e.g. “first”, “last”, “mid”). Default is “first”. Ignored for non spell indices.

  • ignore_Feb29th (bool) – optional Ignoring or not February 29th (default: False).

  • out_unit (str | None) – optional Output unit for certain indices: “days” or “%” (default: “days”).

  • netcdf_version (str | NetcdfVersion) – optional NetCDF version to create (default: “NETCDF3_CLASSIC”).

  • save_thresholds (bool) – optional True if the thresholds should be saved within the resulting netcdf file (default: False).

  • date_event (bool) – When True the date of the event (such as when a maximum is reached) will be stored in coordinates variables. warning This option may significantly slow down computation.

  • logs_verbosity (str | Verbosity) – optional Configure how verbose icclim is. Possible values: {"LOW", "HIGH", "SILENT"} (default: “LOW”)

  • allow_partial_seasons (bool | "start" | "end") – Flag indicating whether to allow partial seasons to be included in the index calculation. - True: Unmasks both the first and last periods. - False: Masks any incomplete periods (standard behavior). - “start”: Unmasks only the first period. - “end”: Unmasks only the last period. Default is False.

  • completeness ({"ecad", "wmo", "strict", "none"} | float | None) – Completeness rule used to decide whether an output period has enough source observations to be calculated. None selects the ECA&D ATBD profile automatically: at least 350 daily values for a year, 175 for a half-year, 85 for a three-month season, and 25 for a month. strict requires every expected value. wmo applies the aggregation-specific WMO-No. 1203 rules: the 11-day/5-consecutive-day monthly rule for means and counts, complete data for sums, and no completeness mask for simple extrema. Unclassified operations, unsupported period types, non-daily WMO inputs, and spatially varying seasons safely fall back to strict. none always computes from available values, and a fraction in (0, 1] sets a configurable minimum valid fraction. Do not combine this parameter with the legacy allow_missing_periods parameter.

  • allow_missing_periods (bool | None) – Compatibility parameter for 7.2 workflows. An explicit False selects strict completeness, while True computes from available source values. None delegates to completeness and therefore uses ECA&D by default. When neither parameter is explicit, icclim warns if an irregular source time coordinate is detected or an already-eager mask shows an incomplete period. Lazy inputs are not evaluated solely to emit a warning.

  • allow_partial_final_period (bool) – When True, incomplete historical output periods are still masked, but the final output period is allowed to be computed from available source timesteps. This is useful for an ongoing month or year at the end of a time series. Ignored when allow_missing_periods=True.

Notes

This function has been auto-generated.

icclim._generated._generic.max_of_rolling_sum(in_files: InFileLike, var_name: str | Sequence[str] | None = None, slice_mode: FrequencyLike | Frequency = 'year', time_range: Sequence[dt.datetime | str] | None = None, out_file: str | None = None, threshold: str | Threshold | Sequence[str | Threshold] | None = None, bootstrap: bool | None = None, ignore_Feb29th: bool = False, out_unit: str | None = None, netcdf_version: str | NetcdfVersion = 'NETCDF4', save_thresholds: bool = False, logs_verbosity: Verbosity | str = 'LOW', date_event: bool = False, rolling_window_width: int | None = 5, run_index: str | None = 'first', allow_partial_seasons: bool | Literal['start', 'end'] | None = None, completeness: CompletenessLike = None, allow_missing_periods: bool | None = None, allow_partial_final_period: bool = False) → Dataset[source]#

Maximum of rolling sum over time dimension (e.g. RX5DAY: maximum 5 days window of precipitation accumulation).

max_of_rolling_sum: Maximum of rolling sum over time dimension (e.g. RX5DAY: maximum 5 days window of precipitation accumulation).

Parameters:
  • in_files (str | list[str] | Dataset | DataArray | InputDictionary) – Absolute path(s) to NetCDF dataset(s), including OPeNDAP URLs, or path to zarr store, or xarray.Dataset or xarray.DataArray.

  • var_name (str | list[str] | None) – optional Target variable name to process corresponding to in_files. If None (default) on ECA&D index, the variable is guessed based on the climate index wanted. Mandatory for the deprecated user_index bridge.

  • slice_mode (FrequencyLike | Frequency) – Type of temporal aggregation: The possible values are {"year", "month", "DJF", "MAM", "JJA", "SON", "ONDJFM" or "AMJJAS", ("season", [1,2,3]), ("month", [1,2,3,])} (where season and month lists can be customized) or any valid pandas frequency. A season can also be defined between two exact dates: ("season", ("19 july", "14 august")). Spatially varying seasons can be defined by providing a tuple of two xarray.DataArray objects (start day-of-year and end day-of-year): (start_da, end_da). Default is “year”. See slice_mode for details.

  • time_range (list[datetime.datetime ] | list[str] | tuple[str, str] | None) – optional Temporal range: upper and lower bounds for temporal subsetting. If None, whole period of input files will be processed. The dates can either be given as instance of datetime.datetime or as string values. For strings, many format are accepted. Default is None.

  • out_file (str | None) – Output NetCDF file name (default: “icclim_out.nc” in the current directory). Default is “icclim_out.nc”. If the input in_files is a Dataset, out_file field is ignored. Use the function returned value instead to retrieve the computed value. If out_file already exists, icclim will overwrite it!

  • threshold (float | list[float] | None) – optional User defined threshold for certain indices. Default depend on the index, see their individual definition. When a list of threshold is provided, the index will be computed for each thresholds.

  • bootstrap (bool | None) – optional Override bootstrap behavior for day-of-year percentile thresholds. Use None (default) to rely on icclim’s overlap-based bootstrap logic, False to disable bootstrap, or True to force it when supported by the threshold type. For dask-backed percentile count indices, icclim automatically uses bounded spatial tiles so users do not have to find a working dask chunking strategy by trial and error. The safe path derives its spatial tile size from ICCLIM_BOOTSTRAP_SAFE_TILE_MEMORY (default: 2GB), unless ICCLIM_BOOTSTRAP_SAFE_TILE_CELLS is set as an expert override. Set ICCLIM_BOOTSTRAP_MODE=default only for diagnostics to keep the reference bootstrap dask graph path. bootstrap=False should only be used as an explicit user shortcut for fast exploratory assessments, because disabling bootstrap removes the overlap correction and can bias percentile-based results.

  • rolling_window_width (int) – optional Window width of the rolling window for indicators such as {max_of_rolling_sum, max_of_rolling_average, min_of_rolling_sum, min_of_rolling_average}

  • run_index (str | None) – optional The index to use for the run length encoding (e.g. “first”, “last”, “mid”). Default is “first”. Ignored for non spell indices.

  • ignore_Feb29th (bool) – optional Ignoring or not February 29th (default: False).

  • out_unit (str | None) – optional Output unit for certain indices: “days” or “%” (default: “days”).

  • netcdf_version (str | NetcdfVersion) – optional NetCDF version to create (default: “NETCDF3_CLASSIC”).

  • save_thresholds (bool) – optional True if the thresholds should be saved within the resulting netcdf file (default: False).

  • date_event (bool) – When True the date of the event (such as when a maximum is reached) will be stored in coordinates variables. warning This option may significantly slow down computation.

  • logs_verbosity (str | Verbosity) – optional Configure how verbose icclim is. Possible values: {"LOW", "HIGH", "SILENT"} (default: “LOW”)

  • allow_partial_seasons (bool | "start" | "end") – Flag indicating whether to allow partial seasons to be included in the index calculation. - True: Unmasks both the first and last periods. - False: Masks any incomplete periods (standard behavior). - “start”: Unmasks only the first period. - “end”: Unmasks only the last period. Default is False.

  • completeness ({"ecad", "wmo", "strict", "none"} | float | None) – Completeness rule used to decide whether an output period has enough source observations to be calculated. None selects the ECA&D ATBD profile automatically: at least 350 daily values for a year, 175 for a half-year, 85 for a three-month season, and 25 for a month. strict requires every expected value. wmo applies the aggregation-specific WMO-No. 1203 rules: the 11-day/5-consecutive-day monthly rule for means and counts, complete data for sums, and no completeness mask for simple extrema. Unclassified operations, unsupported period types, non-daily WMO inputs, and spatially varying seasons safely fall back to strict. none always computes from available values, and a fraction in (0, 1] sets a configurable minimum valid fraction. Do not combine this parameter with the legacy allow_missing_periods parameter.

  • allow_missing_periods (bool | None) – Compatibility parameter for 7.2 workflows. An explicit False selects strict completeness, while True computes from available source values. None delegates to completeness and therefore uses ECA&D by default. When neither parameter is explicit, icclim warns if an irregular source time coordinate is detected or an already-eager mask shows an incomplete period. Lazy inputs are not evaluated solely to emit a warning.

  • allow_partial_final_period (bool) – When True, incomplete historical output periods are still masked, but the final output period is allowed to be computed from available source timesteps. This is useful for an ongoing month or year at the end of a time series. Ignored when allow_missing_periods=True.

Notes

This function has been auto-generated.

icclim._generated._generic.maximum(in_files: InFileLike, var_name: str | Sequence[str] | None = None, slice_mode: FrequencyLike | Frequency = 'year', time_range: Sequence[dt.datetime | str] | None = None, out_file: str | None = None, threshold: str | Threshold | Sequence[str | Threshold] | None = None, bootstrap: bool | None = None, ignore_Feb29th: bool = False, out_unit: str | None = None, netcdf_version: str | NetcdfVersion = 'NETCDF4', save_thresholds: bool = False, logs_verbosity: Verbosity | str = 'LOW', date_event: bool = False, run_index: str | None = 'first', allow_partial_seasons: bool | Literal['start', 'end'] | None = None, completeness: CompletenessLike = None, allow_missing_periods: bool | None = None, allow_partial_final_period: bool = False) → Dataset[source]#

Maximum of values that met threshold(s), if threshold(s) are given (e.g. Txx, Tnx).

maximum: Maximum of values that met threshold(s), if threshold(s) are given (e.g. Txx, Tnx).

Parameters:
  • in_files (str | list[str] | Dataset | DataArray | InputDictionary) – Absolute path(s) to NetCDF dataset(s), including OPeNDAP URLs, or path to zarr store, or xarray.Dataset or xarray.DataArray.

  • var_name (str | list[str] | None) – optional Target variable name to process corresponding to in_files. If None (default) on ECA&D index, the variable is guessed based on the climate index wanted. Mandatory for the deprecated user_index bridge.

  • slice_mode (FrequencyLike | Frequency) – Type of temporal aggregation: The possible values are {"year", "month", "DJF", "MAM", "JJA", "SON", "ONDJFM" or "AMJJAS", ("season", [1,2,3]), ("month", [1,2,3,])} (where season and month lists can be customized) or any valid pandas frequency. A season can also be defined between two exact dates: ("season", ("19 july", "14 august")). Spatially varying seasons can be defined by providing a tuple of two xarray.DataArray objects (start day-of-year and end day-of-year): (start_da, end_da). Default is “year”. See slice_mode for details.

  • time_range (list[datetime.datetime ] | list[str] | tuple[str, str] | None) – optional Temporal range: upper and lower bounds for temporal subsetting. If None, whole period of input files will be processed. The dates can either be given as instance of datetime.datetime or as string values. For strings, many format are accepted. Default is None.

  • out_file (str | None) – Output NetCDF file name (default: “icclim_out.nc” in the current directory). Default is “icclim_out.nc”. If the input in_files is a Dataset, out_file field is ignored. Use the function returned value instead to retrieve the computed value. If out_file already exists, icclim will overwrite it!

  • threshold (float | list[float] | None) – optional User defined threshold for certain indices. Default depend on the index, see their individual definition. When a list of threshold is provided, the index will be computed for each thresholds.

  • bootstrap (bool | None) – optional Override bootstrap behavior for day-of-year percentile thresholds. Use None (default) to rely on icclim’s overlap-based bootstrap logic, False to disable bootstrap, or True to force it when supported by the threshold type. For dask-backed percentile count indices, icclim automatically uses bounded spatial tiles so users do not have to find a working dask chunking strategy by trial and error. The safe path derives its spatial tile size from ICCLIM_BOOTSTRAP_SAFE_TILE_MEMORY (default: 2GB), unless ICCLIM_BOOTSTRAP_SAFE_TILE_CELLS is set as an expert override. Set ICCLIM_BOOTSTRAP_MODE=default only for diagnostics to keep the reference bootstrap dask graph path. bootstrap=False should only be used as an explicit user shortcut for fast exploratory assessments, because disabling bootstrap removes the overlap correction and can bias percentile-based results.

  • run_index (str | None) – optional The index to use for the run length encoding (e.g. “first”, “last”, “mid”). Default is “first”. Ignored for non spell indices.

  • ignore_Feb29th (bool) – optional Ignoring or not February 29th (default: False).

  • out_unit (str | None) – optional Output unit for certain indices: “days” or “%” (default: “days”).

  • netcdf_version (str | NetcdfVersion) – optional NetCDF version to create (default: “NETCDF3_CLASSIC”).

  • save_thresholds (bool) – optional True if the thresholds should be saved within the resulting netcdf file (default: False).

  • date_event (bool) – When True the date of the event (such as when a maximum is reached) will be stored in coordinates variables. warning This option may significantly slow down computation.

  • logs_verbosity (str | Verbosity) – optional Configure how verbose icclim is. Possible values: {"LOW", "HIGH", "SILENT"} (default: “LOW”)

  • allow_partial_seasons (bool | "start" | "end") – Flag indicating whether to allow partial seasons to be included in the index calculation. - True: Unmasks both the first and last periods. - False: Masks any incomplete periods (standard behavior). - “start”: Unmasks only the first period. - “end”: Unmasks only the last period. Default is False.

  • completeness ({"ecad", "wmo", "strict", "none"} | float | None) – Completeness rule used to decide whether an output period has enough source observations to be calculated. None selects the ECA&D ATBD profile automatically: at least 350 daily values for a year, 175 for a half-year, 85 for a three-month season, and 25 for a month. strict requires every expected value. wmo applies the aggregation-specific WMO-No. 1203 rules: the 11-day/5-consecutive-day monthly rule for means and counts, complete data for sums, and no completeness mask for simple extrema. Unclassified operations, unsupported period types, non-daily WMO inputs, and spatially varying seasons safely fall back to strict. none always computes from available values, and a fraction in (0, 1] sets a configurable minimum valid fraction. Do not combine this parameter with the legacy allow_missing_periods parameter.

  • allow_missing_periods (bool | None) – Compatibility parameter for 7.2 workflows. An explicit False selects strict completeness, while True computes from available source values. None delegates to completeness and therefore uses ECA&D by default. When neither parameter is explicit, icclim warns if an irregular source time coordinate is detected or an already-eager mask shows an incomplete period. Lazy inputs are not evaluated solely to emit a warning.

  • allow_partial_final_period (bool) – When True, incomplete historical output periods are still masked, but the final output period is allowed to be computed from available source timesteps. This is useful for an ongoing month or year at the end of a time series. Ignored when allow_missing_periods=True.

Notes

This function has been auto-generated.

icclim._generated._generic.mean_of_absolute_one_time_step_difference(in_files: InFileLike, var_name: str | Sequence[str] | None = None, slice_mode: FrequencyLike | Frequency = 'year', time_range: Sequence[dt.datetime | str] | None = None, out_file: str | None = None, threshold: str | Threshold | Sequence[str | Threshold] | None = None, bootstrap: bool | None = None, ignore_Feb29th: bool = False, out_unit: str | None = None, netcdf_version: str | NetcdfVersion = 'NETCDF4', save_thresholds: bool = False, logs_verbosity: Verbosity | str = 'LOW', date_event: bool = False, run_index: str | None = 'first', allow_partial_seasons: bool | Literal['start', 'end'] | None = None, completeness: CompletenessLike = None, allow_missing_periods: bool | None = None, allow_partial_final_period: bool = False) → Dataset[source]#

Average of the absolute one time step by one time step difference between two variables, or one variable and it’s reference period values (e.g. vDTR: mean((tasmax[i] - tasmin[i]) - (tasmax[i-1] - tasmin[i-1]) ; where i is the day of measure).

mean_of_absolute_one_time_step_difference: Average of the absolute one time step by one time step difference between two variables, or one variable and it’s reference period values (e.g. vDTR: mean((tasmax[i] - tasmin[i]) - (tasmax[i-1] - tasmin[i-1]) ; where i is the day of measure).

Parameters:
  • in_files (str | list[str] | Dataset | DataArray | InputDictionary) – Absolute path(s) to NetCDF dataset(s), including OPeNDAP URLs, or path to zarr store, or xarray.Dataset or xarray.DataArray.

  • var_name (str | list[str] | None) – optional Target variable name to process corresponding to in_files. If None (default) on ECA&D index, the variable is guessed based on the climate index wanted. Mandatory for the deprecated user_index bridge.

  • slice_mode (FrequencyLike | Frequency) – Type of temporal aggregation: The possible values are {"year", "month", "DJF", "MAM", "JJA", "SON", "ONDJFM" or "AMJJAS", ("season", [1,2,3]), ("month", [1,2,3,])} (where season and month lists can be customized) or any valid pandas frequency. A season can also be defined between two exact dates: ("season", ("19 july", "14 august")). Spatially varying seasons can be defined by providing a tuple of two xarray.DataArray objects (start day-of-year and end day-of-year): (start_da, end_da). Default is “year”. See slice_mode for details.

  • time_range (list[datetime.datetime ] | list[str] | tuple[str, str] | None) – optional Temporal range: upper and lower bounds for temporal subsetting. If None, whole period of input files will be processed. The dates can either be given as instance of datetime.datetime or as string values. For strings, many format are accepted. Default is None.

  • out_file (str | None) – Output NetCDF file name (default: “icclim_out.nc” in the current directory). Default is “icclim_out.nc”. If the input in_files is a Dataset, out_file field is ignored. Use the function returned value instead to retrieve the computed value. If out_file already exists, icclim will overwrite it!

  • threshold (float | list[float] | None) – optional User defined threshold for certain indices. Default depend on the index, see their individual definition. When a list of threshold is provided, the index will be computed for each thresholds.

  • bootstrap (bool | None) – optional Override bootstrap behavior for day-of-year percentile thresholds. Use None (default) to rely on icclim’s overlap-based bootstrap logic, False to disable bootstrap, or True to force it when supported by the threshold type. For dask-backed percentile count indices, icclim automatically uses bounded spatial tiles so users do not have to find a working dask chunking strategy by trial and error. The safe path derives its spatial tile size from ICCLIM_BOOTSTRAP_SAFE_TILE_MEMORY (default: 2GB), unless ICCLIM_BOOTSTRAP_SAFE_TILE_CELLS is set as an expert override. Set ICCLIM_BOOTSTRAP_MODE=default only for diagnostics to keep the reference bootstrap dask graph path. bootstrap=False should only be used as an explicit user shortcut for fast exploratory assessments, because disabling bootstrap removes the overlap correction and can bias percentile-based results.

  • run_index (str | None) – optional The index to use for the run length encoding (e.g. “first”, “last”, “mid”). Default is “first”. Ignored for non spell indices.

  • ignore_Feb29th (bool) – optional Ignoring or not February 29th (default: False).

  • out_unit (str | None) – optional Output unit for certain indices: “days” or “%” (default: “days”).

  • netcdf_version (str | NetcdfVersion) – optional NetCDF version to create (default: “NETCDF3_CLASSIC”).

  • save_thresholds (bool) – optional True if the thresholds should be saved within the resulting netcdf file (default: False).

  • date_event (bool) – When True the date of the event (such as when a maximum is reached) will be stored in coordinates variables. warning This option may significantly slow down computation.

  • logs_verbosity (str | Verbosity) – optional Configure how verbose icclim is. Possible values: {"LOW", "HIGH", "SILENT"} (default: “LOW”)

  • allow_partial_seasons (bool | "start" | "end") – Flag indicating whether to allow partial seasons to be included in the index calculation. - True: Unmasks both the first and last periods. - False: Masks any incomplete periods (standard behavior). - “start”: Unmasks only the first period. - “end”: Unmasks only the last period. Default is False.

  • completeness ({"ecad", "wmo", "strict", "none"} | float | None) – Completeness rule used to decide whether an output period has enough source observations to be calculated. None selects the ECA&D ATBD profile automatically: at least 350 daily values for a year, 175 for a half-year, 85 for a three-month season, and 25 for a month. strict requires every expected value. wmo applies the aggregation-specific WMO-No. 1203 rules: the 11-day/5-consecutive-day monthly rule for means and counts, complete data for sums, and no completeness mask for simple extrema. Unclassified operations, unsupported period types, non-daily WMO inputs, and spatially varying seasons safely fall back to strict. none always computes from available values, and a fraction in (0, 1] sets a configurable minimum valid fraction. Do not combine this parameter with the legacy allow_missing_periods parameter.

  • allow_missing_periods (bool | None) – Compatibility parameter for 7.2 workflows. An explicit False selects strict completeness, while True computes from available source values. None delegates to completeness and therefore uses ECA&D by default. When neither parameter is explicit, icclim warns if an irregular source time coordinate is detected or an already-eager mask shows an incomplete period. Lazy inputs are not evaluated solely to emit a warning.

  • allow_partial_final_period (bool) – When True, incomplete historical output periods are still masked, but the final output period is allowed to be computed from available source timesteps. This is useful for an ongoing month or year at the end of a time series. Ignored when allow_missing_periods=True.

Notes

This function has been auto-generated.

icclim._generated._generic.mean_of_difference(in_files: InFileLike, var_name: str | Sequence[str] | None = None, slice_mode: FrequencyLike | Frequency = 'year', time_range: Sequence[dt.datetime | str] | None = None, out_file: str | None = None, threshold: str | Threshold | Sequence[str | Threshold] | None = None, bootstrap: bool | None = None, ignore_Feb29th: bool = False, out_unit: str | None = None, netcdf_version: str | NetcdfVersion = 'NETCDF4', save_thresholds: bool = False, logs_verbosity: Verbosity | str = 'LOW', date_event: bool = False, run_index: str | None = 'first', allow_partial_seasons: bool | Literal['start', 'end'] | None = None, completeness: CompletenessLike = None, allow_missing_periods: bool | None = None, allow_partial_final_period: bool = False) → Dataset[source]#

Average of the difference between two variables, or one variable and it’s reference period values (e.g. DTR: mean(tasmax - tasmin)).

mean_of_difference: Average of the difference between two variables, or one variable and it’s reference period values (e.g. DTR: mean(tasmax - tasmin)).

Parameters:
  • in_files (str | list[str] | Dataset | DataArray | InputDictionary) – Absolute path(s) to NetCDF dataset(s), including OPeNDAP URLs, or path to zarr store, or xarray.Dataset or xarray.DataArray.

  • var_name (str | list[str] | None) – optional Target variable name to process corresponding to in_files. If None (default) on ECA&D index, the variable is guessed based on the climate index wanted. Mandatory for the deprecated user_index bridge.

  • slice_mode (FrequencyLike | Frequency) – Type of temporal aggregation: The possible values are {"year", "month", "DJF", "MAM", "JJA", "SON", "ONDJFM" or "AMJJAS", ("season", [1,2,3]), ("month", [1,2,3,])} (where season and month lists can be customized) or any valid pandas frequency. A season can also be defined between two exact dates: ("season", ("19 july", "14 august")). Spatially varying seasons can be defined by providing a tuple of two xarray.DataArray objects (start day-of-year and end day-of-year): (start_da, end_da). Default is “year”. See slice_mode for details.

  • time_range (list[datetime.datetime ] | list[str] | tuple[str, str] | None) – optional Temporal range: upper and lower bounds for temporal subsetting. If None, whole period of input files will be processed. The dates can either be given as instance of datetime.datetime or as string values. For strings, many format are accepted. Default is None.

  • out_file (str | None) – Output NetCDF file name (default: “icclim_out.nc” in the current directory). Default is “icclim_out.nc”. If the input in_files is a Dataset, out_file field is ignored. Use the function returned value instead to retrieve the computed value. If out_file already exists, icclim will overwrite it!

  • threshold (float | list[float] | None) – optional User defined threshold for certain indices. Default depend on the index, see their individual definition. When a list of threshold is provided, the index will be computed for each thresholds.

  • bootstrap (bool | None) – optional Override bootstrap behavior for day-of-year percentile thresholds. Use None (default) to rely on icclim’s overlap-based bootstrap logic, False to disable bootstrap, or True to force it when supported by the threshold type. For dask-backed percentile count indices, icclim automatically uses bounded spatial tiles so users do not have to find a working dask chunking strategy by trial and error. The safe path derives its spatial tile size from ICCLIM_BOOTSTRAP_SAFE_TILE_MEMORY (default: 2GB), unless ICCLIM_BOOTSTRAP_SAFE_TILE_CELLS is set as an expert override. Set ICCLIM_BOOTSTRAP_MODE=default only for diagnostics to keep the reference bootstrap dask graph path. bootstrap=False should only be used as an explicit user shortcut for fast exploratory assessments, because disabling bootstrap removes the overlap correction and can bias percentile-based results.

  • run_index (str | None) – optional The index to use for the run length encoding (e.g. “first”, “last”, “mid”). Default is “first”. Ignored for non spell indices.

  • ignore_Feb29th (bool) – optional Ignoring or not February 29th (default: False).

  • out_unit (str | None) – optional Output unit for certain indices: “days” or “%” (default: “days”).

  • netcdf_version (str | NetcdfVersion) – optional NetCDF version to create (default: “NETCDF3_CLASSIC”).

  • save_thresholds (bool) – optional True if the thresholds should be saved within the resulting netcdf file (default: False).

  • date_event (bool) – When True the date of the event (such as when a maximum is reached) will be stored in coordinates variables. warning This option may significantly slow down computation.

  • logs_verbosity (str | Verbosity) – optional Configure how verbose icclim is. Possible values: {"LOW", "HIGH", "SILENT"} (default: “LOW”)

  • allow_partial_seasons (bool | "start" | "end") – Flag indicating whether to allow partial seasons to be included in the index calculation. - True: Unmasks both the first and last periods. - False: Masks any incomplete periods (standard behavior). - “start”: Unmasks only the first period. - “end”: Unmasks only the last period. Default is False.

  • completeness ({"ecad", "wmo", "strict", "none"} | float | None) – Completeness rule used to decide whether an output period has enough source observations to be calculated. None selects the ECA&D ATBD profile automatically: at least 350 daily values for a year, 175 for a half-year, 85 for a three-month season, and 25 for a month. strict requires every expected value. wmo applies the aggregation-specific WMO-No. 1203 rules: the 11-day/5-consecutive-day monthly rule for means and counts, complete data for sums, and no completeness mask for simple extrema. Unclassified operations, unsupported period types, non-daily WMO inputs, and spatially varying seasons safely fall back to strict. none always computes from available values, and a fraction in (0, 1] sets a configurable minimum valid fraction. Do not combine this parameter with the legacy allow_missing_periods parameter.

  • allow_missing_periods (bool | None) – Compatibility parameter for 7.2 workflows. An explicit False selects strict completeness, while True computes from available source values. None delegates to completeness and therefore uses ECA&D by default. When neither parameter is explicit, icclim warns if an irregular source time coordinate is detected or an already-eager mask shows an incomplete period. Lazy inputs are not evaluated solely to emit a warning.

  • allow_partial_final_period (bool) – When True, incomplete historical output periods are still masked, but the final output period is allowed to be computed from available source timesteps. This is useful for an ongoing month or year at the end of a time series. Ignored when allow_missing_periods=True.

Notes

This function has been auto-generated.

icclim._generated._generic.min_of_rolling_average(in_files: InFileLike, var_name: str | Sequence[str] | None = None, slice_mode: FrequencyLike | Frequency = 'year', time_range: Sequence[dt.datetime | str] | None = None, out_file: str | None = None, threshold: str | Threshold | Sequence[str | Threshold] | None = None, bootstrap: bool | None = None, ignore_Feb29th: bool = False, out_unit: str | None = None, netcdf_version: str | NetcdfVersion = 'NETCDF4', save_thresholds: bool = False, logs_verbosity: Verbosity | str = 'LOW', date_event: bool = False, rolling_window_width: int | None = 5, run_index: str | None = 'first', allow_partial_seasons: bool | Literal['start', 'end'] | None = None, completeness: CompletenessLike = None, allow_missing_periods: bool | None = None, allow_partial_final_period: bool = False) → Dataset[source]#

Minimum of rolling average over time dimension.

min_of_rolling_average: Minimum of rolling average over time dimension.

Parameters:
  • in_files (str | list[str] | Dataset | DataArray | InputDictionary) – Absolute path(s) to NetCDF dataset(s), including OPeNDAP URLs, or path to zarr store, or xarray.Dataset or xarray.DataArray.

  • var_name (str | list[str] | None) – optional Target variable name to process corresponding to in_files. If None (default) on ECA&D index, the variable is guessed based on the climate index wanted. Mandatory for the deprecated user_index bridge.

  • slice_mode (FrequencyLike | Frequency) – Type of temporal aggregation: The possible values are {"year", "month", "DJF", "MAM", "JJA", "SON", "ONDJFM" or "AMJJAS", ("season", [1,2,3]), ("month", [1,2,3,])} (where season and month lists can be customized) or any valid pandas frequency. A season can also be defined between two exact dates: ("season", ("19 july", "14 august")). Spatially varying seasons can be defined by providing a tuple of two xarray.DataArray objects (start day-of-year and end day-of-year): (start_da, end_da). Default is “year”. See slice_mode for details.

  • time_range (list[datetime.datetime ] | list[str] | tuple[str, str] | None) – optional Temporal range: upper and lower bounds for temporal subsetting. If None, whole period of input files will be processed. The dates can either be given as instance of datetime.datetime or as string values. For strings, many format are accepted. Default is None.

  • out_file (str | None) – Output NetCDF file name (default: “icclim_out.nc” in the current directory). Default is “icclim_out.nc”. If the input in_files is a Dataset, out_file field is ignored. Use the function returned value instead to retrieve the computed value. If out_file already exists, icclim will overwrite it!

  • threshold (float | list[float] | None) – optional User defined threshold for certain indices. Default depend on the index, see their individual definition. When a list of threshold is provided, the index will be computed for each thresholds.

  • bootstrap (bool | None) – optional Override bootstrap behavior for day-of-year percentile thresholds. Use None (default) to rely on icclim’s overlap-based bootstrap logic, False to disable bootstrap, or True to force it when supported by the threshold type. For dask-backed percentile count indices, icclim automatically uses bounded spatial tiles so users do not have to find a working dask chunking strategy by trial and error. The safe path derives its spatial tile size from ICCLIM_BOOTSTRAP_SAFE_TILE_MEMORY (default: 2GB), unless ICCLIM_BOOTSTRAP_SAFE_TILE_CELLS is set as an expert override. Set ICCLIM_BOOTSTRAP_MODE=default only for diagnostics to keep the reference bootstrap dask graph path. bootstrap=False should only be used as an explicit user shortcut for fast exploratory assessments, because disabling bootstrap removes the overlap correction and can bias percentile-based results.

  • rolling_window_width (int) – optional Window width of the rolling window for indicators such as {max_of_rolling_sum, max_of_rolling_average, min_of_rolling_sum, min_of_rolling_average}

  • run_index (str | None) – optional The index to use for the run length encoding (e.g. “first”, “last”, “mid”). Default is “first”. Ignored for non spell indices.

  • ignore_Feb29th (bool) – optional Ignoring or not February 29th (default: False).

  • out_unit (str | None) – optional Output unit for certain indices: “days” or “%” (default: “days”).

  • netcdf_version (str | NetcdfVersion) – optional NetCDF version to create (default: “NETCDF3_CLASSIC”).

  • save_thresholds (bool) – optional True if the thresholds should be saved within the resulting netcdf file (default: False).

  • date_event (bool) – When True the date of the event (such as when a maximum is reached) will be stored in coordinates variables. warning This option may significantly slow down computation.

  • logs_verbosity (str | Verbosity) – optional Configure how verbose icclim is. Possible values: {"LOW", "HIGH", "SILENT"} (default: “LOW”)

  • allow_partial_seasons (bool | "start" | "end") – Flag indicating whether to allow partial seasons to be included in the index calculation. - True: Unmasks both the first and last periods. - False: Masks any incomplete periods (standard behavior). - “start”: Unmasks only the first period. - “end”: Unmasks only the last period. Default is False.

  • completeness ({"ecad", "wmo", "strict", "none"} | float | None) – Completeness rule used to decide whether an output period has enough source observations to be calculated. None selects the ECA&D ATBD profile automatically: at least 350 daily values for a year, 175 for a half-year, 85 for a three-month season, and 25 for a month. strict requires every expected value. wmo applies the aggregation-specific WMO-No. 1203 rules: the 11-day/5-consecutive-day monthly rule for means and counts, complete data for sums, and no completeness mask for simple extrema. Unclassified operations, unsupported period types, non-daily WMO inputs, and spatially varying seasons safely fall back to strict. none always computes from available values, and a fraction in (0, 1] sets a configurable minimum valid fraction. Do not combine this parameter with the legacy allow_missing_periods parameter.

  • allow_missing_periods (bool | None) – Compatibility parameter for 7.2 workflows. An explicit False selects strict completeness, while True computes from available source values. None delegates to completeness and therefore uses ECA&D by default. When neither parameter is explicit, icclim warns if an irregular source time coordinate is detected or an already-eager mask shows an incomplete period. Lazy inputs are not evaluated solely to emit a warning.

  • allow_partial_final_period (bool) – When True, incomplete historical output periods are still masked, but the final output period is allowed to be computed from available source timesteps. This is useful for an ongoing month or year at the end of a time series. Ignored when allow_missing_periods=True.

Notes

This function has been auto-generated.

icclim._generated._generic.min_of_rolling_sum(in_files: InFileLike, var_name: str | Sequence[str] | None = None, slice_mode: FrequencyLike | Frequency = 'year', time_range: Sequence[dt.datetime | str] | None = None, out_file: str | None = None, threshold: str | Threshold | Sequence[str | Threshold] | None = None, bootstrap: bool | None = None, ignore_Feb29th: bool = False, out_unit: str | None = None, netcdf_version: str | NetcdfVersion = 'NETCDF4', save_thresholds: bool = False, logs_verbosity: Verbosity | str = 'LOW', date_event: bool = False, rolling_window_width: int | None = 5, run_index: str | None = 'first', allow_partial_seasons: bool | Literal['start', 'end'] | None = None, completeness: CompletenessLike = None, allow_missing_periods: bool | None = None, allow_partial_final_period: bool = False) → Dataset[source]#

Minimum of rolling sum over time dimension.

min_of_rolling_sum: Minimum of rolling sum over time dimension.

Parameters:
  • in_files (str | list[str] | Dataset | DataArray | InputDictionary) – Absolute path(s) to NetCDF dataset(s), including OPeNDAP URLs, or path to zarr store, or xarray.Dataset or xarray.DataArray.

  • var_name (str | list[str] | None) – optional Target variable name to process corresponding to in_files. If None (default) on ECA&D index, the variable is guessed based on the climate index wanted. Mandatory for the deprecated user_index bridge.

  • slice_mode (FrequencyLike | Frequency) – Type of temporal aggregation: The possible values are {"year", "month", "DJF", "MAM", "JJA", "SON", "ONDJFM" or "AMJJAS", ("season", [1,2,3]), ("month", [1,2,3,])} (where season and month lists can be customized) or any valid pandas frequency. A season can also be defined between two exact dates: ("season", ("19 july", "14 august")). Spatially varying seasons can be defined by providing a tuple of two xarray.DataArray objects (start day-of-year and end day-of-year): (start_da, end_da). Default is “year”. See slice_mode for details.

  • time_range (list[datetime.datetime ] | list[str] | tuple[str, str] | None) – optional Temporal range: upper and lower bounds for temporal subsetting. If None, whole period of input files will be processed. The dates can either be given as instance of datetime.datetime or as string values. For strings, many format are accepted. Default is None.

  • out_file (str | None) – Output NetCDF file name (default: “icclim_out.nc” in the current directory). Default is “icclim_out.nc”. If the input in_files is a Dataset, out_file field is ignored. Use the function returned value instead to retrieve the computed value. If out_file already exists, icclim will overwrite it!

  • threshold (float | list[float] | None) – optional User defined threshold for certain indices. Default depend on the index, see their individual definition. When a list of threshold is provided, the index will be computed for each thresholds.

  • bootstrap (bool | None) – optional Override bootstrap behavior for day-of-year percentile thresholds. Use None (default) to rely on icclim’s overlap-based bootstrap logic, False to disable bootstrap, or True to force it when supported by the threshold type. For dask-backed percentile count indices, icclim automatically uses bounded spatial tiles so users do not have to find a working dask chunking strategy by trial and error. The safe path derives its spatial tile size from ICCLIM_BOOTSTRAP_SAFE_TILE_MEMORY (default: 2GB), unless ICCLIM_BOOTSTRAP_SAFE_TILE_CELLS is set as an expert override. Set ICCLIM_BOOTSTRAP_MODE=default only for diagnostics to keep the reference bootstrap dask graph path. bootstrap=False should only be used as an explicit user shortcut for fast exploratory assessments, because disabling bootstrap removes the overlap correction and can bias percentile-based results.

  • rolling_window_width (int) – optional Window width of the rolling window for indicators such as {max_of_rolling_sum, max_of_rolling_average, min_of_rolling_sum, min_of_rolling_average}

  • run_index (str | None) – optional The index to use for the run length encoding (e.g. “first”, “last”, “mid”). Default is “first”. Ignored for non spell indices.

  • ignore_Feb29th (bool) – optional Ignoring or not February 29th (default: False).

  • out_unit (str | None) – optional Output unit for certain indices: “days” or “%” (default: “days”).

  • netcdf_version (str | NetcdfVersion) – optional NetCDF version to create (default: “NETCDF3_CLASSIC”).

  • save_thresholds (bool) – optional True if the thresholds should be saved within the resulting netcdf file (default: False).

  • date_event (bool) – When True the date of the event (such as when a maximum is reached) will be stored in coordinates variables. warning This option may significantly slow down computation.

  • logs_verbosity (str | Verbosity) – optional Configure how verbose icclim is. Possible values: {"LOW", "HIGH", "SILENT"} (default: “LOW”)

  • allow_partial_seasons (bool | "start" | "end") – Flag indicating whether to allow partial seasons to be included in the index calculation. - True: Unmasks both the first and last periods. - False: Masks any incomplete periods (standard behavior). - “start”: Unmasks only the first period. - “end”: Unmasks only the last period. Default is False.

  • completeness ({"ecad", "wmo", "strict", "none"} | float | None) – Completeness rule used to decide whether an output period has enough source observations to be calculated. None selects the ECA&D ATBD profile automatically: at least 350 daily values for a year, 175 for a half-year, 85 for a three-month season, and 25 for a month. strict requires every expected value. wmo applies the aggregation-specific WMO-No. 1203 rules: the 11-day/5-consecutive-day monthly rule for means and counts, complete data for sums, and no completeness mask for simple extrema. Unclassified operations, unsupported period types, non-daily WMO inputs, and spatially varying seasons safely fall back to strict. none always computes from available values, and a fraction in (0, 1] sets a configurable minimum valid fraction. Do not combine this parameter with the legacy allow_missing_periods parameter.

  • allow_missing_periods (bool | None) – Compatibility parameter for 7.2 workflows. An explicit False selects strict completeness, while True computes from available source values. None delegates to completeness and therefore uses ECA&D by default. When neither parameter is explicit, icclim warns if an irregular source time coordinate is detected or an already-eager mask shows an incomplete period. Lazy inputs are not evaluated solely to emit a warning.

  • allow_partial_final_period (bool) – When True, incomplete historical output periods are still masked, but the final output period is allowed to be computed from available source timesteps. This is useful for an ongoing month or year at the end of a time series. Ignored when allow_missing_periods=True.

Notes

This function has been auto-generated.

icclim._generated._generic.minimum(in_files: InFileLike, var_name: str | Sequence[str] | None = None, slice_mode: FrequencyLike | Frequency = 'year', time_range: Sequence[dt.datetime | str] | None = None, out_file: str | None = None, threshold: str | Threshold | Sequence[str | Threshold] | None = None, bootstrap: bool | None = None, ignore_Feb29th: bool = False, out_unit: str | None = None, netcdf_version: str | NetcdfVersion = 'NETCDF4', save_thresholds: bool = False, logs_verbosity: Verbosity | str = 'LOW', date_event: bool = False, run_index: str | None = 'first', allow_partial_seasons: bool | Literal['start', 'end'] | None = None, completeness: CompletenessLike = None, allow_missing_periods: bool | None = None, allow_partial_final_period: bool = False) → Dataset[source]#

Minimum of values that met threshold(s), if threshold(s) are given (e.g. Txn, Tnn).

minimum: Minimum of values that met threshold(s), if threshold(s) are given (e.g. Txn, Tnn).

Parameters:
  • in_files (str | list[str] | Dataset | DataArray | InputDictionary) – Absolute path(s) to NetCDF dataset(s), including OPeNDAP URLs, or path to zarr store, or xarray.Dataset or xarray.DataArray.

  • var_name (str | list[str] | None) – optional Target variable name to process corresponding to in_files. If None (default) on ECA&D index, the variable is guessed based on the climate index wanted. Mandatory for the deprecated user_index bridge.

  • slice_mode (FrequencyLike | Frequency) – Type of temporal aggregation: The possible values are {"year", "month", "DJF", "MAM", "JJA", "SON", "ONDJFM" or "AMJJAS", ("season", [1,2,3]), ("month", [1,2,3,])} (where season and month lists can be customized) or any valid pandas frequency. A season can also be defined between two exact dates: ("season", ("19 july", "14 august")). Spatially varying seasons can be defined by providing a tuple of two xarray.DataArray objects (start day-of-year and end day-of-year): (start_da, end_da). Default is “year”. See slice_mode for details.

  • time_range (list[datetime.datetime ] | list[str] | tuple[str, str] | None) – optional Temporal range: upper and lower bounds for temporal subsetting. If None, whole period of input files will be processed. The dates can either be given as instance of datetime.datetime or as string values. For strings, many format are accepted. Default is None.

  • out_file (str | None) – Output NetCDF file name (default: “icclim_out.nc” in the current directory). Default is “icclim_out.nc”. If the input in_files is a Dataset, out_file field is ignored. Use the function returned value instead to retrieve the computed value. If out_file already exists, icclim will overwrite it!

  • threshold (float | list[float] | None) – optional User defined threshold for certain indices. Default depend on the index, see their individual definition. When a list of threshold is provided, the index will be computed for each thresholds.

  • bootstrap (bool | None) – optional Override bootstrap behavior for day-of-year percentile thresholds. Use None (default) to rely on icclim’s overlap-based bootstrap logic, False to disable bootstrap, or True to force it when supported by the threshold type. For dask-backed percentile count indices, icclim automatically uses bounded spatial tiles so users do not have to find a working dask chunking strategy by trial and error. The safe path derives its spatial tile size from ICCLIM_BOOTSTRAP_SAFE_TILE_MEMORY (default: 2GB), unless ICCLIM_BOOTSTRAP_SAFE_TILE_CELLS is set as an expert override. Set ICCLIM_BOOTSTRAP_MODE=default only for diagnostics to keep the reference bootstrap dask graph path. bootstrap=False should only be used as an explicit user shortcut for fast exploratory assessments, because disabling bootstrap removes the overlap correction and can bias percentile-based results.

  • run_index (str | None) – optional The index to use for the run length encoding (e.g. “first”, “last”, “mid”). Default is “first”. Ignored for non spell indices.

  • ignore_Feb29th (bool) – optional Ignoring or not February 29th (default: False).

  • out_unit (str | None) – optional Output unit for certain indices: “days” or “%” (default: “days”).

  • netcdf_version (str | NetcdfVersion) – optional NetCDF version to create (default: “NETCDF3_CLASSIC”).

  • save_thresholds (bool) – optional True if the thresholds should be saved within the resulting netcdf file (default: False).

  • date_event (bool) – When True the date of the event (such as when a maximum is reached) will be stored in coordinates variables. warning This option may significantly slow down computation.

  • logs_verbosity (str | Verbosity) – optional Configure how verbose icclim is. Possible values: {"LOW", "HIGH", "SILENT"} (default: “LOW”)

  • allow_partial_seasons (bool | "start" | "end") – Flag indicating whether to allow partial seasons to be included in the index calculation. - True: Unmasks both the first and last periods. - False: Masks any incomplete periods (standard behavior). - “start”: Unmasks only the first period. - “end”: Unmasks only the last period. Default is False.

  • completeness ({"ecad", "wmo", "strict", "none"} | float | None) – Completeness rule used to decide whether an output period has enough source observations to be calculated. None selects the ECA&D ATBD profile automatically: at least 350 daily values for a year, 175 for a half-year, 85 for a three-month season, and 25 for a month. strict requires every expected value. wmo applies the aggregation-specific WMO-No. 1203 rules: the 11-day/5-consecutive-day monthly rule for means and counts, complete data for sums, and no completeness mask for simple extrema. Unclassified operations, unsupported period types, non-daily WMO inputs, and spatially varying seasons safely fall back to strict. none always computes from available values, and a fraction in (0, 1] sets a configurable minimum valid fraction. Do not combine this parameter with the legacy allow_missing_periods parameter.

  • allow_missing_periods (bool | None) – Compatibility parameter for 7.2 workflows. An explicit False selects strict completeness, while True computes from available source values. None delegates to completeness and therefore uses ECA&D by default. When neither parameter is explicit, icclim warns if an irregular source time coordinate is detected or an already-eager mask shows an incomplete period. Lazy inputs are not evaluated solely to emit a warning.

  • allow_partial_final_period (bool) – When True, incomplete historical output periods are still masked, but the final output period is allowed to be computed from available source timesteps. This is useful for an ongoing month or year at the end of a time series. Ignored when allow_missing_periods=True.

Notes

This function has been auto-generated.

icclim._generated._generic.percentile(in_files: InFileLike, var_name: str | Sequence[str] | None = None, slice_mode: FrequencyLike | Frequency = 'year', time_range: Sequence[dt.datetime | str] | None = None, out_file: str | None = None, threshold: str | Threshold | Sequence[str | Threshold] | None = None, bootstrap: bool | None = None, ignore_Feb29th: bool = False, out_unit: str | None = None, netcdf_version: str | NetcdfVersion = 'NETCDF4', save_thresholds: bool = False, logs_verbosity: Verbosity | str = 'LOW', date_event: bool = False, run_index: str | None = 'first', allow_partial_seasons: bool | Literal['start', 'end'] | None = None, completeness: CompletenessLike = None, allow_missing_periods: bool | None = None, allow_partial_final_period: bool = False) → Dataset[source]#

Percentile of a variable.

percentile: Percentile of a variable.

Parameters:
  • in_files (str | list[str] | Dataset | DataArray | InputDictionary) – Absolute path(s) to NetCDF dataset(s), including OPeNDAP URLs, or path to zarr store, or xarray.Dataset or xarray.DataArray.

  • var_name (str | list[str] | None) – optional Target variable name to process corresponding to in_files. If None (default) on ECA&D index, the variable is guessed based on the climate index wanted. Mandatory for the deprecated user_index bridge.

  • slice_mode (FrequencyLike | Frequency) – Type of temporal aggregation: The possible values are {"year", "month", "DJF", "MAM", "JJA", "SON", "ONDJFM" or "AMJJAS", ("season", [1,2,3]), ("month", [1,2,3,])} (where season and month lists can be customized) or any valid pandas frequency. A season can also be defined between two exact dates: ("season", ("19 july", "14 august")). Spatially varying seasons can be defined by providing a tuple of two xarray.DataArray objects (start day-of-year and end day-of-year): (start_da, end_da). Default is “year”. See slice_mode for details.

  • time_range (list[datetime.datetime ] | list[str] | tuple[str, str] | None) – optional Temporal range: upper and lower bounds for temporal subsetting. If None, whole period of input files will be processed. The dates can either be given as instance of datetime.datetime or as string values. For strings, many format are accepted. Default is None.

  • out_file (str | None) – Output NetCDF file name (default: “icclim_out.nc” in the current directory). Default is “icclim_out.nc”. If the input in_files is a Dataset, out_file field is ignored. Use the function returned value instead to retrieve the computed value. If out_file already exists, icclim will overwrite it!

  • threshold (float | list[float] | None) – optional User defined threshold for certain indices. Default depend on the index, see their individual definition. When a list of threshold is provided, the index will be computed for each thresholds.

  • bootstrap (bool | None) – optional Override bootstrap behavior for day-of-year percentile thresholds. Use None (default) to rely on icclim’s overlap-based bootstrap logic, False to disable bootstrap, or True to force it when supported by the threshold type. For dask-backed percentile count indices, icclim automatically uses bounded spatial tiles so users do not have to find a working dask chunking strategy by trial and error. The safe path derives its spatial tile size from ICCLIM_BOOTSTRAP_SAFE_TILE_MEMORY (default: 2GB), unless ICCLIM_BOOTSTRAP_SAFE_TILE_CELLS is set as an expert override. Set ICCLIM_BOOTSTRAP_MODE=default only for diagnostics to keep the reference bootstrap dask graph path. bootstrap=False should only be used as an explicit user shortcut for fast exploratory assessments, because disabling bootstrap removes the overlap correction and can bias percentile-based results.

  • run_index (str | None) – optional The index to use for the run length encoding (e.g. “first”, “last”, “mid”). Default is “first”. Ignored for non spell indices.

  • ignore_Feb29th (bool) – optional Ignoring or not February 29th (default: False).

  • out_unit (str | None) – optional Output unit for certain indices: “days” or “%” (default: “days”).

  • netcdf_version (str | NetcdfVersion) – optional NetCDF version to create (default: “NETCDF3_CLASSIC”).

  • save_thresholds (bool) – optional True if the thresholds should be saved within the resulting netcdf file (default: False).

  • date_event (bool) – When True the date of the event (such as when a maximum is reached) will be stored in coordinates variables. warning This option may significantly slow down computation.

  • logs_verbosity (str | Verbosity) – optional Configure how verbose icclim is. Possible values: {"LOW", "HIGH", "SILENT"} (default: “LOW”)

  • allow_partial_seasons (bool | "start" | "end") – Flag indicating whether to allow partial seasons to be included in the index calculation. - True: Unmasks both the first and last periods. - False: Masks any incomplete periods (standard behavior). - “start”: Unmasks only the first period. - “end”: Unmasks only the last period. Default is False.

  • completeness ({"ecad", "wmo", "strict", "none"} | float | None) – Completeness rule used to decide whether an output period has enough source observations to be calculated. None selects the ECA&D ATBD profile automatically: at least 350 daily values for a year, 175 for a half-year, 85 for a three-month season, and 25 for a month. strict requires every expected value. wmo applies the aggregation-specific WMO-No. 1203 rules: the 11-day/5-consecutive-day monthly rule for means and counts, complete data for sums, and no completeness mask for simple extrema. Unclassified operations, unsupported period types, non-daily WMO inputs, and spatially varying seasons safely fall back to strict. none always computes from available values, and a fraction in (0, 1] sets a configurable minimum valid fraction. Do not combine this parameter with the legacy allow_missing_periods parameter.

  • allow_missing_periods (bool | None) – Compatibility parameter for 7.2 workflows. An explicit False selects strict completeness, while True computes from available source values. None delegates to completeness and therefore uses ECA&D by default. When neither parameter is explicit, icclim warns if an irregular source time coordinate is detected or an already-eager mask shows an incomplete period. Lazy inputs are not evaluated solely to emit a warning.

  • allow_partial_final_period (bool) – When True, incomplete historical output periods are still masked, but the final output period is allowed to be computed from available source timesteps. This is useful for an ongoing month or year at the end of a time series. Ignored when allow_missing_periods=True.

Notes

This function has been auto-generated.

icclim._generated._generic.standard_deviation(in_files: InFileLike, var_name: str | Sequence[str] | None = None, slice_mode: FrequencyLike | Frequency = 'year', time_range: Sequence[dt.datetime | str] | None = None, out_file: str | None = None, threshold: str | Threshold | Sequence[str | Threshold] | None = None, bootstrap: bool | None = None, ignore_Feb29th: bool = False, out_unit: str | None = None, netcdf_version: str | NetcdfVersion = 'NETCDF4', save_thresholds: bool = False, logs_verbosity: Verbosity | str = 'LOW', date_event: bool = False, run_index: str | None = 'first', allow_partial_seasons: bool | Literal['start', 'end'] | None = None, completeness: CompletenessLike = None, allow_missing_periods: bool | None = None, allow_partial_final_period: bool = False) → Dataset[source]#

Standard deviation of values that met threshold(s), if threshold(s) are given.

standard_deviation: Standard deviation of values that met threshold(s), if threshold(s) are given.

Parameters:
  • in_files (str | list[str] | Dataset | DataArray | InputDictionary) – Absolute path(s) to NetCDF dataset(s), including OPeNDAP URLs, or path to zarr store, or xarray.Dataset or xarray.DataArray.

  • var_name (str | list[str] | None) – optional Target variable name to process corresponding to in_files. If None (default) on ECA&D index, the variable is guessed based on the climate index wanted. Mandatory for the deprecated user_index bridge.

  • slice_mode (FrequencyLike | Frequency) – Type of temporal aggregation: The possible values are {"year", "month", "DJF", "MAM", "JJA", "SON", "ONDJFM" or "AMJJAS", ("season", [1,2,3]), ("month", [1,2,3,])} (where season and month lists can be customized) or any valid pandas frequency. A season can also be defined between two exact dates: ("season", ("19 july", "14 august")). Spatially varying seasons can be defined by providing a tuple of two xarray.DataArray objects (start day-of-year and end day-of-year): (start_da, end_da). Default is “year”. See slice_mode for details.

  • time_range (list[datetime.datetime ] | list[str] | tuple[str, str] | None) – optional Temporal range: upper and lower bounds for temporal subsetting. If None, whole period of input files will be processed. The dates can either be given as instance of datetime.datetime or as string values. For strings, many format are accepted. Default is None.

  • out_file (str | None) – Output NetCDF file name (default: “icclim_out.nc” in the current directory). Default is “icclim_out.nc”. If the input in_files is a Dataset, out_file field is ignored. Use the function returned value instead to retrieve the computed value. If out_file already exists, icclim will overwrite it!

  • threshold (float | list[float] | None) – optional User defined threshold for certain indices. Default depend on the index, see their individual definition. When a list of threshold is provided, the index will be computed for each thresholds.

  • bootstrap (bool | None) – optional Override bootstrap behavior for day-of-year percentile thresholds. Use None (default) to rely on icclim’s overlap-based bootstrap logic, False to disable bootstrap, or True to force it when supported by the threshold type. For dask-backed percentile count indices, icclim automatically uses bounded spatial tiles so users do not have to find a working dask chunking strategy by trial and error. The safe path derives its spatial tile size from ICCLIM_BOOTSTRAP_SAFE_TILE_MEMORY (default: 2GB), unless ICCLIM_BOOTSTRAP_SAFE_TILE_CELLS is set as an expert override. Set ICCLIM_BOOTSTRAP_MODE=default only for diagnostics to keep the reference bootstrap dask graph path. bootstrap=False should only be used as an explicit user shortcut for fast exploratory assessments, because disabling bootstrap removes the overlap correction and can bias percentile-based results.

  • run_index (str | None) – optional The index to use for the run length encoding (e.g. “first”, “last”, “mid”). Default is “first”. Ignored for non spell indices.

  • ignore_Feb29th (bool) – optional Ignoring or not February 29th (default: False).

  • out_unit (str | None) – optional Output unit for certain indices: “days” or “%” (default: “days”).

  • netcdf_version (str | NetcdfVersion) – optional NetCDF version to create (default: “NETCDF3_CLASSIC”).

  • save_thresholds (bool) – optional True if the thresholds should be saved within the resulting netcdf file (default: False).

  • date_event (bool) – When True the date of the event (such as when a maximum is reached) will be stored in coordinates variables. warning This option may significantly slow down computation.

  • logs_verbosity (str | Verbosity) – optional Configure how verbose icclim is. Possible values: {"LOW", "HIGH", "SILENT"} (default: “LOW”)

  • allow_partial_seasons (bool | "start" | "end") – Flag indicating whether to allow partial seasons to be included in the index calculation. - True: Unmasks both the first and last periods. - False: Masks any incomplete periods (standard behavior). - “start”: Unmasks only the first period. - “end”: Unmasks only the last period. Default is False.

  • completeness ({"ecad", "wmo", "strict", "none"} | float | None) – Completeness rule used to decide whether an output period has enough source observations to be calculated. None selects the ECA&D ATBD profile automatically: at least 350 daily values for a year, 175 for a half-year, 85 for a three-month season, and 25 for a month. strict requires every expected value. wmo applies the aggregation-specific WMO-No. 1203 rules: the 11-day/5-consecutive-day monthly rule for means and counts, complete data for sums, and no completeness mask for simple extrema. Unclassified operations, unsupported period types, non-daily WMO inputs, and spatially varying seasons safely fall back to strict. none always computes from available values, and a fraction in (0, 1] sets a configurable minimum valid fraction. Do not combine this parameter with the legacy allow_missing_periods parameter.

  • allow_missing_periods (bool | None) – Compatibility parameter for 7.2 workflows. An explicit False selects strict completeness, while True computes from available source values. None delegates to completeness and therefore uses ECA&D by default. When neither parameter is explicit, icclim warns if an irregular source time coordinate is detected or an already-eager mask shows an incomplete period. Lazy inputs are not evaluated solely to emit a warning.

  • allow_partial_final_period (bool) – When True, incomplete historical output periods are still masked, but the final output period is allowed to be computed from available source timesteps. This is useful for an ongoing month or year at the end of a time series. Ignored when allow_missing_periods=True.

Notes

This function has been auto-generated.

icclim._generated._generic.sum(in_files: InFileLike, var_name: str | Sequence[str] | None = None, slice_mode: FrequencyLike | Frequency = 'year', time_range: Sequence[dt.datetime | str] | None = None, out_file: str | None = None, threshold: str | Threshold | Sequence[str | Threshold] | None = None, bootstrap: bool | None = None, ignore_Feb29th: bool = False, out_unit: str | None = None, netcdf_version: str | NetcdfVersion = 'NETCDF4', save_thresholds: bool = False, logs_verbosity: Verbosity | str = 'LOW', date_event: bool = False, run_index: str | None = 'first', allow_partial_seasons: bool | Literal['start', 'end'] | None = None, completeness: CompletenessLike = None, allow_missing_periods: bool | None = None, allow_partial_final_period: bool = False) → Dataset[source]#

Sum of values that met threshold(s), if threshold(s) are given (e.g. PRCPTOT, RR).

sum: Sum of values that met threshold(s), if threshold(s) are given (e.g. PRCPTOT, RR).

Parameters:
  • in_files (str | list[str] | Dataset | DataArray | InputDictionary) – Absolute path(s) to NetCDF dataset(s), including OPeNDAP URLs, or path to zarr store, or xarray.Dataset or xarray.DataArray.

  • var_name (str | list[str] | None) – optional Target variable name to process corresponding to in_files. If None (default) on ECA&D index, the variable is guessed based on the climate index wanted. Mandatory for the deprecated user_index bridge.

  • slice_mode (FrequencyLike | Frequency) – Type of temporal aggregation: The possible values are {"year", "month", "DJF", "MAM", "JJA", "SON", "ONDJFM" or "AMJJAS", ("season", [1,2,3]), ("month", [1,2,3,])} (where season and month lists can be customized) or any valid pandas frequency. A season can also be defined between two exact dates: ("season", ("19 july", "14 august")). Spatially varying seasons can be defined by providing a tuple of two xarray.DataArray objects (start day-of-year and end day-of-year): (start_da, end_da). Default is “year”. See slice_mode for details.

  • time_range (list[datetime.datetime ] | list[str] | tuple[str, str] | None) – optional Temporal range: upper and lower bounds for temporal subsetting. If None, whole period of input files will be processed. The dates can either be given as instance of datetime.datetime or as string values. For strings, many format are accepted. Default is None.

  • out_file (str | None) – Output NetCDF file name (default: “icclim_out.nc” in the current directory). Default is “icclim_out.nc”. If the input in_files is a Dataset, out_file field is ignored. Use the function returned value instead to retrieve the computed value. If out_file already exists, icclim will overwrite it!

  • threshold (float | list[float] | None) – optional User defined threshold for certain indices. Default depend on the index, see their individual definition. When a list of threshold is provided, the index will be computed for each thresholds.

  • bootstrap (bool | None) – optional Override bootstrap behavior for day-of-year percentile thresholds. Use None (default) to rely on icclim’s overlap-based bootstrap logic, False to disable bootstrap, or True to force it when supported by the threshold type. For dask-backed percentile count indices, icclim automatically uses bounded spatial tiles so users do not have to find a working dask chunking strategy by trial and error. The safe path derives its spatial tile size from ICCLIM_BOOTSTRAP_SAFE_TILE_MEMORY (default: 2GB), unless ICCLIM_BOOTSTRAP_SAFE_TILE_CELLS is set as an expert override. Set ICCLIM_BOOTSTRAP_MODE=default only for diagnostics to keep the reference bootstrap dask graph path. bootstrap=False should only be used as an explicit user shortcut for fast exploratory assessments, because disabling bootstrap removes the overlap correction and can bias percentile-based results.

  • run_index (str | None) – optional The index to use for the run length encoding (e.g. “first”, “last”, “mid”). Default is “first”. Ignored for non spell indices.

  • ignore_Feb29th (bool) – optional Ignoring or not February 29th (default: False).

  • out_unit (str | None) – optional Output unit for certain indices: “days” or “%” (default: “days”).

  • netcdf_version (str | NetcdfVersion) – optional NetCDF version to create (default: “NETCDF3_CLASSIC”).

  • save_thresholds (bool) – optional True if the thresholds should be saved within the resulting netcdf file (default: False).

  • date_event (bool) – When True the date of the event (such as when a maximum is reached) will be stored in coordinates variables. warning This option may significantly slow down computation.

  • logs_verbosity (str | Verbosity) – optional Configure how verbose icclim is. Possible values: {"LOW", "HIGH", "SILENT"} (default: “LOW”)

  • allow_partial_seasons (bool | "start" | "end") – Flag indicating whether to allow partial seasons to be included in the index calculation. - True: Unmasks both the first and last periods. - False: Masks any incomplete periods (standard behavior). - “start”: Unmasks only the first period. - “end”: Unmasks only the last period. Default is False.

  • completeness ({"ecad", "wmo", "strict", "none"} | float | None) – Completeness rule used to decide whether an output period has enough source observations to be calculated. None selects the ECA&D ATBD profile automatically: at least 350 daily values for a year, 175 for a half-year, 85 for a three-month season, and 25 for a month. strict requires every expected value. wmo applies the aggregation-specific WMO-No. 1203 rules: the 11-day/5-consecutive-day monthly rule for means and counts, complete data for sums, and no completeness mask for simple extrema. Unclassified operations, unsupported period types, non-daily WMO inputs, and spatially varying seasons safely fall back to strict. none always computes from available values, and a fraction in (0, 1] sets a configurable minimum valid fraction. Do not combine this parameter with the legacy allow_missing_periods parameter.

  • allow_missing_periods (bool | None) – Compatibility parameter for 7.2 workflows. An explicit False selects strict completeness, while True computes from available source values. None delegates to completeness and therefore uses ECA&D by default. When neither parameter is explicit, icclim warns if an irregular source time coordinate is detected or an already-eager mask shows an incomplete period. Lazy inputs are not evaluated solely to emit a warning.

  • allow_partial_final_period (bool) – When True, incomplete historical output periods are still masked, but the final output period is allowed to be computed from available source timesteps. This is useful for an ongoing month or year at the end of a time series. Ignored when allow_missing_periods=True.

Notes

This function has been auto-generated.

icclim._generated._generic.sum_of_spell_lengths(in_files: InFileLike, var_name: str | Sequence[str] | None = None, slice_mode: FrequencyLike | Frequency = 'year', time_range: Sequence[dt.datetime | str] | None = None, out_file: str | None = None, threshold: str | Threshold | Sequence[str | Threshold] | None = None, bootstrap: bool | None = None, ignore_Feb29th: bool = False, out_unit: str | None = None, netcdf_version: str | NetcdfVersion = 'NETCDF4', save_thresholds: bool = False, logs_verbosity: Verbosity | str = 'LOW', date_event: bool = False, min_spell_length: int | None = 6, run_index: str | None = 'first', allow_partial_seasons: bool | Literal['start', 'end'] | None = None, completeness: CompletenessLike = None, allow_missing_periods: bool | None = None, allow_partial_final_period: bool = False) → Dataset[source]#

Sum the lengths of each consecutive occurrence spell when threshold(s) are met. The minimum spell length is controlled by min_spell_length (e.g. WSDI, CSDI).

sum_of_spell_lengths: Sum the lengths of each consecutive occurrence spell when threshold(s) are met. The minimum spell length is controlled by min_spell_length (e.g. WSDI, CSDI).

Parameters:
  • in_files (str | list[str] | Dataset | DataArray | InputDictionary) – Absolute path(s) to NetCDF dataset(s), including OPeNDAP URLs, or path to zarr store, or xarray.Dataset or xarray.DataArray.

  • var_name (str | list[str] | None) – optional Target variable name to process corresponding to in_files. If None (default) on ECA&D index, the variable is guessed based on the climate index wanted. Mandatory for the deprecated user_index bridge.

  • slice_mode (FrequencyLike | Frequency) – Type of temporal aggregation: The possible values are {"year", "month", "DJF", "MAM", "JJA", "SON", "ONDJFM" or "AMJJAS", ("season", [1,2,3]), ("month", [1,2,3,])} (where season and month lists can be customized) or any valid pandas frequency. A season can also be defined between two exact dates: ("season", ("19 july", "14 august")). Spatially varying seasons can be defined by providing a tuple of two xarray.DataArray objects (start day-of-year and end day-of-year): (start_da, end_da). Default is “year”. See slice_mode for details.

  • time_range (list[datetime.datetime ] | list[str] | tuple[str, str] | None) – optional Temporal range: upper and lower bounds for temporal subsetting. If None, whole period of input files will be processed. The dates can either be given as instance of datetime.datetime or as string values. For strings, many format are accepted. Default is None.

  • out_file (str | None) – Output NetCDF file name (default: “icclim_out.nc” in the current directory). Default is “icclim_out.nc”. If the input in_files is a Dataset, out_file field is ignored. Use the function returned value instead to retrieve the computed value. If out_file already exists, icclim will overwrite it!

  • threshold (float | list[float] | None) – optional User defined threshold for certain indices. Default depend on the index, see their individual definition. When a list of threshold is provided, the index will be computed for each thresholds.

  • bootstrap (bool | None) – optional Override bootstrap behavior for day-of-year percentile thresholds. Use None (default) to rely on icclim’s overlap-based bootstrap logic, False to disable bootstrap, or True to force it when supported by the threshold type. For dask-backed percentile count indices, icclim automatically uses bounded spatial tiles so users do not have to find a working dask chunking strategy by trial and error. The safe path derives its spatial tile size from ICCLIM_BOOTSTRAP_SAFE_TILE_MEMORY (default: 2GB), unless ICCLIM_BOOTSTRAP_SAFE_TILE_CELLS is set as an expert override. Set ICCLIM_BOOTSTRAP_MODE=default only for diagnostics to keep the reference bootstrap dask graph path. bootstrap=False should only be used as an explicit user shortcut for fast exploratory assessments, because disabling bootstrap removes the overlap correction and can bias percentile-based results.

  • min_spell_length (int) – optional Minimum spell duration to be taken into account when computing the sum_of_spell_lengths.

  • run_index (str | None) – optional The index to use for the run length encoding (e.g. “first”, “last”, “mid”). Default is “first”. Ignored for non spell indices.

  • ignore_Feb29th (bool) – optional Ignoring or not February 29th (default: False).

  • out_unit (str | None) – optional Output unit for certain indices: “days” or “%” (default: “days”).

  • netcdf_version (str | NetcdfVersion) – optional NetCDF version to create (default: “NETCDF3_CLASSIC”).

  • save_thresholds (bool) – optional True if the thresholds should be saved within the resulting netcdf file (default: False).

  • date_event (bool) – When True the date of the event (such as when a maximum is reached) will be stored in coordinates variables. warning This option may significantly slow down computation.

  • logs_verbosity (str | Verbosity) – optional Configure how verbose icclim is. Possible values: {"LOW", "HIGH", "SILENT"} (default: “LOW”)

  • allow_partial_seasons (bool | "start" | "end") – Flag indicating whether to allow partial seasons to be included in the index calculation. - True: Unmasks both the first and last periods. - False: Masks any incomplete periods (standard behavior). - “start”: Unmasks only the first period. - “end”: Unmasks only the last period. Default is False.

  • completeness ({"ecad", "wmo", "strict", "none"} | float | None) – Completeness rule used to decide whether an output period has enough source observations to be calculated. None selects the ECA&D ATBD profile automatically: at least 350 daily values for a year, 175 for a half-year, 85 for a three-month season, and 25 for a month. strict requires every expected value. wmo applies the aggregation-specific WMO-No. 1203 rules: the 11-day/5-consecutive-day monthly rule for means and counts, complete data for sums, and no completeness mask for simple extrema. Unclassified operations, unsupported period types, non-daily WMO inputs, and spatially varying seasons safely fall back to strict. none always computes from available values, and a fraction in (0, 1] sets a configurable minimum valid fraction. Do not combine this parameter with the legacy allow_missing_periods parameter.

  • allow_missing_periods (bool | None) – Compatibility parameter for 7.2 workflows. An explicit False selects strict completeness, while True computes from available source values. None delegates to completeness and therefore uses ECA&D by default. When neither parameter is explicit, icclim warns if an irregular source time coordinate is detected or an already-eager mask shows an incomplete period. Lazy inputs are not evaluated solely to emit a warning.

  • allow_partial_final_period (bool) – When True, incomplete historical output periods are still masked, but the final output period is allowed to be computed from available source timesteps. This is useful for an ongoing month or year at the end of a time series. Ignored when allow_missing_periods=True.

Notes

This function has been auto-generated.