Skip to content

Instantly share code, notes, and snippets.

@ndevenish
Created May 1, 2018 15:52
Show Gist options
  • Save ndevenish/edaa2b8cb3479cb0ae95ad2fdbd3cc72 to your computer and use it in GitHub Desktop.
Save ndevenish/edaa2b8cb3479cb0ae95ad2fdbd3cc72 to your computer and use it in GitHub Desktop.
simple script to try to read small indexed reflections out of a file
import cPickle as pickle
from scitbx.array_family import flex
with open("indexed.pickle") as f:
ref = pickle.load(f)
indexed = ref.get_flags(ref.flags.indexed)
intensity_one = flex.bool([x["intensity.sum.value"] == 1 for x in ref])
size_one_shoebox = flex.bool([sum(x["shoebox"].size()) == 3 for x in ref])
# TypeError: No to_python (by-value) converter found for C++ type: dials::model::Shoebox<float>
# No to_python (by-value) converter found for C++ type: dials::model::Shoebox<float>
red = ref.select(indexed & intensity_one & size_one_shoebox)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment