Open
Description
Code Sample, a copy-pastable example if possible
import numpy as np
import xarray as xr
x = np.arange(1, 366)
y = np.random.randn(365)
ds = xr.DataArray(y, dims=dict(dayofyear=x))
ds.rolling(center=True, dayofyear=31).mean()
Problem description
rolling
cannot directly handle periodic boundary conditions (lon, dayofyear, ...), but could be very helpful to e.g. calculate climate indices. Also I cannot really think of an easy way to append the first elements to the end of the dataset and then calculate rolling.
Is there a way to do this? Should xarray support this feature?
This might also belong to SO...