Metadata-Version: 2.1
Name: xarray-regrid
Version: 0.1.0
Summary: Regridding tools using xarray and flox.
Project-URL: Documentation, https://github.com/EXCITED-CO2/xarray-regrid#readme
Project-URL: Issues, https://github.com/EXCITED-CO2/xarray-regrid/issues
Project-URL: Source, https://github.com/EXCITED-CO2/xarray-regrid
Author-email: Bart Schilperoort <b.schilperoort@esciencecenter.nl>
License-Expression: Apache-2.0
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Python: >=3.10
Requires-Dist: flox
Requires-Dist: numpy
Requires-Dist: scipy
Requires-Dist: xarray
Provides-Extra: benchmarking
Requires-Dist: dask[distributed]; extra == 'benchmarking'
Requires-Dist: matplotlib; extra == 'benchmarking'
Provides-Extra: dev
Requires-Dist: black[jupyter]; extra == 'dev'
Requires-Dist: bump2version; extra == 'dev'
Requires-Dist: hatch; extra == 'dev'
Requires-Dist: mypy; extra == 'dev'
Requires-Dist: pytest; extra == 'dev'
Requires-Dist: pytest-cov; extra == 'dev'
Requires-Dist: ruff; extra == 'dev'
Description-Content-Type: text/markdown

# xarray-regrid
Regridding utilities for xarray.

Note: currently only rectilinear grids are supported.

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.

## Installation

```console
pip install xarray-regrid
```

## Usage
The xarray-regrid routines are accessed using the "regrid" accessor on an xarray Dataset:
```py
import xarray_regrid

ds = xr.open_dataset("input_data.nc")
ds_grid = xr.open_dataset("target_grid.nc")

ds.regrid.regrid(ds_grid, method="linear")
```
Currently implemented are the methods linear, nearest and cubic.

For examples, see the benchmark notebooks.

## Benchmarks
The benchmark notebooks contain comparisons to more standard methods (CDO, xESMF).

To be able to run the notebooks, a conda environment is required (due to ESMF and CDO).
You can install this environment using the `environment.yml` file in this repository.
[Micromamba](https://mamba.readthedocs.io/en/latest/user_guide/micromamba.html) is a lightweight version of the much faster "mamba" conda alternative.

## Planned features
- Support conservative regridding
