import earthaccess
import xarray as xr
Xarray with h5netcdf and earthaccess
def load_data():
= "podaac-ops-cumulus-protected"
bucket = "MUR-JPL-L4-GLOB-v4.1/20020601090000-JPL-L4_GHRSST-SSTfnd-MUR-GLOB-v02.0-fv04.1.nc"
input_uri = "analysed_sst"
variable = f"s3://{bucket}/{input_uri}"
src
earthaccess.login()= earthaccess.get_s3fs_session(daac="PODAAC")
fs = {
fsspec_caching "cache_type": "none",
}with fs.open(src, **fsspec_caching) as f:
= xr.open_dataset(f, engine="h5netcdf", mask_and_scale=True)[variable]
da return da.load()
if __name__ == "__main__":
= load_data() da