Skip to content

Commit

Permalink
Merge pull request #40 from toastisme/tof_mtz
Browse files Browse the repository at this point in the history
Enabled export mtz for tof data.
  • Loading branch information
toastisme committed Dec 14, 2023
2 parents eb3646c + 8e35c8d commit 6b3ea42
Show file tree
Hide file tree
Showing 2 changed files with 364 additions and 21 deletions.
48 changes: 32 additions & 16 deletions src/dials/command_line/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ def export_mtz(params, experiments, reflections):

_check_input(experiments, reflections)

from dials.util.export_mtz import export_mtz
from dials.util.export_mtz import export_mtz, export_mtz_tof

# Handle case where user has passed data before integration
if (
Expand All @@ -359,21 +359,37 @@ def export_mtz(params, experiments, reflections):
"Data appears to be unscaled, setting mtz.hklout = 'integrated.mtz'"
)

m = export_mtz(
reflection_table,
experiments,
intensity_choice=params.intensity,
filename=filename,
best_unit_cell=params.mtz.best_unit_cell,
partiality_threshold=params.mtz.partiality_threshold,
combine_partials=params.mtz.combine_partials,
min_isigi=params.mtz.min_isigi,
filter_ice_rings=params.mtz.filter_ice_rings,
d_min=params.mtz.d_min,
force_static_model=params.mtz.force_static_model,
crystal_name=params.mtz.crystal_name,
project_name=params.mtz.project_name,
)
if experiments.all_tof_experiments():
m = export_mtz_tof(
reflection_table,
experiments,
intensity_choice=params.intensity,
filename=filename,
best_unit_cell=params.mtz.best_unit_cell,
partiality_threshold=params.mtz.partiality_threshold,
combine_partials=params.mtz.combine_partials,
min_isigi=params.mtz.min_isigi,
filter_ice_rings=params.mtz.filter_ice_rings,
d_min=params.mtz.d_min,
crystal_name=params.mtz.crystal_name,
project_name=params.mtz.project_name,
)
else:
m = export_mtz(
reflection_table,
experiments,
intensity_choice=params.intensity,
filename=filename,
best_unit_cell=params.mtz.best_unit_cell,
partiality_threshold=params.mtz.partiality_threshold,
combine_partials=params.mtz.combine_partials,
min_isigi=params.mtz.min_isigi,
filter_ice_rings=params.mtz.filter_ice_rings,
d_min=params.mtz.d_min,
force_static_model=params.mtz.force_static_model,
crystal_name=params.mtz.crystal_name,
project_name=params.mtz.project_name,
)

summary = StringIO()
m.show_summary(out=summary)
Expand Down
Loading

0 comments on commit 6b3ea42

Please sign in to comment.