Skip to content

Commit

Permalink
A few more updates
Browse files Browse the repository at this point in the history
  • Loading branch information
jbeilstenedmands committed Dec 19, 2023
1 parent a4c9db4 commit 0ea06b9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
5 changes: 5 additions & 0 deletions src/dials/command_line/search_beam_position.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
14 changes: 10 additions & 4 deletions src/dials/command_line/sequence_to_stills.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Split a sequence into a set of stills.
Split an indexed image sequence into a set of indexed stills.
Example:
Expand All @@ -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")
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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}")
Expand Down

0 comments on commit 0ea06b9

Please sign in to comment.