This is an alternative to using the netCDF subsets from AppEEARS. This notebook shows you how to query the LPDAAC inventory service for lists of HDF urls, write them to text file, download with wget or curl (must have an Earthdata account), and put through the same workflow outlined in the earlier notebooks.
Go to the inventory service page and figure out the query you need to get a list of HDFs.
I know there to be two MODIS tiles that fully contain the state of Florida (h10v05, h10v06), so I queried random points spread apart a bit to make sure I got both tiles. I covered this briefly in 0_Introduction
FIND this.. i did this convert really nicely once with shell/GDAL 2.x piping. old hdds in ut115.
hdfeos2nc.py
does this.
import sys,json,requests
response = requests.get(
"https://lpdaacsvc.cr.usgs.gov/services/inventory?"
"product=MCD19A1&"
"version=6&"
"longitude=-87.4951&"
"latitude=25.00597&"
"return=url&"
"output=text&"
"julianrange=0-365&"
"years=2018")
if response.status_code==200:
HDF = response.text
print("HDFs:"); print(HDF)
else:
print(response.text)
HDFs:
import xarray as xr
#xr.open_dataset("data/hdf/MCD43A1.A2000055.h17v06.006.2016101152056.hdf")