silx icon indicating copy to clipboard operation
silx copied to clipboard

[silx.io] Provide a way to get sorted/ordered entries im HDF5 files according to nexus convention

Open kif opened this issue 3 months ago • 0 comments

Even though HDF5 does not provide the feature.

For entries, it could look something like:

import h5py, silx.io
h=silx.io.open("/mnt/data/ID27/CeO2_33keV_0001/CeO2_33keV_0001.h5")
keys = list(h.keys())
keys.sort(key=lambda x:h[x].get("start_time")[()] if isinstance(h[x], h5py.Group) else None)
{i:h[i] for i in keys}

kif avatar Sep 02 '25 16:09 kif