diff --git a/newsfragments/XXX.bugfix b/newsfragments/XXX.bugfix new file mode 100644 index 000000000..ec7635b59 --- /dev/null +++ b/newsfragments/XXX.bugfix @@ -0,0 +1 @@ +``dxtbx``: add fix for Eiger / NXmx data from i19-2 to correctly assign the image bit depth diff --git a/src/dxtbx/format/FormatNXmxDLSI19_2.py b/src/dxtbx/format/FormatNXmxDLSI19_2.py index 6d7f0c7ad..255330eb4 100644 --- a/src/dxtbx/format/FormatNXmxDLSI19_2.py +++ b/src/dxtbx/format/FormatNXmxDLSI19_2.py @@ -8,7 +8,7 @@ from libtbx import Auto from dxtbx.format.FormatNXmx import FormatNXmx -from dxtbx.format.FormatNXmxDLS import FormatNXmxDLS +from dxtbx.format.FormatNXmxDLS import FormatNXmxDLS, get_bit_depth_from_meta from dxtbx.masking import GoniometerMaskerFactory @@ -41,6 +41,11 @@ def __init__(self, image_file, **kwargs): """Initialise the image structure from the given file.""" self._dynamic_shadowing = self.has_dynamic_shadowing(**kwargs) super().__init__(image_file, **kwargs) + try: + self._bit_depth_readout = get_bit_depth_from_meta(self._meta) + except Exception: + self._bit_depth_readout = 16 + def get_goniometer_shadow_masker(self, goniometer=None): """Apply the dynamic mask for a diamond anvil cell with a 76° aperture."""