Skip to content

Commit 932f3b8

Browse files
committed
Update readme
1 parent 9c4417a commit 932f3b8

File tree

1 file changed

+28
-3
lines changed

1 file changed

+28
-3
lines changed

README.md

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,36 @@
11
# xarray-regrid
2-
Regridding utility for xarray.
2+
Regridding utilities for xarray.
3+
4+
Note: currently only rectilinear grids are supported.
5+
6+
For now xarray-regrid is mostly a wrapper around `ds.interp`, however, conservative regridding is not possible with `interp`, and will need a custom solution.
37

48
## Installation
59

610
```console
711
pip install xarray-regrid
812
```
913

10-
## Usage & benchmarks
11-
To see how to use xarray-regrid, see the benchmark notebooks. These also contain a comparison to more standard methods (CDO, xESMF).
14+
## Usage
15+
The xarray-regrid routines are accessed using the "regrid" accessor on an xarray Dataset:
16+
```py
17+
import xarray_regrid
18+
19+
ds = xr.open_dataset("input_data.nc")
20+
ds_grid = xr.open_dataset("target_grid.nc")
21+
22+
ds.regrid.regrid(ds_grid, method="linear")
23+
```
24+
Currently implemented are the methods linear, nearest and cubic.
25+
26+
For examples, see the benchmark notebooks.
27+
28+
## Benchmarks
29+
The benchmark notebooks contain comparisons to more standard methods (CDO, xESMF).
30+
31+
To be able to run the notebooks, a conda environment is required (due to ESMF and CDO).
32+
You can install this environment using the `environment.yml` file in this repository.
33+
[Micromamba](https://mamba.readthedocs.io/en/latest/user_guide/micromamba.html) is a lightweight version of the much faster "mamba" conda alternative.
34+
35+
## Planned features
36+
- Support conservative regridding

0 commit comments

Comments
 (0)