Skip to content

Commit

Permalink
Raster fix for dials.stills_process (#2128)
Browse files Browse the repository at this point in the history
* Fix raster scans for dials.stills_process

Two specific fixes:
- In _determine_max_memory_needed, check if the scan is a still, in which case its bbox z coordinates should be 0, 1
- In dials.import, in the manual geometry updater, fix convert_sequences_to_stills. This was likely fallout from cctbx/dxtbx#438, where the imageset indices were redone to use less memory.

Fixes #2127

Co-authored-by: James Beilsten-Edmands <jbeilstenedmands@gmail.com>
  • Loading branch information
phyy-nx and jbeilstenedmands committed Oct 7, 2022
1 parent c87d280 commit 351b9ef
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
1 change: 1 addition & 0 deletions newsfragments/2128.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
``dials.stills_process`` could crash for raster scans of stills.
9 changes: 3 additions & 6 deletions src/dials/algorithms/integration/integrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -1234,13 +1234,10 @@ def _determine_max_memory_needed(experiments, reflections):
for j, experiment in enumerate(experiments):
if experiment.imageset == imageset:
subset.extend(reflections.select(reflections["id"] == j))
try:
if imageset.get_scan():
frame0, frame1 = imageset.get_scan().get_array_range()
else:
raise RuntimeError
except RuntimeError: # catch DXTBX_ASSERT if no scan in imageset
if not imageset.get_scan() or imageset.get_scan().is_still():
frame0, frame1 = (0, len(imageset))
else:
frame0, frame1 = imageset.get_scan().get_array_range()
flatten = self.params.integration.integrator == "flat3d"
max_needed = max(
max_memory_needed(subset, frame0, frame1, flatten),
Expand Down
2 changes: 1 addition & 1 deletion src/dials/command_line/dials_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ def __call__(self, imageset):

if self.params.geometry.convert_sequences_to_stills:
imageset = ImageSetFactory.imageset_from_anyset(imageset)
for j in imageset.indices():
for j in range(len(imageset)):
imageset.set_scan(None, j)
imageset.set_goniometer(None, j)
if not isinstance(imageset, ImageSequence):
Expand Down

0 comments on commit 351b9ef

Please sign in to comment.