Skip to content

Commit

Permalink
joint indexing=False for stills experiments (#2605)
Browse files Browse the repository at this point in the history
* Set `joint_indexing=Auto` and resolve to `False` for stills, `True` for scans
* Alert the user when `joint_indexing=Auto` is resolved
* Raise an error if there is a mixture of scans and stills.
  • Loading branch information
dagewa committed Mar 13, 2024
1 parent 4a251d1 commit ea4fc09
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
3 changes: 3 additions & 0 deletions newsfragments/2605.bugfix
@@ -0,0 +1,3 @@
``dials.index``: Set joint indexing to be automatically defined by default:
``True`` for rotation data, ``False`` for still shots. This default can be
overridden by the user by explicit use of ``joint_indexing=``.
15 changes: 14 additions & 1 deletion src/dials/command_line/index.py
Expand Up @@ -10,6 +10,7 @@

import iotbx.phil
from dxtbx.model.experiment_list import ExperimentList
from libtbx import Auto

from dials.algorithms.indexing import DialsIndexError, indexer
from dials.array_family import flex
Expand Down Expand Up @@ -69,7 +70,7 @@
.type = ints(size=2)
.multiple = True
joint_indexing = True
joint_indexing = Auto
.type = bool
}
Expand Down Expand Up @@ -167,6 +168,18 @@ def index(experiments, reflections, params):
if params.indexing.image_range:
reflections = slice_reflections(reflections, params.indexing.image_range)

if params.indexing.joint_indexing is Auto:
if all(e.is_still() for e in experiments):
params.indexing.joint_indexing = False
logger.info("joint_indexing=False has been set for stills experiments")
elif all(not e.is_still() for e in experiments):
params.indexing.joint_indexing = True
logger.info("joint_indexing=True has been set for scans experiments")
else:
raise ValueError(
"Unable to set joint_indexing automatically for a mixture of stills and scans experiments"
)

if len(experiments) == 1 or params.indexing.joint_indexing:
indexed_experiments, indexed_reflections = _index_experiments(
experiments,
Expand Down

0 comments on commit ea4fc09

Please sign in to comment.