From 5206136745edb244aec1752ec568202498dacd4f Mon Sep 17 00:00:00 2001 From: Graeme Winter Date: Fri, 21 Nov 2025 12:06:12 -0600 Subject: [PATCH 1/5] Work around missing dependencies in FormatNXmxEigerFilewriter Make assumptions that the fast depends on the slow which depends on module offset, and none of these add rotations into the mix (fair, for a DECTRIS detector) Resolves #865 --- newsfragments/XXX.bugfix | 1 + src/dxtbx/nexus/__init__.py | 12 +++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) create mode 100644 newsfragments/XXX.bugfix diff --git a/newsfragments/XXX.bugfix b/newsfragments/XXX.bugfix new file mode 100644 index 000000000..f676107ab --- /dev/null +++ b/newsfragments/XXX.bugfix @@ -0,0 +1 @@ +``FormatNXmxEigerFilewriter``: if dependencies missing, make some (prpbably valid) assumptions about dependencies between fast, slow pixel directions and module offset diff --git a/src/dxtbx/nexus/__init__.py b/src/dxtbx/nexus/__init__.py index 8dc71d88c..b760ef421 100644 --- a/src/dxtbx/nexus/__init__.py +++ b/src/dxtbx/nexus/__init__.py @@ -357,7 +357,7 @@ def equipment_component_key(dependency): # Flat detector model # Apply any rotation components of the dependency chain to the fast axis - assert module.fast_pixel_direction.depends_on is not None + # assert module.fast_pixel_direction.depends_on is not None fast_axis_depends_on = [ t for t in nxmx.get_dependency_chain( @@ -372,7 +372,7 @@ def equipment_component_key(dependency): fast_axis = MCSTAS_TO_IMGCIF @ R @ module.fast_pixel_direction.vector # Apply any rotation components of the dependency chain to the slow axis - assert module.slow_pixel_direction.depends_on is not None + # assert module.slow_pixel_direction.depends_on is not None slow_axis_depends_on = [ t for t in nxmx.get_dependency_chain( @@ -388,9 +388,11 @@ def equipment_component_key(dependency): # Apply all components of the dependency chain to the module offset to get the # dxtbx panel origin - dependency_chain = nxmx.get_dependency_chain( - module.fast_pixel_direction.depends_on - ) + if module.fast_pixel_direction.depends_on is not None: + top = module.fast_pixel_direction.depends_on + else: + top = module.module_offset.depends_on + dependency_chain = nxmx.get_dependency_chain(top) A = nxmx.get_cumulative_transformation(dependency_chain) origin = MCSTAS_TO_IMGCIF @ ( From 1abd8e75498e6c03f1551eacec91cdca54d0ba6d Mon Sep 17 00:00:00 2001 From: DiamondLightSource-build-server Date: Fri, 21 Nov 2025 18:07:32 +0000 Subject: [PATCH 2/5] Rename newsfragments/XXX.bugfix to newsfragments/866.bugfix --- newsfragments/{XXX.bugfix => 866.bugfix} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename newsfragments/{XXX.bugfix => 866.bugfix} (100%) diff --git a/newsfragments/XXX.bugfix b/newsfragments/866.bugfix similarity index 100% rename from newsfragments/XXX.bugfix rename to newsfragments/866.bugfix From 0898b31c9cca9199a02d03b413b41f065505409f Mon Sep 17 00:00:00 2001 From: Graeme Winter Date: Mon, 16 Feb 2026 11:23:43 -0600 Subject: [PATCH 3/5] Respect Omega / Omega_increment In addition to allowing Start_angle / Angle_increment to define the scan information: this is what is in use at APS S21. --- src/dxtbx/format/FormatCBFMiniPilatus.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/dxtbx/format/FormatCBFMiniPilatus.py b/src/dxtbx/format/FormatCBFMiniPilatus.py index f3fe5b49f..03e7f855a 100644 --- a/src/dxtbx/format/FormatCBFMiniPilatus.py +++ b/src/dxtbx/format/FormatCBFMiniPilatus.py @@ -181,8 +181,12 @@ def _scan(self): exposure_time = float(self._cif_header_dictionary["Exposure_period"].split()[0]) - osc_start = float(self._cif_header_dictionary["Start_angle"].split()[0]) - osc_range = float(self._cif_header_dictionary["Angle_increment"].split()[0]) + if "Start_angle" in self._cif_header_dictionary: + osc_start = float(self._cif_header_dictionary["Start_angle"].split()[0]) + osc_range = float(self._cif_header_dictionary["Angle_increment"].split()[0]) + elif "Omega" in self._cif_header_dictionary: + osc_start = float(self._cif_header_dictionary["Omega"].split()[0]) + osc_range = float(self._cif_header_dictionary["Omega_increment"].split()[0]) timestamp = get_pilatus_timestamp(self._cif_header_dictionary["timestamp"]) From 900bb74415cf9cef1f0d3f95e25ca581980d0f56 Mon Sep 17 00:00:00 2001 From: Graeme Winter Date: Mon, 16 Feb 2026 11:25:37 -0600 Subject: [PATCH 4/5] News --- newsfragments/XXX.bugfix | 1 + 1 file changed, 1 insertion(+) create mode 100644 newsfragments/XXX.bugfix diff --git a/newsfragments/XXX.bugfix b/newsfragments/XXX.bugfix new file mode 100644 index 000000000..7d49bbdae --- /dev/null +++ b/newsfragments/XXX.bugfix @@ -0,0 +1 @@ +Support Pilatus format for Sector 21 / LS-CAT at the APS. From 77f91b87bdf9f4f52d7c33b1e67889479c97ed7a Mon Sep 17 00:00:00 2001 From: DiamondLightSource-build-server Date: Mon, 16 Feb 2026 17:27:32 +0000 Subject: [PATCH 5/5] Rename newsfragments/XXX.bugfix to newsfragments/877.bugfix --- newsfragments/{XXX.bugfix => 877.bugfix} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename newsfragments/{XXX.bugfix => 877.bugfix} (100%) diff --git a/newsfragments/XXX.bugfix b/newsfragments/877.bugfix similarity index 100% rename from newsfragments/XXX.bugfix rename to newsfragments/877.bugfix