Science Score: 67.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 3 DOI reference(s) in README -
✓Academic publication links
Links to: zenodo.org -
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (14.2%) to scientific vocabulary
Repository
Regridding utility for xarray
Basic Info
- Host: GitHub
- Owner: xarray-contrib
- License: apache-2.0
- Language: Python
- Default Branch: main
- Homepage: https://xarray-regrid.readthedocs.org/
- Size: 76.7 MB
Statistics
- Stars: 89
- Watchers: 7
- Forks: 8
- Open Issues: 8
- Releases: 8
Metadata Files
README.md
xarray-regrid: Regridding utilities for xarray.

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.
Note that "Most common value" is designed to regrid categorical data to a coarse resolution. For regridding categorical data to a finer resolution, please use "nearest-neighbor" regridder.
Why xarray-regrid?
Regridding is a common operation in earth science and other fields. While xarray does have some interpolation methods available, these are not always straightforward to use. Additionally, methods such as conservative regridding, or taking the most common value, are not available in xarray.
Installation
For a minimal install:
console
pip install xarray-regrid
Note: xarray-regrid is also available on conda-forge.
To improve performance in certain cases:
console
pip install xarray-regrid[accel]
which includes optional extras such as:
- dask: parallelization over chunked data
- sparse: for performing conservative regridding using sparse weight matrices
- opt-einsum: optimized einsum routines used in conservative regridding
Benchmarking varies across different hardware specifications, but the inclusion of these extras can often provide significant speedups.
Usage
The xarray-regrid routines are accessed using the "regrid" accessor on an xarray Dataset: ```py import xarray_regrid
ds = xr.opendataset("inputdata.nc") dsgrid = xr.opendataset("target_grid.nc")
ds.regrid.linear(ds_grid) ```
For examples, see the benchmark notebooks and the demo 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 is a lightweight version of the much faster "mamba" conda alternative.
sh
micromamba create -n environment_name -f environment.yml
Acknowledgements
This package was developed under Netherlands eScience Center grant NLESC.OEC.2022.017.
Owner
- Name: xarray-contrib
- Login: xarray-contrib
- Kind: organization
- Website: https://xarray.dev
- Twitter: xarray_dev
- Repositories: 23
- Profile: https://github.com/xarray-contrib
xarray compatible projects
Citation (CITATION.cff)
cff-version: 1.2.0
title: xarray-regrid
message: >-
If you use this software, please cite it using the
metadata from this file.
type: software
authors:
- given-names: Bart
family-names: Schilperoort
email: b.schilperoort@esciencecenter.nl
affiliation: Netherlands eScience Center
orcid: 'https://orcid.org/0000-0003-4487-9822'
- given-names: Yang
family-names: Liu
orcid: 'https://orcid.org/0000-0002-1966-8460'
affiliation: Netherlands eScience Center
- given-names: Keith
family-names: Doore
orcid: 'https://orcid.org/0000-0001-5035-4016'
affiliation: United States Geological Survey
- given-names: Sam
family-names: Levang
affiliation: Salient Predictions
- given-names: Ben
family-names: Mares
orcid: 'https://orcid.org/0000-0002-1036-0793'
affiliation: Tensorial (EI Bernard Mares)
email: services-xarray-regrid@tensorial.com
repository-code: 'https://github.com/EXCITED-CO2/xarray-regrid'
keywords:
- xarray
- geospatial
- regridding
- conservative regridding
license: Apache-2.0
abstract: >
xarray-regrid can regrid (geospatial) data to a new
coordinate system.
Features:
- Linear, nearest-neighbor, cubic, conservative regridding
methods.
- Fully implemented in Python, no conda or binaries
required.
- Both lazy and parallelized computation with Dask,.
- Benchmarks to validate the results against standard
methods are available.
GitHub Events
Total
- Create event: 5
- Release event: 1
- Issues event: 8
- Watch event: 23
- Delete event: 3
- Issue comment event: 5
- Push event: 10
- Pull request review event: 7
- Pull request event: 10
- Fork event: 2
Last Year
- Create event: 5
- Release event: 1
- Issues event: 8
- Watch event: 23
- Delete event: 3
- Issue comment event: 5
- Push event: 10
- Pull request review event: 7
- Pull request event: 10
- Fork event: 2
Committers
Last synced: 10 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Bart Schilperoort | b****t@e****l | 50 |
| Sam Levang | s****g@s****m | 11 |
| Keith Doore | 5****e | 2 |
| Ben Mares | s****1@t****m | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 9 months ago
All Time
- Total issues: 35
- Total pull requests: 25
- Average time to close issues: 4 months
- Average time to close pull requests: 7 days
- Total issue authors: 8
- Total pull request authors: 4
- Average comments per issue: 1.43
- Average comments per pull request: 1.68
- Merged pull requests: 24
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 8
- Pull requests: 13
- Average time to close issues: about 1 month
- Average time to close pull requests: 4 days
- Issue authors: 3
- Pull request authors: 3
- Average comments per issue: 3.0
- Average comments per pull request: 2.0
- Merged pull requests: 13
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- BSchilperoort (21)
- ClaireDons (1)
- TimBusker (1)
- maresb (1)
- SarahAlidoost (1)
- folmerkrikken (1)
Pull Request Authors
- BSchilperoort (21)
- slevang (8)
- kjdoore (2)
- maresb (2)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
- Total downloads: unknown
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 2
- Total maintainers: 1
spack.io: py-xarray-regrid
Regridding utility for xarray
- Homepage: https://github.com/xarray-contrib/xarray-regrid
- License: []
-
Latest release: 0.4.1
published 7 months ago
Rankings
Maintainers (1)
Dependencies
- actions/checkout v3 composite
- actions/setup-python v3 composite
- actions/checkout v3 composite
- actions/setup-python v3 composite
- actions/checkout v3 composite
- actions/setup-python v3 composite
- pypa/gh-action-pypi-publish 27b31702a0e7fc50959f5ad993c78deac1bdfc29 composite
- flox *
- numpy *
- scipy *
- xarray *
- cdo
- python 3.12
- xesmf