Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions newsfragments/785.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
``NXmx``: require existence of /entry/data/data virtual data set to support NXmx data, fall back to FormatNexus if missing (for e.g. DECTRIS file writer data)
17 changes: 10 additions & 7 deletions src/dxtbx/format/FormatNXmx.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,16 @@ class FormatNXmx(FormatNexus):
@staticmethod
def understand(image_file):
with h5py.File(image_file) as handle:
return bool(
[
entry
for entry in nxmx.find_class(handle, "NXentry")
if "definition" in entry
and nxmx.h5str(entry["definition"][()]) == "NXmx"
]
return (
bool(
[
entry
for entry in nxmx.find_class(handle, "NXentry")
if "definition" in entry
and nxmx.h5str(entry["definition"][()]) == "NXmx"
]
)
and "/entry/data/data" in handle
)

def __init__(self, image_file, **kwargs):
Expand Down
Loading