earthkit.climate.utils.percentile.calculate_percentile_doy¶
- earthkit.climate.utils.percentile.calculate_percentile_doy(reference_dataset: xarray.Dataset, variable: str, percentile: float, window: int = 5) xarray.Dataset¶
Calculate the daily percentile (doy) for a given variable in a reference dataset. Wraps xclim.core.calendar.percentile_doy.
- Parameters:
reference_dataset (
xr.Dataset) – The reference dataset containing the variable.variable (
str) – The name of the variable to calculate the percentile for.percentile (
float) – The percentile value (e.g., 90 for 90th percentile).window (
int, optional) – The window size for the rolling percentile calculation, by default 5.
- Returns:
A dataset containing the calculated percentile, renamed to ‘{variable}_per’.
- Return type:
xr.Dataset