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.

Originally developed by Jan Urbansky, 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.1.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.1-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: merradownload-1.0.1.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.1.tar.gz
Algorithm Hash digest
SHA256 34d2a9aab0968ee1c1cf5c6edf49894ebb43338469767ad091b8d052071041c9
MD5 78e444668aa6fbe729e4c1f1f5de382a
BLAKE2b-256 1e1a90ae6d17e115b9b186a2acf582cbfc3ce5364e19e535b10c0e433252d7d7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: merradownload-1.0.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0c81ff1e6cd72aa8c3f57ae0932ef85d63b546d83c7807981a40adc4d53d2096
MD5 da651bb17e4ac41e68030edf2ca992fe
BLAKE2b-256 86abf9984f0a8b674c82c5dd9fb708a6f586ab615be93a9e61c3534ad9ce23c3

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