From 16f9791cecba87b7502ddb10327470a9dfc68fa0 Mon Sep 17 00:00:00 2001 From: David Waterman Date: Tue, 1 Oct 2024 14:38:54 +0100 Subject: [PATCH] Lack of dx, dy maps affects processing, so be strict about loading them. If they are expected but not loaded, then fail. Thanks to @ndevenish for the suggestion. --- src/dxtbx/model/experiment_list.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/dxtbx/model/experiment_list.py b/src/dxtbx/model/experiment_list.py index 5dd9b3b10..7e717ea07 100644 --- a/src/dxtbx/model/experiment_list.py +++ b/src/dxtbx/model/experiment_list.py @@ -334,6 +334,14 @@ def _imageset_from_imageset_data(self, imageset_data, models): dx_filename, dx = self._load_pickle_path(imageset_data, "dx") dy_filename, dy = self._load_pickle_path(imageset_data, "dy") + # If dx, dy maps are expected then they must be loaded even when + # self._check_format == False, because they affect the operation of + # programs (dials.index, dials.refine) that do not need the image data. + if (dx_filename or dy_filename) and not all((dx, dx)): + raise RuntimeError( + f"dx ({dx_filename}) and dy ({dy_filename}) maps are expected" + ) + if imageset_data["__id__"] == "ImageSet": imageset = self._make_stills(imageset_data, format_kwargs=format_kwargs) elif imageset_data["__id__"] == "ImageGrid":