<jupyter_start><jupyter_text>Explore the National Water Model Reanalysis v2.1  CASE 1: each HDF file contains chunks in multiple variables; doesn't need h5py370k files.<jupyter_code>%%time
import fsspec
import xarray as xr
mapper = fsspec.get_mapper(
    "reference://",
    fo="s3://esip-qhub-public/noaa/nwm/nwm_reanalysis.json.zst",
    target_options={
        "anon": True,
        "compression": "zstd"
    },
    remote_options={"anon": True}
)
ds = xr.open_dataset(mapper, engine="zarr", backend_kwargs={"consolidated": False})
ds
ds.nbytes/1e12, ds.streamflow.nbytes/1e12 # How many terabytes total/in a single variable<jupyter_output><empty_output><jupyter_text>Read and plot streamflow for a specific time The local National Weather Service office in Houston observed all-time record daily rainfall accumulations on both August 26 and 27, measured at 14.4 in (370 mm) and 16.08 in (408 mm) respectively<jupyter_code>import hvplot.pandas
import geoviews as gv
from holoviews.operation.datashader import rasterize
import cartopy.crs as ccrs
import numpy as np
import pandas as pd
ds1 = ds.sel(time='2017-08-27 18:00:00', method='nearest')
var = 'streamflow'
df = ds1[var].to_pandas().to_frame()
date_title = pd.to_datetime(ds1.time.values).strftime('%Y-%m-%d %H-%M-%D')
date_title = f'{var}: {date_title}'
date_title
df = df.assign(latitude=ds.latitude)
df = df.assign(longitude=ds.longitude)
df.rename(columns={0: var}, inplace=True)
p = df.hvplot.points(x='longitude', y='latitude', geo=True,
                     c=var, colorbar=True, size=14, label=date_title)
g = rasterize(p, aggregator='mean', x_sampling=0.02, 
                y_sampling=0.02, width=500).opts(tools=['hover'], 
                aspect='equal', logz=True, cmap='viridis', clim=(1e-2, np.nan))
g * gv.tile_sources.OSM<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13402625820568928, 'fraction_numerical': 0.03391684901531729, 'mean_word_length': 4.751572327044025, 'pattern_counts': {'":': 4, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '359741', 'license': 'MIT', 'n_tokens_mistral': 700, 'n_tokens_neox': 650, 'n_words': 156, 'path': 'examples/nwm.ipynb', 'repo_name': 'gadomski/kerchunk', 'size': '1828'}