pcmdi_metrics.utils.custom_season_departure
- pcmdi_metrics.utils.custom_season_departure(ds, data_var, season, method='xcdat')[source]
Calculate the departure from a reference seasonal climatology for each season in a given year.
- Parameters:
ds (
xr.Dataset
) – Input xarray Datasetdata_var (
str
) – name of variable (dataArray)season (
str
) – A string representing a custom season (e.g., “MJJ”). Must consist of one or more month abbreviations.method (
str
, optional) – method for yearly average, by default “xcdat”, optional alternative is “xcdat”
- Returns:
xr.Dataset
– xarray Dataset that contains timeseries of seasonal mean departure for each year
Examples
>>> from pcmdi_metrics.utils import custom_season_departure