<div dir="ltr"><div>Dear Engelbert,</div><div><br></div><div>you can use the asu_mappings objects to compute this (there may be something more suitable for regular grids). Here is a link to a tutorial written by Ralf Grosse-Kunstleve, where this is explained:</div><div><br></div><div><a href="http://cci.lbl.gov/publications/download/iucrcompcomm_aug2004.pdf">http://cci.lbl.gov/publications/download/iucrcompcomm_aug2004.pdf</a></div><div><br></div><div>BW, Gabor</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 21, 2016 at 12:47 PM, Tijskens Engelbert <span dir="ltr">&lt;<a href="mailto:Engelbert.Tijskens@uantwerpen.be" target="_blank">Engelbert.Tijskens@uantwerpen.be</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<div style="-ms-word-wrap: break-word;">
<div>Hi,</div>
<div><br>
</div>
<div>I am an experienced C++ and Python programmer, but new to cctbx.</div>
<div><br>
</div>
<div>Can any tell me if there is an algorithm in cctbx available  to convert an arbritrary point in direct space to the corresponding point in the asymmetric unit of a given space group? i can figure out how to convert it to the corresponding point
 in the unit cell at the origin, but from there to the asymmetric unit is unclear to me. </div>
<div><br>
</div>
<div>I found the brick class which gives me the assymmetric unit</div>
<div>
<div style="margin:0px;line-height:normal;font-family:Monaco;font-size:11px">
<span style="color:rgb(4,51,255)">from</span> cctbx <span style="color:rgb(4,51,255)">import</span> crystal,<wbr>sgtbx</div>
<div style="margin:0px;line-height:normal;font-family:Monaco;font-size:11px;min-height:15px">
<br>
</div>
<div style="margin:0px;line-height:normal;font-family:Monaco;font-size:11px">
<span style="color:rgb(4,51,255)">if</span> __name__==<span style="color:rgb(212,146,56)">&#39;__main__&#39;</span>:</div>
<div style="margin:0px;line-height:normal;font-family:Monaco;font-size:11px">
    crystal_symmetry = crystal.symmetry( unit_cell=(<span style="color:rgb(148,17,0)">3.5093</span>,<span style="color:rgb(148,17,0)">3.5093</span>,<span style="color:rgb(148,17,0)">3.<wbr>5093</span>,<span style="color:rgb(148,17,0)">90</span>,<span style="color:rgb(148,17,0)">90</span>,<span style="color:rgb(148,17,0)">90</span>)</div>
<div style="margin:0px;line-height:normal;font-family:Monaco;font-size:11px">
                                       , space_group_symbol=<span style="color:rgb(212,146,56)">&quot;229&quot;</span> <span style="color:rgb(203,203,203)"># = &quot;I m -3 m&quot;</span></div>
<div style="margin:0px;line-height:normal;font-family:Monaco;font-size:11px">
                                       )</div>
<div style="margin:0px;line-height:normal;font-family:Monaco;font-size:11px">
    sg = crystal_symmetry.space_group()</div>
<div style="margin:0px;line-height:normal;font-family:Monaco;font-size:11px">
    brick = sgtbx.brick( sg.type() )</div>
<div style="margin:0px;line-height:normal;font-family:Monaco;font-size:11px">
    <span style="color:rgb(4,51,255)">print</span> brick</div>
</div>
<div style="margin:0px;line-height:normal;font-family:Monaco;font-size:11px">
<br>
</div>
<div>I also found cctbx::sgtbx::asu and the classes therein, but they are largely undocumented. </div>
<div><br>
</div>
<div>For the interested, this is the problem i want to solve:</div>
<div>I have a (scalar) physical property P(r), depending on spatial position, presented as a 3D array on a regular grid over the unit cell (space group is known). I need to integrate P(r)*f(r), f(r) being an arbitrary function over a region of direct
 space, which typically comprises several unit cells. In order to reduce the memory footprint of the P array, i would like to restrict it to the space group’s asymmetric unit.</div>
<div><br>
</div>
<div>All help is greatly appreciated.</div>
<div>kindest regards, </div>
<br>
<div>
<div style="-ms-word-wrap: break-word;">
<div>Dr [Engel]bert Tijskens<br>
HPC Analyst/Consultant<br>
<br>
Flemish Supercomputer Center<span class="m_7116944124565746777Apple-tab-span" style="white-space:pre-wrap">
</span><a href="http://vscentrum.be" target="_blank">vscentrum.be</a> <br>
HPC core facility CalcUA<span class="m_7116944124565746777Apple-tab-span" style="white-space:pre-wrap"> </span>
<span class="m_7116944124565746777Apple-tab-span" style="white-space:pre-wrap"></span><a href="http://uantwerp.be/calcua" target="_blank">uantwerp.be/calcua</a><br>
Computational mathematics<span class="m_7116944124565746777Apple-tab-span" style="white-space:pre-wrap"> </span>
<span class="m_7116944124565746777Apple-tab-span" style="white-space:pre-wrap"></span><a href="http://www.uantwerpen.be/en/rg/cma" target="_blank">www.uantwerpen.be/en/rg/cma</a><br>
<br>
University of Antwerp <br>
Middelheimlaan1 G.309, B-2020 Antwerp, Belgium<br>
<br>
<a href="mailto:engelbert.tijskens@uantwerpen.be" target="_blank">engelbert.tijskens@uantwerpen.<wbr>be</a><br>
<a href="tel:%2B%2B32%203%20265%203879" target="_blank" value="+3232653879">++32 3 265 3879</a></div>
</div>
</div>
</div>

<br>______________________________<wbr>_________________<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" rel="noreferrer">http://phenix-online.org/<wbr>mailman/listinfo/cctbxbb</a><br>
<br></blockquote></div><br></div>