Skip to main content

Download and process MERRA-2 meteorological data from NASA GES DISC

Project description

merradownload

A Python package for downloading, cleaning, and aggregating meteorological data from NASA's MERRA-2 database.

Adapted from the Open Power System Data notebook. Edited and maintained by Anemona.

Installation

pip install merradownload

Prerequisites: NASA Earthdata account

  1. Register at https://urs.earthdata.nasa.gov/
  2. Go to Applications → Authorized Apps → Approve More Applications
  3. Approve NASA GESDISC DATA ARCHIVE

Quick start

Python API

from opendap_download.multi_processing_download import DownloadManager

dm = DownloadManager(
    username='your_earthdata_username',
    password='your_earthdata_password',
    links=['https://...'],       # list of OPeNDAP query URLs
    download_path='data/output', # where to save .nc4 files
)
dm.start_download(nr_of_threads=5)

CLI

merradownload \
  --username YOUR_USER \
  --password YOUR_PASS \
  --urls-file urls.txt \
  --output-dir data/output \
  --threads 5

urls.txt should contain one OPeNDAP query URL per line. See examples/merra_scraping.py for how to generate these URLs for a given location, year range, and variable set.

Example script

examples/merra_scraping.py shows a complete end-to-end workflow: coordinate translation → URL generation → download → xarray/pandas processing → CSV and plot outputs.

Dependencies

Package Purpose
requests HTTP downloads
urllib3 Retry logic
tqdm Progress bar
pyyaml Optional credential file support

Processing dependencies (used in the example script only, not required by the core package):

pip install numpy pandas xarray netCDF4 matplotlib

Features

  • Parallel downloads via ThreadPoolExecutor
  • Automatic retry on HTTP 5xx errors (3 retries, exponential backoff)
  • Skips already-downloaded files — safe to resume interrupted runs
  • Progress bar
  • Credential file support (yaml)

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

merradownload-1.0.0.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

merradownload-1.0.0-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file merradownload-1.0.0.tar.gz.

File metadata

  • Download URL: merradownload-1.0.0.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for merradownload-1.0.0.tar.gz
Algorithm Hash digest
SHA256 12481aed7d6c195908608a80983be06727c078e9caeb9224d9d0db56578dd8eb
MD5 7bcff238dd9643dbba0a255d7c20a7c4
BLAKE2b-256 eeee7e9dbcd6e61e6d62534582dfe7f4861a8134e78d8b403d1ac6338a007e30

See more details on using hashes here.

File details

Details for the file merradownload-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: merradownload-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for merradownload-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8ac5620e5e27309457e62a033e1d58e46ff1626f333bc7f2508a494c12e03fe0
MD5 8806cc09e821b99f8304ddc6d0708b47
BLAKE2b-256 eee0f518177cbdd839ce1c3d5fa63224bc4c2fd81f8b9aed5f118f66c631b94d

See more details on using hashes here.

Supported by

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