Skip to content

Commit

Permalink
Modified branching to Laue refinement methods to depend on Experiment…
Browse files Browse the repository at this point in the history
…Type.
  • Loading branch information
toastisme committed Aug 1, 2024
1 parent b6bd348 commit 7e2dc39
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
1 change: 1 addition & 0 deletions newsfragments/XXX.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Modified branching to Laue refinement methods to check for ExperimentType first.
2 changes: 1 addition & 1 deletion src/dials/algorithms/refinement/reflection_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ def from_parameters_reflections_experiments(
flex.set_random_seed(params.random_seed)
logger.debug("Random seed set to %d", params.random_seed)

if "wavelength" in reflections:
if experiments.all_laue() or experiments.all_tof():
return ReflectionManagerFactory.laue_manager(
experiments, reflections, params
)
Expand Down
17 changes: 11 additions & 6 deletions src/dials/array_family/flex_ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import cctbx.array_family.flex
import cctbx.miller
import libtbx.smart_open
from dxtbx.model import ExperimentType
from scitbx import matrix

import dials.extensions.glm_background_ext
Expand Down Expand Up @@ -1331,12 +1332,16 @@ def map_centroids_to_reciprocal_space(
cctbx.array_family.flex.vec2_double(x, y)
)

if calculated and "wavelength_cal" in self and "s0_cal" in self:
wavelength = self["wavelength_cal"].select(sel)
s0 = self["s0_cal"].select(sel)
elif "wavelength" in self and "s0" in self:
wavelength = self["wavelength"].select(sel)
s0 = self["s0"].select(sel)
if (
expt.get_type() == ExperimentType.LAUE
or expt.get_type() == ExperimentType.TOF
):
if calculated and "wavelength_cal" in self and "s0_cal" in self:
wavelength = self["wavelength_cal"].select(sel)
s0 = self["s0_cal"].select(sel)
elif "wavelength" in self and "s0" in self:
wavelength = self["wavelength"].select(sel)
s0 = self["s0"].select(sel)
else:
wavelength = expt.beam.get_wavelength()
s0 = expt.beam.get_s0()
Expand Down

0 comments on commit 7e2dc39

Please sign in to comment.