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
Example notebook to download weather case studies
-
GES DISC - cbattisto
- Subject Matter Expert

- Posts: 29
- Joined: Wed Feb 16, 2022 4:38 pm America/New_York
Re: Example notebook to download weather case studies
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