Commit 4cd8f500 authored by Tomas Farago's avatar Tomas Farago
Browse files

[converter] check NXdetector dimension prior to consider it as a valid detector

parent 693778ce
......@@ -872,7 +872,9 @@ def get_nx_detectors(node: h5py.Group) -> tuple:
for _, subnode in node.items():
if isinstance(subnode, h5py.Group) and "NX_class" in subnode.attrs:
if subnode.attrs["NX_class"] == "NXdetector":
if "data" in subnode and hasattr(subnode["data"], "ndim"):
if subnode["data"].ndim == 3:
nx_detectors = sorted(nx_detectors, key=lambda det:
return tuple(nx_detectors)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment