From 0ea06b9df122c9c1a3b9b78aa86e37ed2bc2f3de Mon Sep 17 00:00:00 2001 From: James Beilsten-Edmands <30625594+jbeilstenedmands@users.noreply.github.com> Date: Tue, 19 Dec 2023 10:09:01 +0000 Subject: [PATCH] A few more updates --- src/dials/command_line/search_beam_position.py | 5 +++++ src/dials/command_line/sequence_to_stills.py | 14 ++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/dials/command_line/search_beam_position.py b/src/dials/command_line/search_beam_position.py index 765997c481..32413b7e9e 100644 --- a/src/dials/command_line/search_beam_position.py +++ b/src/dials/command_line/search_beam_position.py @@ -499,6 +499,11 @@ def run(args=None): if params.nproc is libtbx.Auto: params.nproc = available_cores() + if any(experiments.crystals()): + raise Sorry( + "dials.search_beam_position can only be run on the results of spotfinding" + ) + imagesets = experiments.imagesets() # Split all the refln tables by ID, corresponding to the respective imagesets reflections = [ diff --git a/src/dials/command_line/sequence_to_stills.py b/src/dials/command_line/sequence_to_stills.py index bd41e8e792..8402f8b0d9 100644 --- a/src/dials/command_line/sequence_to_stills.py +++ b/src/dials/command_line/sequence_to_stills.py @@ -1,5 +1,5 @@ """ -Split a sequence into a set of stills. +Split an indexed image sequence into a set of indexed stills. Example: @@ -23,7 +23,7 @@ from dials.array_family import flex from dials.model.data import Shoebox from dials.util import show_mail_handle_errors -from dials.util.multi_dataset_handling import generate_experiment_identifiers +from dials.util.multi_dataset_handling import Expeditor, generate_experiment_identifiers from dials.util.options import ArgumentParser, reflections_and_experiments_from_files logger = logging.getLogger("dials.command_line.sequence_to_stills") @@ -89,7 +89,9 @@ def sequence_to_stills(experiments, reflections, params): reflections["entering"] = flex.bool(len(reflections), False) new_reflections["entering"] = flex.bool() else: - raise RuntimeError(f"Expected key not found in reflection table: {key}") + raise RuntimeError( + f"Expected key not found in reflection table: {key}. Is the input data indexed?" + ) for expt_id, experiment in enumerate(experiments): # Get the goniometer setting matrix @@ -261,9 +263,13 @@ def run(args=None, phil=phil_scope): reflections, experiments = reflections_and_experiments_from_files( params.input.reflections, params.input.experiments ) + experiments, reflections = Expeditor( + experiments, reflections + ).filter_experiments_with_crystals() + reflections = flex.reflection_table.concat(reflections) (new_experiments, new_reflections) = sequence_to_stills( - experiments, reflections, params + experiments, [reflections], params ) # Write out the output experiments, reflections logger.info(f"Saving stills experiments to {params.output.experiments}")