Skip to content
Draft
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/XXX.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add support for DECTRIS PILATUS 4 4M, using same systems as used for EIGER.
21 changes: 13 additions & 8 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 Expand Up @@ -115,7 +118,9 @@ def _start(self):
self._static_mask = mask_cache.store_unique_and_get(
dxtbx.nexus.get_static_mask(nxdetector)
)
self._bit_depth_readout = nxdetector.bit_depth_readout
self._bit_depth_readout = max(
nxdetector.bit_depth_readout, nxdetector.bit_depth_image
)

if self._scan_model:
self._num_images = len(self._scan_model)
Expand Down
7 changes: 6 additions & 1 deletion src/dxtbx/format/FormatNXmxEigerFilewriter.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@
(4371, 4150),
}
)

# And add PILATUS 4 module sizes
KNOWN_MODULE_SLOW_FAST_DIMS.update(
{
(2180, 2073),
}
)
KNOWN_MODULE_FAST_SLOW_DIMS = {shape[::-1] for shape in KNOWN_MODULE_SLOW_FAST_DIMS}


Expand Down
Loading