Skip to content

Commit

Permalink
Lack of dx, dy maps affects processing, so be strict about loading
Browse files Browse the repository at this point in the history
them. If they are expected but not loaded, then fail.

Thanks to @ndevenish for the suggestion.
  • Loading branch information
dagewa committed Oct 1, 2024
1 parent 2b5c90b commit 16f9791
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/dxtbx/model/experiment_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down

0 comments on commit 16f9791

Please sign in to comment.