geocat.comp.climatologies.calendar_average#

geocat.comp.climatologies.calendar_average(dset, freq, time_dim=None)#

This function divides the data into time periods (months, seasons, etc) and computes the average for the data in each one.

Parameters
  • dset (xarray.Dataset, xarray.DataArray) – The data on which to operate. It must be uniformly spaced in the time dimension.

  • freq (str) –

    Frequency alias. Accepted alias:

    • ‘hour’: for hourly averages

    • ‘day’: for daily averages

    • ‘month’: for monthly averages

    • ‘season’: for meteorological seasonal averages (DJF, MAM, JJA, and SON)

    • ‘year’: for yearly averages

  • time_dim (str, optional) – Name of the time coordinate for xarray objects. Defaults to None and infers the name from the data.

Returns

computed_dset (xarray.Dataset, xarray.DataArray) – The computed data with the same type as dset

Notes

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)

See also

Related GeoCAT Functions: climatology_average