{"id":13948962,"url":"https://github.com/xarray-contrib/xeofs","last_synced_at":"2026-04-09T14:02:39.792Z","repository":{"id":43154535,"uuid":"458379495","full_name":"xarray-contrib/xeofs","owner":"xarray-contrib","description":"Comprehensive EOF analysis in Python with xarray: A versatile, multidimensional, and scalable tool for advanced climate data analysis","archived":false,"fork":false,"pushed_at":"2025-01-28T08:38:48.000Z","size":46959,"stargazers_count":133,"open_issues_count":18,"forks_count":23,"subscribers_count":4,"default_branch":"main","last_synced_at":"2026-04-01T00:46:18.725Z","etag":null,"topics":["climate-science","dask","dimensionality-reduction","eof-analysis","pattern-recognition","pca","xarray"],"latest_commit_sha":null,"homepage":"https://xeofs.readthedocs.io/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xarray-contrib.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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,"zenodo":null}},"created_at":"2022-02-12T00:22:58.000Z","updated_at":"2026-04-01T00:34:51.000Z","dependencies_parsed_at":"2023-12-11T22:35:31.233Z","dependency_job_id":"e5277f97-93ba-40c4-b710-edfd8bb622d0","html_url":"https://github.com/xarray-contrib/xeofs","commit_stats":{"total_commits":558,"total_committers":9,"mean_commits":62.0,"dds":"0.14874551971326166","last_synced_commit":"1106302168e786bab2e14160e08ec43bdb3af528"},"previous_names":["xarray-contrib/xeofs","nicrie/xeofs"],"tags_count":45,"template":false,"template_full_name":null,"purl":"pkg:github/xarray-contrib/xeofs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xarray-contrib%2Fxeofs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xarray-contrib%2Fxeofs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xarray-contrib%2Fxeofs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xarray-contrib%2Fxeofs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xarray-contrib","download_url":"https://codeload.github.com/xarray-contrib/xeofs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xarray-contrib%2Fxeofs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31498070,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-06T17:22:55.647Z","status":"online","status_checked_at":"2026-04-07T02:00:07.164Z","response_time":105,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["climate-science","dask","dimensionality-reduction","eof-analysis","pattern-recognition","pca","xarray"],"created_at":"2024-08-08T05:01:35.280Z","updated_at":"2026-04-09T14:02:39.765Z","avatar_url":"https://github.com/xarray-contrib.png","language":"Python","readme":"![xeofs logo](docs/logos/xeofs_logo_dark.png)\n\n\u003cp align=\"center\"\u003e\n\n| Versions                   | [![PyPI](https://img.shields.io/pypi/v/xeofs)](https://pypi.org/project/xeofs/) [![Conda](https://img.shields.io/conda/vn/conda-forge/xeofs)](https://anaconda.org/conda-forge/xeofs) |\n|----------------------------|:---------------------------------------------------------------------------------------------:|\n| Build \u0026 Testing            | [![Build](https://img.shields.io/github/actions/workflow/status/xarray-contrib/xeofs/ci.yml?branch=main)](https://github.com/xarray-contrib/xeofs/actions/workflows/ci.yml) [![codecov](https://codecov.io/github/nicrie/xeofs/branch/main/graph/badge.svg?token=8040ZDH6U7)](https://codecov.io/github/nicrie/xeofs) |\n| Code Quality               | ![Black](https://img.shields.io/badge/code%20style-black-000000.svg)   [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v0.json)](https://github.com/charliermarsh/ruff)                           |\n| Documentation              | [![Docs](https://readthedocs.org/projects/xeofs/badge/?version=latest)](https://xeofs.readthedocs.io/en/latest/index.html)                          |\n| Citation                   | [![JOSS](https://joss.theoj.org/papers/4f50349ee1777b8a61761183047b1180/status.svg)](https://joss.theoj.org/papers/4f50349ee1777b8a61761183047b1180) [![Zenodo](https://zenodo.org/badge/DOI/10.5281/zenodo.6323012.svg)](https://zenodo.org/doi/10.5281/zenodo.6323011) \n| Licensing                  |  [![License](https://img.shields.io/pypi/l/xeofs)](https://github.com/xarray-contrib/xeofs/blob/main/LICENSE) |\n| User Engagement            | ![Downloads](https://img.shields.io/pypi/dw/xeofs)                                          |\n\n\u003c/p\u003e\n\n## Overview\n\n`xeofs` is a specialized Python package designed for dimensionality reduction in climate science, aimed at extracting meaningful patterns from large datasets. It provides eigenmethods such as Principal Component Analysis (EOF analysis) and several related variants. Seamlessly integrated with [xarray](https://docs.xarray.dev/en/stable/) and [Dask](https://www.dask.org/), xeofs enables efficient handling and scalable computation of large, multi-dimensional datasets. \n\n- **Multi-Dimensional**: Designed for `xarray` objects, it applies dimensionality reduction to multi-dimensional data while maintaining data labels.\n- **Dask-Integrated**: Supports large datasets via `Dask` xarray objects\n- **Extensive Methods**: Offers various dimensionality reduction techniques\n- **Adaptable Output**: Provides output corresponding to the type of input, whether single or list of `xr.DataArray` or `xr.Dataset`\n- **Missing Values**: Handles `NaN` values within the data\n- **Bootstrapping**: Comes with a user-friendly interface for model evaluation using bootstrapping\n- **Efficient**: Ensures computational efficiency, particularly with large datasets through randomized SVD\n- **Modular**: Allows users to implement and incorporate new dimensionality reduction methods\n\n## Installation\n\nTo install the package, use either of the following commands:\n\n```bash\nconda install -c conda-forge xeofs\n```\n\nor\n\n```bash\npip install xeofs\n```\n\n## Quickstart\n\nIn order to get started with `xeofs`, follow these simple steps:\n\n**Import the package**\n    \n```python\n\u003e\u003e\u003e import xarray as xr  # for example data only\n\u003e\u003e\u003e import xeofs as xe\n\n```\n\n**Load example data**\n\n```python\n\u003e\u003e\u003e t2m = xr.tutorial.open_dataset(\"air_temperature\")\n\u003e\u003e\u003e t2m_west = t2m.isel(lon=slice(None, 20))\n\u003e\u003e\u003e t2m_east = t2m.isel(lon=slice(21, None))\n\n```\n\n**EOF analysis**\nInitiate and fit the EOF/PCA model to the data\n\n```python\n\u003e\u003e\u003e eof = xe.single.EOF(n_modes=10)\n\u003e\u003e\u003e eof.fit(t2m, dim=\"time\")  # doctest: +ELLIPSIS\n\u003cxeofs.single.eof.EOF object at ...\u003e\n\n```\nNow, you can access the model's EOF components and PC scores:\n\n```py\n\u003e\u003e\u003e comps = eof.components()  # EOFs (spatial patterns)\n\u003e\u003e\u003e scores = eof.scores()  # PCs (temporal patterns)\n\n```\n\n**Varimax-rotated EOF analysis**\nInitiate and fit an `EOFRotator` class to the model to obtain a varimax-rotated EOF analysis\n\n```python\n\u003e\u003e\u003e rotator = xe.single.EOFRotator(n_modes=3)\n\u003e\u003e\u003e rotator.fit(eof) # doctest: +ELLIPSIS\n\u003cxeofs.single.eof_rotator.EOFRotator object at ...\u003e\n\n\u003e\u003e\u003e rot_comps = rotator.components()  # Rotated EOFs (spatial patterns)\n\u003e\u003e\u003e rot_scores = rotator.scores()  # Rotated PCs (temporal patterns)\n\n```\n\n**Maximum Covariance Analysis (MCA)**\n\n```python\n\u003e\u003e\u003e mca = xe.cross.MCA(n_modes=10)\n\u003e\u003e\u003e mca.fit(t2m_west, t2m_east, dim=\"time\")  # doctest: +ELLIPSIS\n\u003cxeofs.cross.mca.MCA object at ...\u003e\n\n\u003e\u003e\u003e comps1, comps2 = mca.components()  # Singular vectors (spatial patterns)\n\u003e\u003e\u003e scores1, scores2 = mca.scores()  # Expansion coefficients (temporal patterns)\n\n```\n\n**Varimax-rotated MCA**\n\n```python\n\u003e\u003e\u003e rotator = xe.cross.MCARotator(n_modes=10)\n\u003e\u003e\u003e rotator.fit(mca)  # doctest: +ELLIPSIS\n\u003cxeofs.cross.mca_rotator.MCARotator object at ...\u003e\n\n\u003e\u003e\u003e rot_comps = rotator.components()  # Rotated singular vectors (spatial patterns)\n\u003e\u003e\u003e rot_scores = rotator.scores()  # Rotated expansion coefficients (temporal patterns)\n\n```\n\nTo further explore the capabilities of `xeofs`, check out the [available documentation](https://xeofs.readthedocs.io/en/latest/) and [examples](https://xeofs.readthedocs.io/en/latest/auto_examples/index.html).\nFor a full list of currently available methods, see the [Reference API](https://xeofs.readthedocs.io/en/latest/api.html).\n\n## Documentation\n\nFor a more comprehensive overview and usage examples, visit the [documentation](https://xeofs.readthedocs.io/en/latest/).\n\n## Contributing\n\nContributions are highly welcomed and appreciated. If you're interested in improving `xeofs` or fixing issues, please read our [Contributing Guide](https://xeofs.readthedocs.io/en/latest/overview_3_contributing.html).\n\n## License\n\nThis project is licensed under the terms of the [MIT license](https://github.com/xarray-contrib/xeofs/blob/main/LICENSE).\n\n## Contact\n\nFor questions or support, please open a [Github issue](https://github.com/xarray-contrib/xeofs/issues).\n\n## Credits\n\n- Randomized PCA: [scikit-learn](https://scikit-learn.org/stable/)\n- EOF analysis: Python package [eofs](https://github.com/ajdawson/eofs) by Andrew Dawson\n- MCA: Python package [xMCA](https://github.com/Yefee/xMCA) by Yefee\n- CCA: Python package [CCA-Zoo](https://github.com/jameschapman19/cca_zoo) by James Chapman\n- ROCK-PCA: Matlab implementation by [Diego Bueso](https://github.com/DiegoBueso/ROCK-PCA)\n- Sparse PCA: Based on [Ristretto](https://github.com/erichson/ristretto) library by Benjamin Erichson\n\n## How to cite?\n\nWhen using `xeofs`, kindly remember to cite the original references of the methods employed in your work. Additionally, if `xeofs` is proving useful in your research, we'd appreciate if you could acknowledge its use with the following citation:\n\n```bibtex\n@article{rieger_xeofs_2024,\nauthor = {Rieger, Niclas and Levang, Samuel J.},\ndoi = {10.21105/joss.06060},\njournal = {Journal of Open Source Software},\nmonth = jan,\nnumber = {93},\npages = {6060},\ntitle = {{xeofs: Comprehensive EOF analysis in Python with xarray}},\nurl = {https://joss.theoj.org/papers/10.21105/joss.06060},\nvolume = {9},\nyear = {2024}\n}\n```\n\n## Contributors\n\n[![Contributors](https://contrib.rocks/image?repo=xarray-contrib/xeofs)](https://github.com/xarray-contrib/xeofs/graphs/contributors)\n","funding_links":[],"categories":["Climate Change"],"sub_categories":["Climate Data Processing and Analysis"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxarray-contrib%2Fxeofs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxarray-contrib%2Fxeofs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxarray-contrib%2Fxeofs/lists"}