xeofs 2.3.3__tar.gz → 2.4.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {xeofs-2.3.3 → xeofs-2.4.0}/CHANGELOG.md +7 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/PKG-INFO +2 -1
- {xeofs-2.3.3 → xeofs-2.4.0}/README.md +1 -0
- xeofs-2.4.0/docs/_autosummary/xeofs.models.SparsePCA.rst +40 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/api_1_intra.rst +1 -0
- xeofs-2.4.0/docs/auto_examples/1single/images/sphx_glr_plot_eof-smode_001.png +0 -0
- xeofs-2.4.0/docs/auto_examples/1single/images/thumb/sphx_glr_plot_eof-smode_thumb.png +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/index.rst +2 -2
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/plot_eof-smode.ipynb +30 -16
- xeofs-2.4.0/docs/auto_examples/1single/plot_eof-smode.py +66 -0
- xeofs-2.4.0/docs/auto_examples/1single/plot_eof-smode.py.md5 +1 -0
- xeofs-2.4.0/docs/auto_examples/1single/plot_eof-smode.rst +187 -0
- xeofs-2.4.0/docs/auto_examples/1single/plot_eof-smode_codeobj.pickle +0 -0
- xeofs-2.4.0/docs/auto_examples/1single/sg_execution_times.rst +31 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/auto_examples_jupyter.zip +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/auto_examples_python.zip +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/index.rst +2 -2
- xeofs-2.4.0/examples/1single/plot_eof-smode.py +66 -0
- xeofs-2.4.0/examples/1single/sparse_pca.jpg +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/pyproject.toml +1 -1
- xeofs-2.4.0/tests/models/test_sparse_pca.py +569 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/xeofs/models/__init__.py +7 -6
- xeofs-2.4.0/xeofs/models/_np_classes/_sparse_pca.py +697 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/xeofs/models/cca.py +1 -2
- {xeofs-2.3.3 → xeofs-2.4.0}/xeofs/models/rotator_factory.py +6 -6
- xeofs-2.4.0/xeofs/models/sparse_pca.py +357 -0
- xeofs-2.4.0/xeofs/utils/__init__.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/xeofs/utils/xarray_utils.py +29 -8
- {xeofs-2.3.3 → xeofs-2.4.0}/xeofs.egg-info/PKG-INFO +2 -1
- {xeofs-2.3.3 → xeofs-2.4.0}/xeofs.egg-info/SOURCES.txt +6 -0
- xeofs-2.3.3/docs/auto_examples/1single/images/sphx_glr_plot_eof-smode_001.png +0 -0
- xeofs-2.3.3/docs/auto_examples/1single/images/thumb/sphx_glr_plot_eof-smode_thumb.png +0 -0
- xeofs-2.3.3/docs/auto_examples/1single/plot_eof-smode.py +0 -55
- xeofs-2.3.3/docs/auto_examples/1single/plot_eof-smode.py.md5 +0 -1
- xeofs-2.3.3/docs/auto_examples/1single/plot_eof-smode.rst +0 -172
- xeofs-2.3.3/docs/auto_examples/1single/plot_eof-smode_codeobj.pickle +0 -0
- xeofs-2.3.3/docs/auto_examples/1single/sg_execution_times.rst +0 -64
- xeofs-2.3.3/examples/1single/plot_eof-smode.py +0 -55
- {xeofs-2.3.3 → xeofs-2.4.0}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/.github/workflows/changelog.yml +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/.github/workflows/ci.yml +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/.github/workflows/formatting.yml +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/.github/workflows/pull-request-linting.yml +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/.github/workflows/release_package.yml +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/.gitignore +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/.pre-commit-config.yaml +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/.readthedocs.yml +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/CITATION.cff +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/CODE_OF_CONDUCT.md +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/LICENSE +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/cliff.toml +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/Makefile +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/_autosummary/xeofs.models.CCA.rst +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/_autosummary/xeofs.models.ComplexEOF.rst +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/_autosummary/xeofs.models.ComplexEOFRotator.rst +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/_autosummary/xeofs.models.ComplexMCA.rst +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/_autosummary/xeofs.models.ComplexMCARotator.rst +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/_autosummary/xeofs.models.EOF.rst +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/_autosummary/xeofs.models.EOFRotator.rst +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/_autosummary/xeofs.models.ExtendedEOF.rst +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/_autosummary/xeofs.models.GWPCA.rst +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/_autosummary/xeofs.models.MCA.rst +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/_autosummary/xeofs.models.MCARotator.rst +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/_autosummary/xeofs.models.OPA.rst +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/_autosummary/xeofs.models.RotatorFactory.rst +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/_autosummary/xeofs.validation.EOFBootstrapper.rst +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/_static/custom.css +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/_templates/custom-class-template.rst +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/_templates/custom-module-template.rst +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/api.rst +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/api_2_inter.rst +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/api_3_eval.rst +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/api_4_utils.rst +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/images/sphx_glr_plot_complex_eof_001.png +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/images/sphx_glr_plot_complex_eof_002.png +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/images/sphx_glr_plot_complex_eof_003.png +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/images/sphx_glr_plot_complex_eof_004.png +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/images/sphx_glr_plot_eeof_001.png +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/images/sphx_glr_plot_eeof_002.png +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/images/sphx_glr_plot_eeof_003.png +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/images/sphx_glr_plot_eeof_trend_001.png +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/images/sphx_glr_plot_eeof_trend_002.png +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/images/sphx_glr_plot_eeof_trend_003.png +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/images/sphx_glr_plot_eof-tmode_001.png +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/images/sphx_glr_plot_gwpca_001.png +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/images/sphx_glr_plot_gwpca_002.png +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/images/sphx_glr_plot_mreof_001.png +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/images/sphx_glr_plot_multivariate-eof_001.png +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/images/sphx_glr_plot_rotated_eof_001.png +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/images/sphx_glr_plot_weighted-eof_001.png +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/images/thumb/sphx_glr_plot_complex_eof_thumb.png +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/images/thumb/sphx_glr_plot_eeof trend_thumb.png +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/images/thumb/sphx_glr_plot_eeof_thumb.png +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/images/thumb/sphx_glr_plot_eeof_trend_thumb.png +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/images/thumb/sphx_glr_plot_eof-tmode_thumb.png +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/images/thumb/sphx_glr_plot_gwpca_thumb.png +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/images/thumb/sphx_glr_plot_mreof_thumb.png +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/images/thumb/sphx_glr_plot_multivariate-eof_thumb.png +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/images/thumb/sphx_glr_plot_rotated_eof_thumb.png +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/images/thumb/sphx_glr_plot_weighted-eof_thumb.png +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/plot_complex_eof.ipynb +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/plot_complex_eof.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/plot_complex_eof.py.md5 +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/plot_complex_eof.rst +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/plot_complex_eof_codeobj.pickle +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/plot_eeof.ipynb +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/plot_eeof.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/plot_eeof.py.md5 +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/plot_eeof.rst +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/plot_eeof_codeobj.pickle +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/plot_eeof_trend.ipynb +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/plot_eeof_trend.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/plot_eeof_trend.py.md5 +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/plot_eeof_trend.rst +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/plot_eeof_trend_codeobj.pickle +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/plot_eof-tmode.ipynb +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/plot_eof-tmode.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/plot_eof-tmode.py.md5 +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/plot_eof-tmode.rst +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/plot_eof-tmode_codeobj.pickle +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/plot_gwpca.ipynb +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/plot_gwpca.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/plot_gwpca.py.md5 +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/plot_gwpca.rst +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/plot_gwpca_codeobj.pickle +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/plot_mreof.ipynb +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/plot_mreof.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/plot_mreof.py.md5 +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/plot_mreof.rst +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/plot_mreof_codeobj.pickle +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/plot_multivariate-eof.ipynb +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/plot_multivariate-eof.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/plot_multivariate-eof.py.md5 +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/plot_multivariate-eof.rst +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/plot_multivariate-eof_codeobj.pickle +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/plot_rotated_eof.ipynb +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/plot_rotated_eof.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/plot_rotated_eof.py.md5 +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/plot_rotated_eof.rst +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/plot_rotated_eof_codeobj.pickle +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/plot_weighted-eof.ipynb +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/plot_weighted-eof.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/plot_weighted-eof.py.md5 +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/plot_weighted-eof.rst +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/1single/plot_weighted-eof_codeobj.pickle +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/2multi/images/sphx_glr_plot_cca_001.png +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/2multi/images/sphx_glr_plot_cca_002.png +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/2multi/images/sphx_glr_plot_mca_001.png +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/2multi/images/sphx_glr_plot_rotated_mca_001.png +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/2multi/images/thumb/sphx_glr_plot_cca_thumb.png +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/2multi/images/thumb/sphx_glr_plot_mca_thumb.png +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/2multi/images/thumb/sphx_glr_plot_rotated_mca_thumb.png +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/2multi/index.rst +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/2multi/plot_cca.ipynb +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/2multi/plot_cca.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/2multi/plot_cca.py.md5 +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/2multi/plot_cca.rst +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/2multi/plot_cca_codeobj.pickle +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/2multi/plot_mca.ipynb +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/2multi/plot_mca.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/2multi/plot_mca.py.md5 +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/2multi/plot_mca.rst +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/2multi/plot_mca_codeobj.pickle +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/2multi/plot_rotated_mca.ipynb +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/2multi/plot_rotated_mca.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/2multi/plot_rotated_mca.py.md5 +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/2multi/plot_rotated_mca.rst +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/2multi/plot_rotated_mca_codeobj.pickle +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/2multi/sg_execution_times.rst +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/3validation/images/sphx_glr_plot_bootstrap_001.png +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/3validation/images/thumb/sphx_glr_plot_bootstrap_thumb.png +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/3validation/index.rst +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/3validation/plot_bootstrap.ipynb +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/3validation/plot_bootstrap.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/3validation/plot_bootstrap.py.md5 +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/3validation/plot_bootstrap.rst +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/3validation/plot_bootstrap_codeobj.pickle +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/auto_examples/3validation/sg_execution_times.rst +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/conf.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/environment.yml +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/faq.rst +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/img/timings_dark.png +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/img/timings_light.png +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/index.rst +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/installation.rst +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/logos/xeofs_logo.png +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/logos/xeofs_logo_black.png +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/logos/xeofs_logo_mini.png +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/logos/xeofs_logo_white.png +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/make.bat +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/model_pca.html +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/model_pca.ipynb +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/model_pca.md +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/overview.rst +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/overview_1_why.rst +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/overview_2_features.rst +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/overview_3_contributing.rst +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/perf/figure_timings.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/perf/timings.nc +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/perf/timings_dark.png +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/perf/timings_light.png +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/perf/xeofs_timings.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/docs/quickstart.ipynb +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/examples/1single/README.rst +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/examples/1single/eof-smode.jpg +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/examples/1single/eof-tmode.jpg +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/examples/1single/mreof-analysis.jpg +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/examples/1single/multivariate-eof-analysis.jpg +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/examples/1single/plot_complex_eof.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/examples/1single/plot_eeof.png +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/examples/1single/plot_eeof.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/examples/1single/plot_eeof_trend.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/examples/1single/plot_eof-tmode.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/examples/1single/plot_gwpca.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/examples/1single/plot_mreof.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/examples/1single/plot_multivariate-eof.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/examples/1single/plot_rotated_eof.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/examples/1single/plot_weighted-eof.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/examples/1single/rotated_eof.jpg +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/examples/1single/weighted_eof.jpg +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/examples/2multi/README.rst +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/examples/2multi/mca.jpg +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/examples/2multi/plot_cca.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/examples/2multi/plot_mca.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/examples/2multi/plot_rotated_mca.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/examples/2multi/rotated_mca.jpg +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/examples/3validation/README.rst +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/examples/3validation/bootstrap.jpg +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/examples/3validation/plot_bootstrap.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/examples/README.rst +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/setup.cfg +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/tests/__init__.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/tests/conftest.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/tests/data/sample_data.nc +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/tests/data_container/__init__.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/tests/models/__init__.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/tests/models/test_cca.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/tests/models/test_complex_eof.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/tests/models/test_complex_eof_rotator.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/tests/models/test_complex_mca.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/tests/models/test_complex_mca_rotator.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/tests/models/test_decomposer.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/tests/models/test_eeof.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/tests/models/test_eof.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/tests/models/test_eof_rotator.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/tests/models/test_gwpca.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/tests/models/test_mca.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/tests/models/test_mca_rotator.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/tests/models/test_opa.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/tests/models/test_orthogonality.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/tests/models/test_rotator.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/tests/preprocessing/__init__.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/tests/preprocessing/test_dataarray_multiindex_converter.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/tests/preprocessing/test_dataarray_renamer.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/tests/preprocessing/test_dataarray_sanitizer.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/tests/preprocessing/test_dataarray_scaler.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/tests/preprocessing/test_dataarray_stacker.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/tests/preprocessing/test_datalist_multiindex_converter.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/tests/preprocessing/test_datalist_scaler.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/tests/preprocessing/test_datalist_stacker.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/tests/preprocessing/test_dataset_multiindex_converter.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/tests/preprocessing/test_dataset_renamer.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/tests/preprocessing/test_dataset_scaler.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/tests/preprocessing/test_dataset_stacker.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/tests/preprocessing/test_preprocessor_dataarray.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/tests/preprocessing/test_preprocessor_datalist.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/tests/preprocessing/test_preprocessor_dataset.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/tests/utilities.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/tests/utils/test_dimension_renamer.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/tests/utils/test_total_variance.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/tests/validation/__init__.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/tests/validation/test_eof_bootstrapper.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/xeofs/__init__.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/xeofs/_version.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/xeofs/data_container/__init__.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/xeofs/data_container/data_container.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/xeofs/models/_base_cross_model.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/xeofs/models/_base_model.py +0 -0
- {xeofs-2.3.3/xeofs/utils → xeofs-2.4.0/xeofs/models/_np_classes}/__init__.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/xeofs/models/decomposer.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/xeofs/models/eeof.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/xeofs/models/eof.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/xeofs/models/eof_rotator.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/xeofs/models/gwpca.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/xeofs/models/mca.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/xeofs/models/mca_rotator.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/xeofs/models/opa.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/xeofs/preprocessing/__init__.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/xeofs/preprocessing/concatenator.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/xeofs/preprocessing/dimension_renamer.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/xeofs/preprocessing/list_processor.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/xeofs/preprocessing/multi_index_converter.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/xeofs/preprocessing/preprocessor.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/xeofs/preprocessing/sanitizer.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/xeofs/preprocessing/scaler.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/xeofs/preprocessing/stacker.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/xeofs/preprocessing/transformer.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/xeofs/utils/constants.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/xeofs/utils/data_types.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/xeofs/utils/dimension_renamer.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/xeofs/utils/distance_metrics.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/xeofs/utils/hilbert_transform.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/xeofs/utils/io.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/xeofs/utils/kernels.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/xeofs/utils/numba_utils.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/xeofs/utils/rotation.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/xeofs/utils/sanity_checks.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/xeofs/utils/statistics.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/xeofs/validation/__init__.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/xeofs/validation/_base_bootstrapper.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/xeofs/validation/bootstrapper.py +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/xeofs.egg-info/dependency_links.txt +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/xeofs.egg-info/requires.txt +0 -0
- {xeofs-2.3.3 → xeofs-2.4.0}/xeofs.egg-info/top_level.txt +0 -0
|
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. See [conven
|
|
|
5
5
|
---
|
|
6
6
|
## [unreleased]
|
|
7
7
|
|
|
8
|
+
### :rocket: Features
|
|
9
|
+
|
|
10
|
+
- add sparse PCA using variable projection (#170) - ([e2ccc76](https://github.com/nicrie/xeofs/commit/e2ccc7621c33f55a1ca4c2afe588123ea12deffa)) - Niclas Rieger
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
## [2.3.3](https://github.com/nicrie/xeofs/compare/v2.3.2..v2.3.3) - 2024-07-10
|
|
14
|
+
|
|
8
15
|
### :bug: Bug Fixes
|
|
9
16
|
|
|
10
17
|
- support new datatree and numpy 2.0 (#169) - ([536709c](https://github.com/nicrie/xeofs/commit/536709ce171ca5c07ca9a83b06cec3bb6a1eded7)) - Sam Levang
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: xeofs
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.4.0
|
|
4
4
|
Summary: Comprehensive EOF analysis in Python with xarray: A versatile, multidimensional, and scalable tool for advanced climate data analysis
|
|
5
5
|
Author-email: Niclas Rieger <niclasrieger@gmail.com>, "Samuel J. Levang" <slevang@gmail.com>
|
|
6
6
|
License: MIT
|
|
@@ -185,6 +185,7 @@ For questions or support, please open a [Github issue](https://github.com/xarray
|
|
|
185
185
|
- MCA: Python package [xMCA](https://github.com/Yefee/xMCA) by Yefee
|
|
186
186
|
- CCA: Python package [CCA-Zoo](https://github.com/jameschapman19/cca_zoo) by James Chapman
|
|
187
187
|
- ROCK-PCA: Matlab implementation by [Diego Bueso](https://github.com/DiegoBueso/ROCK-PCA)
|
|
188
|
+
- Sparse PCA: Based on [Ristretto](https://github.com/erichson/ristretto) library by Benjamin Erichson
|
|
188
189
|
|
|
189
190
|
## How to cite?
|
|
190
191
|
|
|
@@ -136,6 +136,7 @@ For questions or support, please open a [Github issue](https://github.com/xarray
|
|
|
136
136
|
- MCA: Python package [xMCA](https://github.com/Yefee/xMCA) by Yefee
|
|
137
137
|
- CCA: Python package [CCA-Zoo](https://github.com/jameschapman19/cca_zoo) by James Chapman
|
|
138
138
|
- ROCK-PCA: Matlab implementation by [Diego Bueso](https://github.com/DiegoBueso/ROCK-PCA)
|
|
139
|
+
- Sparse PCA: Based on [Ristretto](https://github.com/erichson/ristretto) library by Benjamin Erichson
|
|
139
140
|
|
|
140
141
|
## How to cite?
|
|
141
142
|
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
xeofs.models.SparsePCA
|
|
2
|
+
======================
|
|
3
|
+
|
|
4
|
+
.. currentmodule:: xeofs.models
|
|
5
|
+
|
|
6
|
+
.. autoclass:: SparsePCA
|
|
7
|
+
:members:
|
|
8
|
+
:show-inheritance:
|
|
9
|
+
:inherited-members:
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
.. automethod:: __init__
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
.. rubric:: Methods
|
|
16
|
+
|
|
17
|
+
.. autosummary::
|
|
18
|
+
|
|
19
|
+
~SparsePCA.__init__
|
|
20
|
+
~SparsePCA.components
|
|
21
|
+
~SparsePCA.compute
|
|
22
|
+
~SparsePCA.deserialize
|
|
23
|
+
~SparsePCA.explained_variance
|
|
24
|
+
~SparsePCA.explained_variance_ratio
|
|
25
|
+
~SparsePCA.fit
|
|
26
|
+
~SparsePCA.fit_transform
|
|
27
|
+
~SparsePCA.get_params
|
|
28
|
+
~SparsePCA.get_serialization_attrs
|
|
29
|
+
~SparsePCA.inverse_transform
|
|
30
|
+
~SparsePCA.load
|
|
31
|
+
~SparsePCA.save
|
|
32
|
+
~SparsePCA.scores
|
|
33
|
+
~SparsePCA.serialize
|
|
34
|
+
~SparsePCA.transform
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
Binary file
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
|
|
66
66
|
.. raw:: html
|
|
67
67
|
|
|
68
|
-
<div class="sphx-glr-thumbcontainer" tooltip="
|
|
68
|
+
<div class="sphx-glr-thumbcontainer" tooltip="This example demonstrates the application of sparse PCA [1]_ to sea surface temperature data. S...">
|
|
69
69
|
|
|
70
70
|
.. only:: html
|
|
71
71
|
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
|
|
77
77
|
.. raw:: html
|
|
78
78
|
|
|
79
|
-
<div class="sphx-glr-thumbnail-title">
|
|
79
|
+
<div class="sphx-glr-thumbnail-title">Sparse PCA</div>
|
|
80
80
|
</div>
|
|
81
81
|
|
|
82
82
|
|
|
@@ -5,9 +5,14 @@
|
|
|
5
5
|
"metadata": {},
|
|
6
6
|
"source": [
|
|
7
7
|
"\n",
|
|
8
|
-
"#
|
|
8
|
+
"# Sparse PCA\n",
|
|
9
9
|
"\n",
|
|
10
|
-
"
|
|
10
|
+
"This example demonstrates the application of sparse PCA [1]_ to sea surface temperature data. Sparse PCA is an alternative to rotated PCA, where the components are sparse, often providing a more interpretable solution.\n",
|
|
11
|
+
"\n",
|
|
12
|
+
"We replicate the analysis from the original paper [1]_, which identifies the ENSO (El Niño-Southern Oscillation) as the fourth mode, representing about 1% of the total variance. The original study focused on weekly sea surface temperatures from satellite data, whereas we use monthly data from ERSSTv5. Consequently, our results may not match exactly, but they should be quite similar.\n",
|
|
13
|
+
"\n",
|
|
14
|
+
"## References\n",
|
|
15
|
+
".. [1] Erichson, N. B. et al. Sparse Principal Component Analysis via Variable Projection. SIAM J. Appl. Math. 80, 977-1002 (2020).\n"
|
|
11
16
|
]
|
|
12
17
|
},
|
|
13
18
|
{
|
|
@@ -17,12 +22,20 @@
|
|
|
17
22
|
"outputs": [],
|
|
18
23
|
"source": [
|
|
19
24
|
"# Load packages and data:\n",
|
|
20
|
-
"import xarray as xr\n",
|
|
21
25
|
"import matplotlib.pyplot as plt\n",
|
|
22
|
-
"
|
|
26
|
+
"import xarray as xr\n",
|
|
23
27
|
"from cartopy.crs import EqualEarth, PlateCarree\n",
|
|
28
|
+
"from matplotlib.gridspec import GridSpec\n",
|
|
24
29
|
"\n",
|
|
25
|
-
"from xeofs.models import
|
|
30
|
+
"from xeofs.models import SparsePCA"
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"cell_type": "markdown",
|
|
35
|
+
"metadata": {},
|
|
36
|
+
"source": [
|
|
37
|
+
"We use sea surface temperature data from 1990 to 2017, consistent with the original paper.\n",
|
|
38
|
+
"\n"
|
|
26
39
|
]
|
|
27
40
|
},
|
|
28
41
|
{
|
|
@@ -31,14 +44,15 @@
|
|
|
31
44
|
"metadata": {},
|
|
32
45
|
"outputs": [],
|
|
33
46
|
"source": [
|
|
34
|
-
"sst = xr.tutorial.open_dataset(\"ersstv5\")[\"sst\"]"
|
|
47
|
+
"sst = xr.tutorial.open_dataset(\"ersstv5\")[\"sst\"]\n",
|
|
48
|
+
"sst = sst.sel(time=slice(\"1990\", \"2017\"))"
|
|
35
49
|
]
|
|
36
50
|
},
|
|
37
51
|
{
|
|
38
52
|
"cell_type": "markdown",
|
|
39
53
|
"metadata": {},
|
|
40
54
|
"source": [
|
|
41
|
-
"
|
|
55
|
+
"We perform sparse PCA using the `alpha` and `beta` parameters, which define the sparsity imposed by the elastic net (refer to Table 1 in the paper). In our analysis, we set `alpha` to 1e-5, as specified by the authors. Although the authors do not specify a value for `beta`, it appears that the results are not highly sensitive to this parameter. Therefore, we use the default `beta` value of 1e-4.\n",
|
|
42
56
|
"\n"
|
|
43
57
|
]
|
|
44
58
|
},
|
|
@@ -48,7 +62,7 @@
|
|
|
48
62
|
"metadata": {},
|
|
49
63
|
"outputs": [],
|
|
50
64
|
"source": [
|
|
51
|
-
"model =
|
|
65
|
+
"model = SparsePCA(n_modes=4, alpha=1e-5)\n",
|
|
52
66
|
"model.fit(sst, dim=\"time\")\n",
|
|
53
67
|
"expvar = model.explained_variance()\n",
|
|
54
68
|
"expvar_ratio = model.explained_variance_ratio()\n",
|
|
@@ -60,7 +74,7 @@
|
|
|
60
74
|
"cell_type": "markdown",
|
|
61
75
|
"metadata": {},
|
|
62
76
|
"source": [
|
|
63
|
-
"
|
|
77
|
+
"The explained variance fraction confirms that the fourth mode explains about 1% of the total variance, which is consistent with the original paper.\n",
|
|
64
78
|
"\n"
|
|
65
79
|
]
|
|
66
80
|
},
|
|
@@ -78,7 +92,7 @@
|
|
|
78
92
|
"cell_type": "markdown",
|
|
79
93
|
"metadata": {},
|
|
80
94
|
"source": [
|
|
81
|
-
"
|
|
95
|
+
"Examining the first four modes, we clearly identify ENSO as the fourth mode.\n",
|
|
82
96
|
"\n"
|
|
83
97
|
]
|
|
84
98
|
},
|
|
@@ -91,10 +105,10 @@
|
|
|
91
105
|
"proj = EqualEarth(central_longitude=180)\n",
|
|
92
106
|
"kwargs = {\"cmap\": \"RdBu\", \"vmin\": -0.05, \"vmax\": 0.05, \"transform\": PlateCarree()}\n",
|
|
93
107
|
"\n",
|
|
94
|
-
"fig = plt.figure(figsize=(10,
|
|
95
|
-
"gs = GridSpec(
|
|
96
|
-
"ax0 = [fig.add_subplot(gs[i, 0]) for i in range(
|
|
97
|
-
"ax1 = [fig.add_subplot(gs[i, 1], projection=proj) for i in range(
|
|
108
|
+
"fig = plt.figure(figsize=(10, 12))\n",
|
|
109
|
+
"gs = GridSpec(4, 2, width_ratios=[1, 2])\n",
|
|
110
|
+
"ax0 = [fig.add_subplot(gs[i, 0]) for i in range(4)]\n",
|
|
111
|
+
"ax1 = [fig.add_subplot(gs[i, 1], projection=proj) for i in range(4)]\n",
|
|
98
112
|
"\n",
|
|
99
113
|
"for i, (a0, a1) in enumerate(zip(ax0, ax1)):\n",
|
|
100
114
|
" scores.sel(mode=i + 1).plot(ax=a0)\n",
|
|
@@ -104,7 +118,7 @@
|
|
|
104
118
|
" a0.set_xlabel(\"\")\n",
|
|
105
119
|
"\n",
|
|
106
120
|
"plt.tight_layout()\n",
|
|
107
|
-
"plt.savefig(\"
|
|
121
|
+
"plt.savefig(\"sparse_pca.jpg\")"
|
|
108
122
|
]
|
|
109
123
|
}
|
|
110
124
|
],
|
|
@@ -124,7 +138,7 @@
|
|
|
124
138
|
"name": "python",
|
|
125
139
|
"nbconvert_exporter": "python",
|
|
126
140
|
"pygments_lexer": "ipython3",
|
|
127
|
-
"version": "3.11.
|
|
141
|
+
"version": "3.11.4"
|
|
128
142
|
}
|
|
129
143
|
},
|
|
130
144
|
"nbformat": 4,
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Sparse PCA
|
|
3
|
+
========================
|
|
4
|
+
|
|
5
|
+
This example demonstrates the application of sparse PCA [1]_ to sea surface temperature data. Sparse PCA is an alternative to rotated PCA, where the components are sparse, often providing a more interpretable solution.
|
|
6
|
+
|
|
7
|
+
We replicate the analysis from the original paper [1]_, which identifies the ENSO (El Niño-Southern Oscillation) as the fourth mode, representing about 1% of the total variance. The original study focused on weekly sea surface temperatures from satellite data, whereas we use monthly data from ERSSTv5. Consequently, our results may not match exactly, but they should be quite similar.
|
|
8
|
+
|
|
9
|
+
References
|
|
10
|
+
----------
|
|
11
|
+
.. [1] Erichson, N. B. et al. Sparse Principal Component Analysis via Variable Projection. SIAM J. Appl. Math. 80, 977-1002 (2020).
|
|
12
|
+
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
# Load packages and data:
|
|
16
|
+
import matplotlib.pyplot as plt
|
|
17
|
+
import xarray as xr
|
|
18
|
+
from cartopy.crs import EqualEarth, PlateCarree
|
|
19
|
+
from matplotlib.gridspec import GridSpec
|
|
20
|
+
|
|
21
|
+
from xeofs.models import SparsePCA
|
|
22
|
+
|
|
23
|
+
# %%
|
|
24
|
+
# We use sea surface temperature data from 1990 to 2017, consistent with the original paper.
|
|
25
|
+
|
|
26
|
+
sst = xr.tutorial.open_dataset("ersstv5")["sst"]
|
|
27
|
+
sst = sst.sel(time=slice("1990", "2017"))
|
|
28
|
+
|
|
29
|
+
# %%
|
|
30
|
+
# We perform sparse PCA using the `alpha` and `beta` parameters, which define the sparsity imposed by the elastic net (refer to Table 1 in the paper). In our analysis, we set `alpha` to 1e-5, as specified by the authors. Although the authors do not specify a value for `beta`, it appears that the results are not highly sensitive to this parameter. Therefore, we use the default `beta` value of 1e-4.
|
|
31
|
+
|
|
32
|
+
model = SparsePCA(n_modes=4, alpha=1e-5)
|
|
33
|
+
model.fit(sst, dim="time")
|
|
34
|
+
expvar = model.explained_variance()
|
|
35
|
+
expvar_ratio = model.explained_variance_ratio()
|
|
36
|
+
components = model.components()
|
|
37
|
+
scores = model.scores()
|
|
38
|
+
|
|
39
|
+
# %%
|
|
40
|
+
# The explained variance fraction confirms that the fourth mode explains about 1% of the total variance, which is consistent with the original paper.
|
|
41
|
+
|
|
42
|
+
print("Explained variance: ", expvar.round(0).values)
|
|
43
|
+
print("Relative: ", (expvar_ratio * 100).round(1).values)
|
|
44
|
+
|
|
45
|
+
# %%
|
|
46
|
+
# Examining the first four modes, we clearly identify ENSO as the fourth mode.
|
|
47
|
+
|
|
48
|
+
proj = EqualEarth(central_longitude=180)
|
|
49
|
+
kwargs = {"cmap": "RdBu", "vmin": -0.05, "vmax": 0.05, "transform": PlateCarree()}
|
|
50
|
+
|
|
51
|
+
fig = plt.figure(figsize=(10, 12))
|
|
52
|
+
gs = GridSpec(4, 2, width_ratios=[1, 2])
|
|
53
|
+
ax0 = [fig.add_subplot(gs[i, 0]) for i in range(4)]
|
|
54
|
+
ax1 = [fig.add_subplot(gs[i, 1], projection=proj) for i in range(4)]
|
|
55
|
+
|
|
56
|
+
for i, (a0, a1) in enumerate(zip(ax0, ax1)):
|
|
57
|
+
scores.sel(mode=i + 1).plot(ax=a0)
|
|
58
|
+
a1.coastlines(color=".5")
|
|
59
|
+
components.sel(mode=i + 1).plot(ax=a1, **kwargs)
|
|
60
|
+
|
|
61
|
+
a0.set_xlabel("")
|
|
62
|
+
|
|
63
|
+
plt.tight_layout()
|
|
64
|
+
plt.savefig("sparse_pca.jpg")
|
|
65
|
+
|
|
66
|
+
# %%
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
bb0b6c390528787d00735dd586afb457
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
|
|
2
|
+
.. DO NOT EDIT.
|
|
3
|
+
.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY.
|
|
4
|
+
.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE:
|
|
5
|
+
.. "auto_examples/1single/plot_eof-smode.py"
|
|
6
|
+
.. LINE NUMBERS ARE GIVEN BELOW.
|
|
7
|
+
|
|
8
|
+
.. only:: html
|
|
9
|
+
|
|
10
|
+
.. note::
|
|
11
|
+
:class: sphx-glr-download-link-note
|
|
12
|
+
|
|
13
|
+
:ref:`Go to the end <sphx_glr_download_auto_examples_1single_plot_eof-smode.py>`
|
|
14
|
+
to download the full example code
|
|
15
|
+
|
|
16
|
+
.. rst-class:: sphx-glr-example-title
|
|
17
|
+
|
|
18
|
+
.. _sphx_glr_auto_examples_1single_plot_eof-smode.py:
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
Sparse PCA
|
|
22
|
+
========================
|
|
23
|
+
|
|
24
|
+
This example demonstrates the application of sparse PCA [1]_ to sea surface temperature data. Sparse PCA is an alternative to rotated PCA, where the components are sparse, often providing a more interpretable solution.
|
|
25
|
+
|
|
26
|
+
We replicate the analysis from the original paper [1]_, which identifies the ENSO (El Niño-Southern Oscillation) as the fourth mode, representing about 1% of the total variance. The original study focused on weekly sea surface temperatures from satellite data, whereas we use monthly data from ERSSTv5. Consequently, our results may not match exactly, but they should be quite similar.
|
|
27
|
+
|
|
28
|
+
References
|
|
29
|
+
----------
|
|
30
|
+
.. [1] Erichson, N. B. et al. Sparse Principal Component Analysis via Variable Projection. SIAM J. Appl. Math. 80, 977-1002 (2020).
|
|
31
|
+
|
|
32
|
+
.. GENERATED FROM PYTHON SOURCE LINES 14-23
|
|
33
|
+
|
|
34
|
+
.. code-block:: default
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
# Load packages and data:
|
|
38
|
+
import matplotlib.pyplot as plt
|
|
39
|
+
import xarray as xr
|
|
40
|
+
from cartopy.crs import EqualEarth, PlateCarree
|
|
41
|
+
from matplotlib.gridspec import GridSpec
|
|
42
|
+
|
|
43
|
+
from xeofs.models import SparsePCA
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
.. GENERATED FROM PYTHON SOURCE LINES 24-25
|
|
53
|
+
|
|
54
|
+
We use sea surface temperature data from 1990 to 2017, consistent with the original paper.
|
|
55
|
+
|
|
56
|
+
.. GENERATED FROM PYTHON SOURCE LINES 25-29
|
|
57
|
+
|
|
58
|
+
.. code-block:: default
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
sst = xr.tutorial.open_dataset("ersstv5")["sst"]
|
|
62
|
+
sst = sst.sel(time=slice("1990", "2017"))
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
.. GENERATED FROM PYTHON SOURCE LINES 30-31
|
|
72
|
+
|
|
73
|
+
We perform sparse PCA using the `alpha` and `beta` parameters, which define the sparsity imposed by the elastic net (refer to Table 1 in the paper). In our analysis, we set `alpha` to 1e-5, as specified by the authors. Although the authors do not specify a value for `beta`, it appears that the results are not highly sensitive to this parameter. Therefore, we use the default `beta` value of 1e-4.
|
|
74
|
+
|
|
75
|
+
.. GENERATED FROM PYTHON SOURCE LINES 31-39
|
|
76
|
+
|
|
77
|
+
.. code-block:: default
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
model = SparsePCA(n_modes=4, alpha=1e-5)
|
|
81
|
+
model.fit(sst, dim="time")
|
|
82
|
+
expvar = model.explained_variance()
|
|
83
|
+
expvar_ratio = model.explained_variance_ratio()
|
|
84
|
+
components = model.components()
|
|
85
|
+
scores = model.scores()
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
.. GENERATED FROM PYTHON SOURCE LINES 40-41
|
|
95
|
+
|
|
96
|
+
The explained variance fraction confirms that the fourth mode explains about 1% of the total variance, which is consistent with the original paper.
|
|
97
|
+
|
|
98
|
+
.. GENERATED FROM PYTHON SOURCE LINES 41-45
|
|
99
|
+
|
|
100
|
+
.. code-block:: default
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
print("Explained variance: ", expvar.round(0).values)
|
|
104
|
+
print("Relative: ", (expvar_ratio * 100).round(1).values)
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
.. rst-class:: sphx-glr-script-out
|
|
111
|
+
|
|
112
|
+
.. code-block:: none
|
|
113
|
+
|
|
114
|
+
Explained variance: [34060. 1252. 963. 405.]
|
|
115
|
+
Relative: [86. 3.2 2.4 1. ]
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
.. GENERATED FROM PYTHON SOURCE LINES 46-47
|
|
121
|
+
|
|
122
|
+
Examining the first four modes, we clearly identify ENSO as the fourth mode.
|
|
123
|
+
|
|
124
|
+
.. GENERATED FROM PYTHON SOURCE LINES 47-66
|
|
125
|
+
|
|
126
|
+
.. code-block:: default
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
proj = EqualEarth(central_longitude=180)
|
|
130
|
+
kwargs = {"cmap": "RdBu", "vmin": -0.05, "vmax": 0.05, "transform": PlateCarree()}
|
|
131
|
+
|
|
132
|
+
fig = plt.figure(figsize=(10, 12))
|
|
133
|
+
gs = GridSpec(4, 2, width_ratios=[1, 2])
|
|
134
|
+
ax0 = [fig.add_subplot(gs[i, 0]) for i in range(4)]
|
|
135
|
+
ax1 = [fig.add_subplot(gs[i, 1], projection=proj) for i in range(4)]
|
|
136
|
+
|
|
137
|
+
for i, (a0, a1) in enumerate(zip(ax0, ax1)):
|
|
138
|
+
scores.sel(mode=i + 1).plot(ax=a0)
|
|
139
|
+
a1.coastlines(color=".5")
|
|
140
|
+
components.sel(mode=i + 1).plot(ax=a1, **kwargs)
|
|
141
|
+
|
|
142
|
+
a0.set_xlabel("")
|
|
143
|
+
|
|
144
|
+
plt.tight_layout()
|
|
145
|
+
plt.savefig("sparse_pca.jpg")
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
.. image-sg:: /auto_examples/1single/images/sphx_glr_plot_eof-smode_001.png
|
|
151
|
+
:alt: mode = 1, mode = 2, mode = 3, mode = 4, mode = 1, mode = 2, mode = 3, mode = 4
|
|
152
|
+
:srcset: /auto_examples/1single/images/sphx_glr_plot_eof-smode_001.png
|
|
153
|
+
:class: sphx-glr-single-img
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
.. rst-class:: sphx-glr-timing
|
|
161
|
+
|
|
162
|
+
**Total running time of the script:** (0 minutes 7.992 seconds)
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
.. _sphx_glr_download_auto_examples_1single_plot_eof-smode.py:
|
|
166
|
+
|
|
167
|
+
.. only:: html
|
|
168
|
+
|
|
169
|
+
.. container:: sphx-glr-footer sphx-glr-footer-example
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
.. container:: sphx-glr-download sphx-glr-download-python
|
|
175
|
+
|
|
176
|
+
:download:`Download Python source code: plot_eof-smode.py <plot_eof-smode.py>`
|
|
177
|
+
|
|
178
|
+
.. container:: sphx-glr-download sphx-glr-download-jupyter
|
|
179
|
+
|
|
180
|
+
:download:`Download Jupyter notebook: plot_eof-smode.ipynb <plot_eof-smode.ipynb>`
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
.. only:: html
|
|
184
|
+
|
|
185
|
+
.. rst-class:: sphx-glr-signature
|
|
186
|
+
|
|
187
|
+
`Gallery generated by Sphinx-Gallery <https://sphinx-gallery.github.io>`_
|
|
Binary file
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
|
|
2
|
+
:orphan:
|
|
3
|
+
|
|
4
|
+
.. _sphx_glr_auto_examples_1single_sg_execution_times:
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
Computation times
|
|
8
|
+
=================
|
|
9
|
+
**00:07.992** total execution time for **auto_examples_1single** files:
|
|
10
|
+
|
|
11
|
+
+-----------------------------------------------------------------------------------------------+-----------+--------+
|
|
12
|
+
| :ref:`sphx_glr_auto_examples_1single_plot_eof-smode.py` (``plot_eof-smode.py``) | 00:07.992 | 0.0 MB |
|
|
13
|
+
+-----------------------------------------------------------------------------------------------+-----------+--------+
|
|
14
|
+
| :ref:`sphx_glr_auto_examples_1single_plot_complex_eof.py` (``plot_complex_eof.py``) | 00:00.000 | 0.0 MB |
|
|
15
|
+
+-----------------------------------------------------------------------------------------------+-----------+--------+
|
|
16
|
+
| :ref:`sphx_glr_auto_examples_1single_plot_eeof.py` (``plot_eeof.py``) | 00:00.000 | 0.0 MB |
|
|
17
|
+
+-----------------------------------------------------------------------------------------------+-----------+--------+
|
|
18
|
+
| :ref:`sphx_glr_auto_examples_1single_plot_eeof_trend.py` (``plot_eeof_trend.py``) | 00:00.000 | 0.0 MB |
|
|
19
|
+
+-----------------------------------------------------------------------------------------------+-----------+--------+
|
|
20
|
+
| :ref:`sphx_glr_auto_examples_1single_plot_eof-tmode.py` (``plot_eof-tmode.py``) | 00:00.000 | 0.0 MB |
|
|
21
|
+
+-----------------------------------------------------------------------------------------------+-----------+--------+
|
|
22
|
+
| :ref:`sphx_glr_auto_examples_1single_plot_gwpca.py` (``plot_gwpca.py``) | 00:00.000 | 0.0 MB |
|
|
23
|
+
+-----------------------------------------------------------------------------------------------+-----------+--------+
|
|
24
|
+
| :ref:`sphx_glr_auto_examples_1single_plot_mreof.py` (``plot_mreof.py``) | 00:00.000 | 0.0 MB |
|
|
25
|
+
+-----------------------------------------------------------------------------------------------+-----------+--------+
|
|
26
|
+
| :ref:`sphx_glr_auto_examples_1single_plot_multivariate-eof.py` (``plot_multivariate-eof.py``) | 00:00.000 | 0.0 MB |
|
|
27
|
+
+-----------------------------------------------------------------------------------------------+-----------+--------+
|
|
28
|
+
| :ref:`sphx_glr_auto_examples_1single_plot_rotated_eof.py` (``plot_rotated_eof.py``) | 00:00.000 | 0.0 MB |
|
|
29
|
+
+-----------------------------------------------------------------------------------------------+-----------+--------+
|
|
30
|
+
| :ref:`sphx_glr_auto_examples_1single_plot_weighted-eof.py` (``plot_weighted-eof.py``) | 00:00.000 | 0.0 MB |
|
|
31
|
+
+-----------------------------------------------------------------------------------------------+-----------+--------+
|
|
Binary file
|
|
Binary file
|
|
@@ -79,7 +79,7 @@ Here you can find some examples of how to use the library.
|
|
|
79
79
|
|
|
80
80
|
.. raw:: html
|
|
81
81
|
|
|
82
|
-
<div class="sphx-glr-thumbcontainer" tooltip="
|
|
82
|
+
<div class="sphx-glr-thumbcontainer" tooltip="This example demonstrates the application of sparse PCA [1]_ to sea surface temperature data. S...">
|
|
83
83
|
|
|
84
84
|
.. only:: html
|
|
85
85
|
|
|
@@ -90,7 +90,7 @@ Here you can find some examples of how to use the library.
|
|
|
90
90
|
|
|
91
91
|
.. raw:: html
|
|
92
92
|
|
|
93
|
-
<div class="sphx-glr-thumbnail-title">
|
|
93
|
+
<div class="sphx-glr-thumbnail-title">Sparse PCA</div>
|
|
94
94
|
</div>
|
|
95
95
|
|
|
96
96
|
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Sparse PCA
|
|
3
|
+
========================
|
|
4
|
+
|
|
5
|
+
This example demonstrates the application of sparse PCA [1]_ to sea surface temperature data. Sparse PCA is an alternative to rotated PCA, where the components are sparse, often providing a more interpretable solution.
|
|
6
|
+
|
|
7
|
+
We replicate the analysis from the original paper [1]_, which identifies the ENSO (El Niño-Southern Oscillation) as the fourth mode, representing about 1% of the total variance. The original study focused on weekly sea surface temperatures from satellite data, whereas we use monthly data from ERSSTv5. Consequently, our results may not match exactly, but they should be quite similar.
|
|
8
|
+
|
|
9
|
+
References
|
|
10
|
+
----------
|
|
11
|
+
.. [1] Erichson, N. B. et al. Sparse Principal Component Analysis via Variable Projection. SIAM J. Appl. Math. 80, 977-1002 (2020).
|
|
12
|
+
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
# Load packages and data:
|
|
16
|
+
import matplotlib.pyplot as plt
|
|
17
|
+
import xarray as xr
|
|
18
|
+
from cartopy.crs import EqualEarth, PlateCarree
|
|
19
|
+
from matplotlib.gridspec import GridSpec
|
|
20
|
+
|
|
21
|
+
from xeofs.models import SparsePCA
|
|
22
|
+
|
|
23
|
+
# %%
|
|
24
|
+
# We use sea surface temperature data from 1990 to 2017, consistent with the original paper.
|
|
25
|
+
|
|
26
|
+
sst = xr.tutorial.open_dataset("ersstv5")["sst"]
|
|
27
|
+
sst = sst.sel(time=slice("1990", "2017"))
|
|
28
|
+
|
|
29
|
+
# %%
|
|
30
|
+
# We perform sparse PCA using the `alpha` and `beta` parameters, which define the sparsity imposed by the elastic net (refer to Table 1 in the paper). In our analysis, we set `alpha` to 1e-5, as specified by the authors. Although the authors do not specify a value for `beta`, it appears that the results are not highly sensitive to this parameter. Therefore, we use the default `beta` value of 1e-4.
|
|
31
|
+
|
|
32
|
+
model = SparsePCA(n_modes=4, alpha=1e-5)
|
|
33
|
+
model.fit(sst, dim="time")
|
|
34
|
+
expvar = model.explained_variance()
|
|
35
|
+
expvar_ratio = model.explained_variance_ratio()
|
|
36
|
+
components = model.components()
|
|
37
|
+
scores = model.scores()
|
|
38
|
+
|
|
39
|
+
# %%
|
|
40
|
+
# The explained variance fraction confirms that the fourth mode explains about 1% of the total variance, which is consistent with the original paper.
|
|
41
|
+
|
|
42
|
+
print("Explained variance: ", expvar.round(0).values)
|
|
43
|
+
print("Relative: ", (expvar_ratio * 100).round(1).values)
|
|
44
|
+
|
|
45
|
+
# %%
|
|
46
|
+
# Examining the first four modes, we clearly identify ENSO as the fourth mode.
|
|
47
|
+
|
|
48
|
+
proj = EqualEarth(central_longitude=180)
|
|
49
|
+
kwargs = {"cmap": "RdBu", "vmin": -0.05, "vmax": 0.05, "transform": PlateCarree()}
|
|
50
|
+
|
|
51
|
+
fig = plt.figure(figsize=(10, 12))
|
|
52
|
+
gs = GridSpec(4, 2, width_ratios=[1, 2])
|
|
53
|
+
ax0 = [fig.add_subplot(gs[i, 0]) for i in range(4)]
|
|
54
|
+
ax1 = [fig.add_subplot(gs[i, 1], projection=proj) for i in range(4)]
|
|
55
|
+
|
|
56
|
+
for i, (a0, a1) in enumerate(zip(ax0, ax1)):
|
|
57
|
+
scores.sel(mode=i + 1).plot(ax=a0)
|
|
58
|
+
a1.coastlines(color=".5")
|
|
59
|
+
components.sel(mode=i + 1).plot(ax=a1, **kwargs)
|
|
60
|
+
|
|
61
|
+
a0.set_xlabel("")
|
|
62
|
+
|
|
63
|
+
plt.tight_layout()
|
|
64
|
+
plt.savefig("sparse_pca.jpg")
|
|
65
|
+
|
|
66
|
+
# %%
|
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "xeofs"
|
|
3
|
-
version = "2.
|
|
3
|
+
version = "2.4.0"
|
|
4
4
|
description = "Comprehensive EOF analysis in Python with xarray: A versatile, multidimensional, and scalable tool for advanced climate data analysis"
|
|
5
5
|
authors = [
|
|
6
6
|
{name = "Niclas Rieger", email = "niclasrieger@gmail.com"},
|