<div dir="ltr"><div dir="ltr">Hi Jan,<div><br></div><div>To add to Pavel&#39;s response, the direct summation code is located in structure_factors_direct.h (<a href="https://github.com/cctbx/cctbx_project/blob/master/cctbx/xray/structure_factors_direct.h" target="_blank">https://github.com/cctbx/cctbx_project/blob/master/cctbx/xray/structure_factors_direct.h</a>). The most recent change is for handling anharmonic ADP. The Python interface is in cctbx.xray.structure_factors.from_scatterers_direct and an example of usage can be found in the test, cctbx/regression/tst_xray.py, in the &quot;exercise_from_scatterers_direct&quot; function.</div><div><br></div><div>As for simulating powder diffraction images, I&#39;m not sure about that specific technique, but there is some ongoing work in the simtbx directory for serial protein crystallography and some older work in cudatbx for solution scattering. For the solution scattering work, an image is simulated and the 1-d SAXS curve can be calculated.</div><div><br></div><div><div><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><div>--</div><div><span style="font-size:12.8000001907349px">Billy K. Poon</span><br></div></div><div>Research Scientist, Molecular Biophysics and Integrated Bioimaging</div><div>Lawrence Berkeley National Laboratory</div><div>1 Cyclotron Road, M/S 33R0345</div><div>Berkeley, CA 94720</div><div>Tel: (510) 486-5709</div><div>Fax: (510) 486-5909</div><div>Web: <a href="https://phenix-online.org" target="_blank">https://phenix-online.org</a></div></div></div></div></div></div></div></div></div></div></div></div></div></div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Sep 28, 2020 at 10:23 AM Pavel Afonine &lt;<a href="mailto:pafonine@lbl.gov" target="_blank">pafonine@lbl.gov</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">Hi Jan,<br>
<br>
&gt; It&#39;s been a while since I actively worked with cctbx, but now I wonder<br>
&gt; if there is some in depth documentation on how the structure factor<br>
&gt; calculation in the cctbx xray module is done.<br>
<br>
no, no any documentation on details how structure factors are <br>
calculated. Generally, the calculation protocol follows classic 20-50 <br>
years old publications on the subject..<br>
<br>
&gt; I&#39;m especially interested<br>
&gt; in caching strategies employed to speed up the calculation during<br>
&gt; refinement runs (especially in the case of small molecules using direct<br>
&gt; summation).<br>
&gt;<br>
&gt; So is there a kind of caching that keeps (partial) structure factor<br>
&gt; contributions of each individual scatterer cached so that only the<br>
&gt; partials of shifted scatterers have to be recalculated? If so is there a<br>
&gt; python interface for accessing those?<br>
<br>
No, nothing like that is done, AFAIK. We used to do (or may be even <br>
still do!) something along these lines with the bulk-solvent mask: we <br>
would only update (recalculate) the mask if atoms moved by more than a <br>
certain threshold (0.3A, from memory).<br>
<br>
&gt; Also is there an option to simulate/map the f_calc amplitudes onto a<br>
&gt; 1dimensional 2theta or d* axis to compare those to powder diffraction<br>
&gt; patterns?<br>
<br>
Not that I&#39;m aware of..<br>
<br>
Pavel<br>
<br>
_______________________________________________<br>
cctbxbb mailing list<br>
<a href="mailto:cctbxbb@phenix-online.org" target="_blank">cctbxbb@phenix-online.org</a><br>
<a href="http://phenix-online.org/mailman/listinfo/cctbxbb" rel="noreferrer" target="_blank">http://phenix-online.org/mailman/listinfo/cctbxbb</a><br>
</blockquote></div>