Skip to main content

A Python package for understanding the evolution of soil moisture and soil moisture anomalies

Project description

SMODEX Package: A Python package for understanding the evolution of soil moisture anomalies.

License: MIT 0 Coverage Python

Code style: black Documentation PRs Welcome

SMODEX is a package developed to enhance performant computation and understanding of the evolution of soil moisture and soil moisture anomalies using climate datasets. It embraces the principles of FAIR and Open Science in the development of the computational workflow and the data sharing.

Package Usage

Soil moisture and soil moisture anomalies are critical markers of dryness and agricultural drought. The SMODEX package was designed to aid the performant of this metrics targeting the following categories of users:

  1. Researchers working on the topics of soil moisture, drought and soil hydrology,
  2. Students exploring tools for understanding the dynamics of soil moisture and soil hydrology,
  3. Open-source and Open-science scientists looking for a wrapper to compute these specific anomalies

Installation

The SMODEX package is compatible with Python 3.6+ and is distributed through the Python Package Index (PyPI) and can installed via:

pip install smodex

Usage examples

Currently, the main subpackages in SMODEX include:

  • downloader: contains a request to the ERA5 Climate Datastore for downloading and saving soil water contents based on the specified timeline necessary for computing an anomaly,
  • climates: contains functionalities for computing soil moisture climatology with a given reference, and rolling mean at a weekly rolling window, dekadal, monthly or annual scale,
  • anomaly: contains functionalities for computing, saving soil moisture anomalies,
  • share: contains functionalities for sharing computed datasets with other scientists using the STAC specification (coming soon),
  • plots: contains different functionalities for visualizing the soil moisture and soil moisture anomalies across spatial and temporal dimensions (coming soon),

Downloader

To use the downloader module, see our quick start example here

Within a python script, this can serve as a quick guide:

from smodex.downloader import cds_downloader

start_date = '2020-12-15'
end_date = '2021-01-03'
conf_path = 'download.json'
download_path = 'moisture_data/'

cds_downloader(start_date,
               end_date,
               conf_path,
               download_path)

However, this requires the installation of the ERA5 CDS API as well as a specification of your API keys in a .env file following this examples: Run:

pip install cdsapi

And set the following values to those of your CDS API keys

# .env 
CDSAPI_URL=https://cds.climate.copernicus.eu/api/v2
CDSAPI_KEY=XXXXXX:XXXXXX-XXXXXX-XXXX-XXXXX

Remember to change the CDSAPI_KEY to that of your personal or organization's account keys. You can find more specific details on how to access your personal CDS API key here

Contributing

Currently, the SMODEX package is under development and we solicit the contribution of other developers to make a Merge/Pull Request using the development version on GitLab. You can clone the repository and install the pakcage using:

python setup.py install

To make a merge/pull request for a major code change, open an issue to discuss what you'd like to change first. And tests your code changes locally with the pre-commit hooks specified before requesting a merge-request, which automatically triggers the execution of all the tests cases in the repo.

Contributors

License

MIT

External links

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

smodex-1.0.1b0.tar.gz (28.3 kB view hashes)

Uploaded Source

Built Distribution

smodex-1.0.1b0-py3-none-any.whl (11.8 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