<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div class="">Hi,</div>
<div class=""><br class="">
</div>
<div class="">I am an experienced C&#43;&#43; and Python programmer, but new to cctbx.</div>
<div class=""><br class="">
</div>
<div class="">Can any tell me if there is an algorithm in cctbx available &nbsp;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.&nbsp;</div>
<div class=""><br class="">
</div>
<div class="">I found the brick class which gives me the assymmetric unit</div>
<div class="">
<div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class="">
<span style="color: #0433ff" class="">from</span> cctbx <span style="color: #0433ff" class="">
import</span> crystal,sgtbx</div>
<div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco; min-height: 15px;" class="">
<br class="">
</div>
<div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class="">
<span style="color: #0433ff" class="">if</span> __name__==<span style="color: #d49238" class="">'__main__'</span>:</div>
<div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class="">
&nbsp; &nbsp; crystal_symmetry = crystal.symmetry( unit_cell=(<span style="color: #941100" class="">3.5093</span>,<span style="color: #941100" class="">3.5093</span>,<span style="color: #941100" class="">3.5093</span>,<span style="color: #941100" class="">90</span>,<span style="color: #941100" class="">90</span>,<span style="color: #941100" class="">90</span>)</div>
<div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class="">
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; , space_group_symbol=<span style="color: #d49238" class="">&quot;229&quot;</span>
<span style="color: #cbcbcb" class=""># = &quot;I m -3 m&quot;</span></div>
<div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class="">
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; )</div>
<div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class="">
&nbsp; &nbsp; sg = crystal_symmetry.space_group()</div>
<div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class="">
&nbsp; &nbsp; brick = sgtbx.brick( sg.type() )</div>
<div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class="">
&nbsp; &nbsp; <span style="color: #0433ff" class="">print</span> brick</div>
</div>
<div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class="">
<br class="">
</div>
<div class="">I also found cctbx::sgtbx::asu and the classes therein, but they are largely undocumented.&nbsp;</div>
<div class=""><br class="">
</div>
<div class="">For the interested, this is the problem i want to solve:</div>
<div class="">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 class=""><br class="">
</div>
<div class="">All help is greatly appreciated.</div>
<div class="">kindest regards,&nbsp;</div>
<br class="">
<div class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div class="">Dr [Engel]bert Tijskens<br class="">
HPC Analyst/Consultant<br class="">
<br class="">
Flemish Supercomputer Center<span class="Apple-tab-span" style="white-space: pre;">
</span><a href="http://vscentrum.be" class="">vscentrum.be</a>&nbsp;<br class="">
HPC core facility CalcUA<span class="Apple-tab-span" style="white-space: pre;"> </span>
<span class="Apple-tab-span" style="white-space: pre;"></span><a href="http://uantwerp.be/calcua" class="">uantwerp.be/calcua</a><br class="">
Computational mathematics<span class="Apple-tab-span" style="white-space: pre;"> </span>
<span class="Apple-tab-span" style="white-space: pre;"></span><a href="http://www.uantwerpen.be/en/rg/cma" class="">www.uantwerpen.be/en/rg/cma</a><br class="">
<br class="">
University of Antwerp&nbsp;<br class="">
Middelheimlaan1 G.309, B-2020 Antwerp, Belgium<br class="">
<br class="">
<a href="mailto:engelbert.tijskens@uantwerpen.be" class="">engelbert.tijskens@uantwerpen.be</a><br class="">
&#43;&#43;32 3 265 3879</div>
</div>
</div>
<br class="">
</body>
</html>