- geocat.comp.climatologies.climate_anomaly(dset, freq, time_dim=None, keep_attrs='default')#
This function calculates climate anomalies by subtracting the long term mean of each
freqperiod (day, month, season, or year) from each datapoint.
xarray.DataArray) – The data on which to operate. It must be uniformly spaced in the time dimension.
str) – Frequency alias. When the
'year'allias is used, the yearly average is subtracted from each data point. Multiyear climatologies are not yet possible with this function. Accepted aliases:
day: for anomalies from the daily climatology
month: for anomalies from the monthly climatology
season: for anomalies from the seasonal climatology (seasons are DJF, MAM, JJA, and SON)
year: for anomalies from the yearly average
str, optional) – Name of the time coordinate for
xarrayobjects. Defaults to
Noneand infers the name from the data.
bool, optional) – If True, attrs will be copied from the original object to the new one. If False, the new object will be returned without attributes. Defaults to None which means the attrs will only be kept in unambiguous circumstances.
xarray.DataArray) – The computed anomalies
Seasonal averages are weighted based on the number of days in each month. This means that the given data must be uniformly spaced (i.e. data every 6 hours, every two days, every month, etc.) and must not cross month boundaries (i.e. don’t use weekly averages where the week falls in two different months)
Related GeoCAT Functions:
Related NCL Functions: calcDayAnomTLL calcMonAnomLLLT calcMonAnomLLT calcMonAnomTLL