- geocat.comp.climatologies._calculate_center_of_time_bounds(dset, time_dim, freq, calendar, start, end, keep_attrs=None)#
Helper function to determine the time bounds based on the given dataset and frequency and then calculate the averages of them.
Returns the dataset with the time coordinate changed to the center of the time bounds.
xarray.DataArray) – The data on which to operate. It must be uniformly spaced in the time dimension.
str) – Name of the time coordinate for xarray objects
str) – Alias for the frequency of the adjusted timestamps (i.e. daily, monthly)
str) – Alias for the calendar the time stamps are in (i.e. gregorian, no leap years)
cftime.datetime) – The starting date of the data. The string representation must be in ISO format
cftime.datetime) – The ending date of the data. The string representation must be in ISO format
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 data with adjusted time coordinate
See xarray.cftime_range for accepted values for freq and calendar.