SafeguardedCodec( codec=codec, # any numcodecs codec safeguards=[ dict( kind="qoi_eb_stencil", # u and v are extracted from the stacked dimension qoi=|\qu|0.5 * (square(X[0]) + square(X[1]))|\qu|, type="abs", eb=1.0, neighbourhood=[ # [u, v]: stacked variables dict(axis=0, before=0, after=1, boundary="valid"), ], ) ], )