Skip to main content

Deployment PyPI Conda
Activity PyPI Downloads Conda Downloads
Python Versions Python Versions
Supported Systems Linux macOS Windows
Project Status Project Status
Build Status Tests Lint Docs
Linting Black Ruff Codespell
Code Coverage Coveralls Codecov
Code Quality Codefactor Codacy Codescene
License License
Community Slack GitHub Discussions
Citation DOI

Slack | Documentation

🚀 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

gpm.available_products(product_types="RS")  # research products
gpm.available_products(product_types="NRT")  # near-real-time products

Before starting using GPM-API, we highly suggest to save into a configuration file:

  1. your credentials to access the NASA Precipitation Processing System (PPS) servers
  2. 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

username_pps = "<your PPS username>"  # likely your mail
password_pps = "<your PPS password>"  # likely your mail
base_dir = "<path/to/directory/GPM"  # path to the directory where to download the data
gpm.define_configs(
    username_pps=username_pps, password_pps=password_pps, base_dir=base_dir
)

# You can check that the config file has been correctly created with:
configs = gpm.read_configs()
print(configs)

📥 Download GPM data

Now you can either start to download GPM data within python:

import gpm
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.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

ds = gpm.open_granule_dataset(<path_to_granule>)
# or
dt = gpm.open_granule_datatree(<path_to_granule>)

while multiple granules over a specific time period can be opened using:

import gpm
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.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 features, please read the software documentation available at https://gpm-api.readthedocs.io/en/latest/.

If you are new to GPM-API, we recommend starting with the following pages:

All GPM-API tutorials are available as Jupyter Notebooks in the tutorial directory.


🛠️ Installation

conda

GPM-API can be installed via conda on Linux, Mac, and Windows. Install the package by typing the following command in the 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.

pip

GPM-API can be installed also via pip on Linux, Mac, and Windows. On Windows you can install WinPython to get Python and pip running. Prior installation of GPM-API, try to install to cartopy>=0.21.0 package to ensure there are not GEOS library version incompatibilities. If you can't solve the problems and install cartopy with pip, you should install at least cartopy with conda using conda install cartopy>=0.21.0.

Then, install the GPM-API package by typing the following command in the terminal:

pip install gpm-api

To install the latest development version via pip, see the documentation.

💭 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

If you are using GPM-API in your publication please cite our Zenodo repository:

Ghiggi Gionata. 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.

Metadata

Release files for gpm-api 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gpm-api 0.4.1
File Size Uploaded
gpm_api-0.4.1.tar.gz 328.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gpm-api 0.4.1
File Interpreter ABI Platform
gpm_api-0.4.1-py3-none-any.whl Python 3 none any Details

Total release size: 753.0 kB

Release files / gpm_api-0.4.1.tar.gz

Download URL gpm_api-0.4.1.tar.gz
Size 328.9 kB
Tags Source
SHA-256 checksum
How to use checksums
edc17f3adf81657cca28d7fb871ea269157d94b1628aa37a3dff855db8b77781
BLAKE2b-256 checksum
How to use checksums
7d1e5599d47fcddee18ded5469d3c61023e3ae0d2f1d464248a1954f50cb2435
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / gpm_api-0.4.1-py3-none-any.whl

Download URL gpm_api-0.4.1-py3-none-any.whl
Size 424.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5108b0628c05498d6bba4c958e6f903c3eab25006c2af687509ba347f1a136e2
BLAKE2b-256 checksum
How to use checksums
dfec23b3b5f2d8d2b180de5f531e4be02dfcd1b6d179a1d2a69e365dccd52e6b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

This release

0.4.1 This release

2 release files

0.4.0

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.15

2 release files

0.2.11

2 release files

0.2.10

2 release files

0.2.9

2 release files

0.2.8

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page