earthkit.climate.atmos.precipitation.standardized_precipitation_evapotranspiration_index¶
- earthkit.climate.atmos.precipitation.standardized_precipitation_evapotranspiration_index(wb: xarray.DataArray | str = 'wb', ds: xarray.Dataset | Any = None, *, freq: str | None = 'MS', window: int = 1, dist: str | Any = 'gamma', method: str = 'ML', fitkwargs: dict | None = None, cal_start: str | None = None, cal_end: str | None = None, params: Any | None = None, **kwargs: Any) Any¶
Standardized precipitation evapotranspiration index (spei).
Water budget (precipitation - evapotranspiration) over a moving window, normalized such that the SPEI averages to 0 for the calibration data. The window unit X is the minimal time period defined by the resampling frequency.
Units:
spei: dimensionless
This function wraps xclim.indicators.atmos.standardized_precipitation_evapotranspiration_index.
- Parameters:
wb (
xarray.DataArray | str) – Daily water budget (pr - pet).freq (
str | None) – Resampling frequency. A monthly or daily frequency is expected. Option None assumes that the desired resampling has already been applied input dataset and will skip the resampling step.window (
int) – Averaging window length relative to the resampling frequency. For example, if freq=”MS”, i.e. a monthly resampling, the window is an integer number of months.dist (
str | Any) – Name of the univariate distribution, or a callable rv_continuous (seescipy.stats).method (
str) – Name of the fitting method, such as ML (maximum likelihood), APP (approximate). The approximate method uses a deterministic function that does not involve any optimization, which can be sensitive to noise. PWM should be used with a lmoments3 distribution.fitkwargs (
dict | None) – Kwargs passed toxclim.indices.stats.fitused to impose values of certains parameters (floc, fscale). If method is PWM, fitkwargs should be empty, except for floc with dist`=`gamma which is allowed.cal_start (
str | None) – Start date of the calibration period. A DateStr is expected, that is a str in format “YYYY-MM-DD”. Default option None means that the calibration period begins at the start of the input dataset.cal_end (
str | None) – End date of the calibration period. A DateStr is expected, that is a str in format “YYYY-MM-DD”. Default option None means that the calibration period finishes at the end of the input dataset.params (
Any | None) – Fit parameters. The params can be computed usingxclim.indices.stats.standardized_index_fit_paramsin advance. The output can be given here as input, and it overrides other options.ds (
xarray.Dataset | Any) – Input dataset.**kwargs (
Any) – Additional keyword arguments.
- Returns:
The computed index.
- Return type:
Any