<div dir="ltr">Hi Jan,<div><br></div><div>This message from the cctbxbb archive demonstrates how you can map sites to the asymmetric unit cell in Python. I think you should probably be able to write the equivalent code in C++ if you need the speed, but I would have to look into it more closely to be sure:</div>

<div><a href="http://phenix-online.org/pipermail/cctbxbb/2010-February/000142.html">http://phenix-online.org/pipermail/cctbxbb/2010-February/000142.html</a><br></div><div><br></div><div style>Regarding the sites_frac between 0 and 1, there is a standalone C++ function mod_positive() and a related function mod_short() in cctbx/coordinates.h which act just on a site coordinate rather than on a scatterer. If you have need to access this in Python you would need to write a wrapper function that will act on a flex.vec3_double() from Python and loop over this in C++. If this is what you want we can point you in the write direction for how to accomplish this.</div>

<div style><br></div><div style>Cheers,</div><div style><br>Richard</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 13 February 2013 10:20, Jan Marten Simons <span dir="ltr">&lt;<a href="mailto:marten@xtal.rwth-aachen.de" target="_blank">marten@xtal.rwth-aachen.de</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Am Mittwoch 13 Februar 2013 18:19:15 schrieb Pavel Afonine:<br>
<div class="im">&gt; Hi Jan,<br>
&gt;<br>
&gt; I see, yes, that&#39;s right.<br>
&gt;<br>
&gt; Just to make sure I correctly understand.. So having *only* sites_cart<br>
&gt; and unit_cell, you want to convert these sites_cart into fractional<br>
&gt; basis such that resulting sites_frac are all between 0 and 1, correct?<br>
<br>
</div>Yes you got that right.<br>
<br>
It would be even better to have the option to restrict all sites_frac to be<br>
inside the asymmetric unit of the (empty) cell as well, as all other sites can<br>
be generated from symmetry operations later on, if one needs to have all of<br>
those.<br>
<br>
Cheers,<br>
<div class="HOEnZb"><div class="h5">Jan<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>
</div></div></blockquote></div><br></div>