Python API for the Global Precipitation Mission Data Archive
Project description
📦 Welcome to GPM-API
Deployment | |
Activity | |
Python Versions | |
Supported Systems | |
Project Status | |
Build Status | |
Linting | |
Code Coverage | |
Code Quality | |
Code Review | |
License | |
Community | |
Citation |
The GPM-API is still in development. Feel free to try it out and to report issues or to suggest changes.
🚀 Quick start
GPM-API provides an easy-to-use python interface to download, read, process and visualize most of the products of the Global Precipitation Measurement Mission (GPM) data archive.
The list of available products can be retrieved using:
import gpm_api
gpm_api.available_products(product_types="RS") # research products
gpm_api.available_products(product_types="NRT") # near-real-time products
Before starting using GPM-API, we highly suggest to save into a configuration file:
- your credentials to access the NASA Precipitation Processing System (PPS) servers
- the directory on the local disk where to save the GPM dataset of interest.
To facilitate the creation of the configuration file, you can run the following script:
import gpm_api
username = "<your PPS username>" # likely your mail
password = "<your PPS password>" # likely your mail
gpm_base_dir = "<path/to/directory/GPM" # path to the directory where to download the data
gpm_api.define_configs(username_pps=username,
password_pps=password,
gpm_base_dir=gpm_base_dir)
# You can check that the config file has been correctly created with:
configs = gpm_api.read_configs()
print(configs)
📥 Download GPM data
Now you can either start to download GPM data within python:
import gpm_api
import datetime
product = "2A-DPR"
product_type = "RS"
version = 7
start_time = datetime.datetime(2020,7, 22, 0, 1, 11)
end_time = datetime.datetime(2020,7, 22, 0, 23, 5)
gpm_api.download(product=product,
product_type=product_type,
version=version,
n_threads=2,
start_time=start_time,
end_time=end_time)
or from the terminal using i.e. download_daily_gpm_data <product> <year> <month> <day>
:
download_daily_gpm_data 2A-DPR 2022 7 22
💫 Open GPM files into xarray
A GPM granule can be opened in python using:
import gpm_api
ds = gpm_api.open_granule(<path_to_granule>)
while multiple granules over a specific time period can be opened using:
import gpm_api
import datetime
product = "2A-DPR"
product_type = "RS"
version = 7
start_time = datetime.datetime(2020,7, 22, 0, 1, 11)
end_time = datetime.datetime(2020,7, 22, 0, 23, 5)
ds = gpm_api.open_dataset(product=product,
product_type=product_type,
version=version
start_time=start_time,
end_time=end_time)
📖 Explore the GPM-API documentation
To discover all GPM-API download, manipulation, analysis and plotting utilities, or how to contribute your custom retrieval to GPM-API:
- please read the software documentation available at [https://disdrodb.readthedocs.io/en/latest/].
- dive into the Jupyter Notebooks Tutorials tutorials.
🛠️ Installation
pip
GPM-API can be installed via pip on Linux, Mac, and Windows.
On Windows you can install WinPython to get Python and pip
running.
Prior installation of GPM-API, to avoid GEOS library version incompatibilities when
installing the Cartopy package, we highly suggest to install first Cartopy using conda install cartopy>=0.21.0
.
Then, install the GPM-API package by typing the following command in the command terminal:
pip install gpm_api
To install the latest development version via pip, see the documentation.
conda [NOT YET AVAILABLE]
GPM-API can be installed via conda on Linux, Mac, and Windows. Install the package by typing the following command in a command terminal:
conda install gpm_api
In case conda forge is not set up for your system yet, see the easy to follow instructions on conda forge.
💭 Feedback and Contributing Guidelines
If you aim to contribute your data or discuss the future development of GPM-API, we highly suggest to join the GPM-API Slack Workspace
Feel free to also open a GitHub Issue or a GitHub Discussion specific to your questions or ideas.
Citation
You can cite the GPM-API software by:
Ghiggi Gionata & XXXX . ghiggi/gpm_api. Zenodo. https://doi.org/10.5281/zenodo.7753488
If you want to cite a specific software version, have a look at the Zenodo site.
License
The content of this repository is released under the terms of the MIT license.
Tutorials
The documentation also includes some [tutorials][tut_link], showing the most important use cases of GPM-API. These tutorial are also available as Jupyter Notebooks and in Google Colab:
The associated python scripts are also provided in the tutorial
folder.
Requirements:
Optional
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.