Example notebook to download weather case studies

Use this Forum to find information on, or ask a question about, NASA Earth Science data.
Post Reply
mapes
Posts: 3
Joined: Wed Sep 20, 2023 1:32 pm America/New_York
Answers: 0

Example notebook to download weather case studies

by mapes » Mon Dec 22, 2025 3:45 pm America/New_York

Here is a notebook that downloads many MERRA-2 fields and IMERG data for weather case studies (lat/lon/time boxes) specified by the user in a structured list. It was written largely by Google Gemini but with plenty of debugging needed, so I am posting here.

It uses THREDDS aggregations by month, which unfortunately do not pass the user's credentials properly when multiple such URLs are opened via xarray open_mfdataset(). Hours and hours wasted learning this of course. The authentication regime is hell.

https://mpocanes.github.io/M2_IMERG_MERGIR_downloader_Gemini.html

Filters:

GES DISC - cbattisto
Subject Matter Expert
Subject Matter Expert
Posts: 29
Joined: Wed Feb 16, 2022 4:38 pm America/New_York
Answers: 0

Re: Example notebook to download weather case studies

by GES DISC - cbattisto » Mon Dec 29, 2025 2:38 pm America/New_York

We've been recommending that Python users try the enterprise-enabled subsetting service accessed via the harmony-py library. This library requires only a .netrc file and does not need the additional prerequisite files or specific NetCDF library versions required by OPeNDAP servers such as THREDDS. Here is our new tutorial demonstrating subsetting through this service: https://disc.gsfc.nasa.gov/information/howto?title=How%20to%20Subset%20and%20Download%20Level%202,%203,%20and%204%20GES%20DISC%20Data%20Using%20Python

Post Reply