<div>Hi Graeme,</div><div><br></div><div>I think what you need are the direct space asu mappings tools - see cctbx/crystal/tst_ext.py or cctbx/regression/tst_direct_space_asu.py if you want to look at more of the tools that are available there.</div>
<div><br></div><div>If I understand correctly, something along the lines of this should do what you want:</div><div><br></div><div><div>    asu_mappings = xs.asu_mappings(buffer_thickness=0)</div><div>    xs_asu = xs.deep_copy_scatterers()</div>
<div>    frac = xs.unit_cell().fractionalize</div><div>    for i, mappings in enumerate(asu_mappings.mappings()):</div><div>      xs_asu.scatterers()[i].site = frac(mappings[0].mapped_site())</div><div>    for sc in xs_asu.scatterers():</div>
<div>      assert asu_mappings.asu().is_inside(sc.site)</div></div><div><br></div><div>Hope that helps,</div><div><br></div><div>Richard</div><br><div class="gmail_quote">On 11 February 2010 11:45,  <span dir="ltr">&lt;<a href="mailto:Graeme.Winter@diamond.ac.uk">Graeme.Winter@diamond.ac.uk</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">



<div>
<div><span><font face="Arial" size="2">Hi 
Folks,</font></span></div>
<div><span><font face="Arial" size="2"></font></span> </div>
<div><span><font face="Arial" size="2">Does anyone have a 
handy bit of CCTBX Python code which will take a spacegroup and unit cell, and a 
list of coordinates, and return the list of coordinates reduced to the 
asymmetric unit? I tried the &quot;dumb&quot; approach of:</font></span></div>
<div><span><font face="Arial" size="2"></font></span> </div>
<div><span><font face="Arial" size="2">use unit cell and 
sites -&gt; fractional sites</font></span></div>
<div><span><font face="Arial" size="2"></font></span> </div>
<div><span><font face="Arial" size="2">for site in 
fractional sites:</font></span></div>
<div><span><font face="Arial" size="2">  for smx 
in sg.smx()</font></span></div>
<div><span><font face="Arial" size="2">    for 
ltr in sg.ltr()</font></span></div>
<div><span><font face="Arial" size="2">      apply smx, ltr</font></span></div>
<div><span><font face="Arial" size="2">      is in asu? return</font></span></div>
<div><span><font face="Arial" size="2"></font></span> </div>
<div><span><font face="Arial" size="2">and it did not 
always return an answer, so there&#39;s clearly somthing I don&#39;t understand. 
Fractional coordinates are all in [0,1).</font></span></div>
<div><span><font face="Arial" size="2"></font></span> </div>
<div><font face="Arial" size="2"><span>I&#39;m sure someone 
must have done this!</span></font></div>
<div><font face="Arial" size="2"><span></span></font> </div>
<div><font face="Arial" size="2"><span>Thanks in 
advance,</span></font></div>
<div><font face="Arial" size="2"><span></span></font> </div>
<div><font face="Arial" size="2"><span>Graeme</span></font></div>
<div><font face="Arial" size="2"></font> </div>
<div align="left"><font face="Arial" size="2">Graeme Winter</font></div>
<div align="left"><font face="Arial" size="2">Software and MX Support 
Scientist</font></div>
<div align="left"><font face="Arial" size="2">Diamond Light Source</font></div>
<div align="left"><font face="Arial" size="2"></font> </div>
<div align="left"><font face="Arial" size="2">+44 1235 778091 (work)</font></div>
<div align="left"><font face="Arial" size="2">+44 7786 662784 (work 
mobile)</font></div>
<div align="left"><font face="Arial" size="2"></font> </div>
<div> </div>
<br><p align="justify"> </p>

<p align="justify">--  </p>

<p align="justify">This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail.<br>
Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd. <br>Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message.<br>
Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom<br> </p>

<br></div>
<br>_______________________________________________<br>
cctbxbb mailing list<br>
<a href="mailto:cctbxbb@phenix-online.org">cctbxbb@phenix-online.org</a><br>
<a href="http://phenix-online.org/mailman/listinfo/cctbxbb" target="_blank">http://phenix-online.org/mailman/listinfo/cctbxbb</a><br>
<br></blockquote></div><br>