With xarray-regrid it is possible to regrid between two rectilinear grids. The following methods are supported:
- Linear
- Nearest-neighbor
- Conservative
- Cubic
- "Most common value", as well as other zonal statistics (e.g., variance or median).
All regridding methods can operate lazily on Dask arrays.
Release 0.4.0 comes with the following changes and additions:
Changed:
- the "most common" routine has been overhauled, thanks to @dcherian. It is now much more efficient, and can operate fully lazily on dask arrays. Users do need to provide the expected groups (i.e., unique labels in the data), and the regridder is only available for
xr.DataArray
currently (#46). - you can now use
None
as input to thetime_dim
kwarg in the regridding methods to force regridding over the time dimension (as long as it's numeric) (#46). - Performance of the conservative method has been improved by simultaneously aggregating over all regridding dimensions. Conservative regridding now also produces outputs with the same grid chunks as the inputs, unless explicit chunksizes are passed via the
output_chunks
argument. (#51).
Added:
.regrid.stat
for reducing datasets using statistical methods such as the variance or median (#46).- a "least common" routine (i.e. anti-mode), which is the inverse of the most common value (#46).
- If latitude/longitude coordinates are detected and the domain is global, apply automatic padding at the boundaries, which gives behavior more consistent with common tools like ESMF and CDO (#45).
- Conservative regridding weights are converted to sparse matrices if the optional sparse package is installed, which improves compute and memory performance in most cases (#49).