{"id":26163873,"url":"https://github.com/xarray-contrib/xarray-regrid","last_synced_at":"2025-04-09T13:03:36.776Z","repository":{"id":186056170,"uuid":"674567999","full_name":"xarray-contrib/xarray-regrid","owner":"xarray-contrib","description":"Regridding utility for xarray","archived":false,"fork":false,"pushed_at":"2024-12-20T00:04:36.000Z","size":80371,"stargazers_count":80,"open_issues_count":10,"forks_count":8,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-04-02T11:50:00.274Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://xarray-regrid.readthedocs.org/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xarray-contrib.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-04T08:59:17.000Z","updated_at":"2025-03-06T08:13:51.000Z","dependencies_parsed_at":"2024-12-20T01:28:14.025Z","dependency_job_id":null,"html_url":"https://github.com/xarray-contrib/xarray-regrid","commit_stats":null,"previous_names":["excited-co2/xarray-regrid"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xarray-contrib%2Fxarray-regrid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xarray-contrib%2Fxarray-regrid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xarray-contrib%2Fxarray-regrid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xarray-contrib%2Fxarray-regrid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xarray-contrib","download_url":"https://codeload.github.com/xarray-contrib/xarray-regrid/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247896060,"owners_count":21014435,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-11T14:53:25.165Z","updated_at":"2025-04-09T13:03:36.757Z","avatar_url":"https://github.com/xarray-contrib.png","language":"Python","readme":"# xarray-regrid: Regridding utilities for xarray.\n\n\u003cimg align=\"right\" width=\"100\" alt=\"Logo\" src=\"./docs/assets/logo.png\"\u003e\n\n\nWith xarray-regrid it is possible to regrid between two rectilinear grids. The following methods are supported:\n - Linear\n - Nearest-neighbor\n - Conservative\n - Cubic\n - \"Most common value\", as well as other zonal statistics (e.g., variance or median).\n\nAll regridding methods can operate lazily on [Dask arrays](https://docs.xarray.dev/en/latest/user-guide/dask.html).\n\nNote 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.\n\n[![PyPI](https://img.shields.io/pypi/v/xarray-regrid.svg?style=flat)](https://pypi.python.org/pypi/xarray-regrid/)\n[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.10203304.svg)](https://doi.org/10.5281/zenodo.10203304)\n[![Docs](https://readthedocs.org/projects/xarray-regrid/badge/?version=latest\u0026style=flat)](https://xarray-regrid.readthedocs.org/)\n\n## Why xarray-regrid?\n\nRegridding 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.\n\n## Installation\n\nFor a minimal install:\n```console\npip install xarray-regrid\n```\n\nTo improve performance in certain cases:\n```console\npip install xarray-regrid[accel]\n```\n\nwhich includes optional extras such as:\n - `dask`: parallelization over chunked data\n - `sparse`: for performing conservative regridding using sparse weight matrices\n - `opt-einsum`: optimized einsum routines used in conservative regridding\n\n Benchmarking varies across different hardware specifications, but the inclusion of these extras can often provide significant speedups.\n\n## Usage\nThe xarray-regrid routines are accessed using the \"regrid\" accessor on an xarray Dataset:\n```py\nimport xarray_regrid\n\nds = xr.open_dataset(\"input_data.nc\")\nds_grid = xr.open_dataset(\"target_grid.nc\")\n\nds.regrid.linear(ds_grid)\n```\n\nFor examples, see the benchmark notebooks and the demo notebooks.\n\n## Benchmarks\nThe benchmark notebooks contain comparisons to more standard methods (CDO, xESMF).\n\nTo be able to run the notebooks, a conda environment is required (due to ESMF and CDO).\nYou can install this environment using the `environment.yml` file in this repository.\n[Micromamba](https://mamba.readthedocs.io/en/latest/user_guide/micromamba.html) is a lightweight version of the much faster \"mamba\" conda alternative.\n\n```sh\nmicromamba create -n environment_name -f environment.yml\n```\n\n## Acknowledgements\n\nThis package was developed under Netherlands eScience Center grant [NLESC.OEC.2022.017](https://research-software-directory.org/projects/excited).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxarray-contrib%2Fxarray-regrid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxarray-contrib%2Fxarray-regrid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxarray-contrib%2Fxarray-regrid/lists"}