<jupyter_start><jupyter_text>Setup plotting<jupyter_code>%matplotlib inline
from matplotlib import pyplot as plt
import numpy as np<jupyter_output><empty_output><jupyter_text>Probably not needed on your installAt the time of testing on my install there were some "future" warnings coming out of h5py library.<jupyter_code>import warnings
warnings.filterwarnings('ignore', module="h5py")<jupyter_output><empty_output><jupyter_text>Main part starts now<jupyter_code>from mpnetcdf4 import nc_open
fname, measurements = './sample.nc', ['red', 'green', 'blue']
src_roi = np.s_[:, :400, 2000:2400] # Select region of interest, None or omitted -- all

with nc_open(fname, num_workers=2) as f:
    out = f.read(measurements=measurements, src_roi=src_roi)
    
print("Read bands:", list(out))<jupyter_output>Read bands: ['red', 'green', 'blue']<jupyter_text>Plot the resultWe assume test data has time,y,x dimension, we plotting first time slice<jupyter_code>fig = plt.figure(figsize=(9,3))
t_idx = 0
ax = fig.subplots(1, len(measurements))

for ax,b in zip(ax, measurements):
    ax.imshow(out[b][t_idx])
    
    ax.set_title(b)
    ax.xaxis.set_visible(False)
    ax.yaxis.set_visible(False)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12263374485596708, 'fraction_numerical': 0.015637860082304528, 'mean_word_length': 6.506172839506172, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 16, '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': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '285005', 'license': 'Apache-2.0', 'n_tokens_mistral': 449, 'n_tokens_neox': 436, 'n_words': 105, 'path': 'notebooks/simple-example.ipynb', 'repo_name': 'GeoscienceAustralia/dea-netcdf-benchmark', 'size': '1215'}