Centers time coordinates using the midpoint between time bounds.

Time coordinates can be recorded using different intervals, including the beginning, middle, or end of the interval. Centering time coordinates, ensures calculations using these values are performed reliably regardless of the recorded interval.

This method attempts to get bounds for each time variable using the CF “bounds” attribute. Coordinate variables that cannot be mapped to bounds will be skipped.


dataset (xr.Dataset) – The Dataset with original time coordinates.


xr.Dataset – The Dataset with centered time coordinates.