#!/usr/bin/env python # coding: utf-8 # # Open a specific year of kerchunked data from NWM 1km CONUS grid # In[1]: import fsspec import xarray as xr # In[2]: fs_json = fsspec.filesystem('s3', requester_pays=True, skip_instance_cache=True) # In[3]: year_list = fs_json.glob('esip-qhub/noaa/nwm/grid1km/combined_????.json') # In[4]: year_list = [f's3://{y}' for y in year_list] # In[5]: t_opts = {'requester_pays':True, 'skip_instance_cache':True} r_opts = {'anon':True} fs = fsspec.filesystem("reference", fo=year_list[0], target_options=t_opts, remote_protocol='s3', remote_options=r_opts) m = fs.get_mapper("") ds = xr.open_dataset(m, engine="zarr", chunks={}, backend_kwargs=dict(consolidated=False)) # In[6]: ds # In[ ]: