silx
silx copied to clipboard
[silx.io] Provide a way to get sorted/ordered entries im HDF5 files according to nexus convention
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}