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.

Announcements

  • Release! Version 1.1.0-alpha, October 25, 2023
  • The South Tyrol Free Software Conference (SFSCON): presentation on November 11, 2023 at SFSCON NOI Tech Park, Bolzano, Italy

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 would be distributed through the Python Package Index (PyPI) and can installed:

pip install smodex

Usage examples

Currently, the main subpackages in SMODEX include: -- sm_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, -- sm_climatology: contains functionalities for computing soil moisture climatology with a given reference, and rolling mean at a monthly or dekadal scale, -- sm_anomaly: contains functionalities for computing and saving soil moisture anomalies, -- sm_visualize: contains different functionalities for visualizing the soil moisture and soil moisture anomalies across spatial and temporal dimensions (coming soon), -- tests: test for data handling, and computation moisture and moisture anomalies computation, -- docs: readthedocs implementation

Download Module

You can use the sm_downloader with your python script or notebook this way:

from smodex import sm_downloader

download = sm_downloader.SMDownload(
    start_date='2020-05-05',
    end_date='2021-05-10',
    api="era5",
    area=[50.775, 2.775, 42.275, 18.025],
    depth=[1, 2, 3, 4],
    download_path= "./sm_downloaded/"
    )

download.downloader()

But note, for this module to work locally, you shold have the ERA5 CDS API installed on your machine. To do this, you simply run:

pip install cdsapi

Additionally, create an .env file and set:

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

Other modules can also be imported and used by:

import smodex
smodex.sm_downloader()
smodex.compute_climatology()
smodex.compute_anomalies()

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.0b0.tar.gz (27.6 kB view hashes)

Uploaded Source

Built Distribution

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