Created
May 9, 2023 09:09
-
-
Save graeme-winter/17d29d696c300f8127db830e13c6c74d to your computer and use it in GitHub Desktop.
Map strong spots to reciprocal space and print x, y, z positions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Print reciprocal space positions from DIALS strong reflections | |
# after spot finding | |
# | |
# Usage: | |
# | |
# dials.import (data) | |
# dials.find_spots imported.expt | |
# dials.python reciprocal_xyz.py strong.refl imported.expt | |
# | |
# Prints long list of x, y, z positions | |
import sys | |
from dials.array_family import flex | |
from dxtbx.model.experiment_list import ExperimentList | |
def map_reflections(reflection_file, experiment_file): | |
reflections = flex.reflection_table.from_file(reflection_file) | |
experiments = ExperimentList.from_file(experiment_file) | |
reflections.centroid_px_to_mm(experiments) | |
reflections.map_centroids_to_reciprocal_space(experiments) | |
rlp = reflections["rlp"] | |
for x, y, z in rlp: | |
print(f"{x} {y} {z}") | |
if __name__ == "__main__": | |
map_reflections(sys.argv[1], sys.argv[2]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment