Skip to main content

Collection of EOF analysis and related techniques for climate science

Project description

xeofs logo

GitHub Workflow Status (event) Documentation Status PyPI Conda (channel only) Total downloads badge_coverage License DOI - Zenodo

Overview

xeofs is a Python package that provides a platform for performing Empirical Orthogonal Function (EOF) analysis, a popular technique also known as Principal Component Analysis (PCA). It was born out of a necessity to process and analyse multi-dimensional Earth observation data, where the complexity extends beyond simple 2D matrices to include spatial (longitude, latitude, height), temporal (time, steps, lead times), and other dimensions.

The benefits of using xeofs include:

  • Multi-dimensional Analysis: Execute labeled EOF analysis with the extensive features of xarray.

  • Scalability: Handle large datasets effectively with dask.

  • Speed: Enjoy quick EOF analysis using scipy’s randomized SVD.

  • Model Validation: Validate models through bootstrapping.

  • Modular Code Structure: Incorporate new EOF variants with ease due to the package’s modular structure.

Installation

To install the package, use either of the following commands:

pip install xeofs

or

conda install -c conda-forge xeofs

Quickstart

In order to get started with xeofs, follow these simple steps:

  1. Import the package

    import xeofs as xe
  2. Instantiate the model

    Select the type of analysis you want to perform (in this case, EOF analysis) and set the parameters. For example, if you want to analyze the first 10 modes, you would use the following code:

    model = xe.models.EOF(n_modes=10)
  3. Fit the model to your data

    Fit the model to your data by specifying the dimensions along which the analysis should be performed. Replace ‘your_data’ and ‘your_dimension’ with your specific data and dimension:

    model.fit(your_data, dim=your_dimension)

Congratulations! You have performed your first analysis with xeofs. To further explore the capabilities of xeofs, check the documentation and examples.

Documentation

For a more comprehensive overview and usage examples, visit the documentation.

Contributing

Contributions are highly welcomed and appreciated. If you’re interested in improving xeofs or fixing issues, please open a Github issue.

License

This project is licensed under the terms of the MIT license.

Contact

For questions or support, please open a Github issue.

Credits

I want to acknowledge

  • Andrew Dawson, for his foundational Python package for EOF analysis.

  • Yefee, whose work provided useful references for implementing MCA in xeofs.

  • James Chapman, creator of a Python package for Canonical Correlation Analysis.

  • Diego Bueso, for his open-source ROCK-PCA implementation in Matlab.

  • The developers of NumPy, pandas, and xarray for their indispensable tools for scientific computations in Python.

How to cite?

Please make sure that when using xeofs you always cite the original source of the method used. Additionally, if you find xeofs useful for your research, you may cite it as follows:

@software{rieger_xeofs_2023,
  title = {xeofs: Multi-dimensional {EOF} analysis and variants in xarray},
  url = {https://github.com/nicrie/xeofs}
  version = {1.0.0},
  author = {Rieger, Niclas},
  date = {2023},
  doi = {10.5281/zenodo.6323011}
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xeofs-1.0.1.tar.gz (33.4 kB view hashes)

Uploaded Source

Built Distribution

xeofs-1.0.1-py3-none-any.whl (44.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page