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 Emily Laiken's merradownload, which builds on Jan Urbansky's opendap_download and 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.2.tar.gz (8.2 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.2-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: merradownload-1.0.2.tar.gz
  • Upload date:
  • Size: 8.2 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.2.tar.gz
Algorithm Hash digest
SHA256 81ad02da5eb8a04a3c1b6409839f43769fcec80a86c4f91a80243ef57c53580c
MD5 33bbaac4b4e817a649525fdbb7bd790f
BLAKE2b-256 f7a0122688e69d003af2f3611b7bf44acd9ebab1a0525a64de0520fe86797d0d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: merradownload-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 7.9 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 72ea0aade6db103ac4a767d4cdd30e898d795989f752986b65149d4cbf91141b
MD5 aa0de2bafb682a6a985cda65c9b82b01
BLAKE2b-256 9dfc5fba4e8ce575b614274ed23fba9b0138239d6bb2beb31d913b24db781b52

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