Closed
Description
It would be nice to have a generic .pad()
method to xarray objects based on numpy.pad and dask.array.pad.
In particular,pad
with mode='wrap'
could solve several use-cases related to periodic boundary conditions: #1005 , #2007. For example, ds.pad(longitude=(0, 1), mode='wrap')
to add an extra point with periodic boundary conditions along the longitude
dimension.
It probably makes sense to linearly extrapolate coordinates along padded dimensions, as long as they are regularly spaced. This might use heuristics and/or a keyword argument.
I don't have a plans to work on this in the near term. It could be a good project of moderate complexity for a new contributor.