Closed alexgleith closed 1 year ago
Thanks @alexgleith
Glad you were able to get HTTPS access working. We are planning add some instructions for HTTPS access to a future notebook. For other users in the meantime, the easiest way to access and work with an EMIT granule via HTTPS would be something similar to what you posted above:
# Use earthaccess library to login and retrieve a token
earthaccess.login()
# Provide granule URL
url = 'https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/EMITL2ARFL.001/EMIT_L2A_RFL_001_20220903T163129_2224611_012/EMIT_L2A_RFL_001_20220903T163129_2224611_012.nc'
# Get an https fsspec session
fs = earthaccess.get_fsspec_https_session()
# open granule using xarray or emit_xarray function from emit_tools.py
with fs.open(url) as file:
# Using xarray (only reads root group)
dataset = xarray.open_dataset(file)
# Or using the emit_xarray function
dataset = emit_xarray(file, ortho=False)
In order to load EMIT data over HTTP, it's best to use a
token
to authenticate usingfsspec
as documented in this comment.This below is working code, but it requires this attached fix.