[cctbxbb] map_to_asu - get the symop used to perform mapping

Nathaniel Echols nechols at lbl.gov
Thu Jun 20 10:59:33 PDT 2013


On Thu, Jun 20, 2013 at 7:34 AM,  <Graeme.Winter at diamond.ac.uk> wrote:
> In the progress of trying to (for reasons of my own) reproduce scale pack unmerged format files from flex arrays of Miller indices. map_to_asu is great, but it would be great to get the symop # used to perform the mapping as a result of this (it is computed somewhere in asu.h but not easily pushed out…)

It looks like the point at which the actual symop is used is at least
one layer of abstraction below the ASU mapping.  I think what happens
is that it generates a list of *all* symmetry-equivalent indices, then
picks the one that falls in the ASU.  In Python, this would look
something like this:

from cctbx import sgtbx
hkl = (-10, 1, -8)
sg = sgtbx.space_group_info("P6122").group()
asu = sgtbx.reciprocal_space_asu(sg.type())
for i_inv in range(sg.f_inv()) :
  for j_smx in range(sg.n_smx()) :
    rt_mx = sg(0, i_inv, j_smx)
    hkl_ = hkl * rt_mx.r()
    hkl_int = convert_to_integers(hkl_) # or fail if they're not integral
    if asu.is_inside(hkl_int) :
      save_this_symop()

This is loosely derived from cctbx/miller/sym_equiv.cpp and
cctbx/miller/asu.cpp; I'm probably butchering some of the details.

-Nat


More information about the cctbxbb mailing list