<html><body><div style="color:#000; background-color:#fff; font-family:Courier New, courier, monaco, monospace, sans-serif;font-size:10pt"><div><span>Hi Jan,</span></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: transparent; font-style: normal;"><br><span></span></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: transparent; font-style: normal;"><span>There are two steps to think about: .map_to_asu() and .common_set()</span></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: transparent; font-style: normal;"><span>or .common_sets(). Look for these methods in</span></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: Courier New,courier,monaco,monospace,sans-serif;
 background-color: transparent; font-style: normal;"><span>cctbx/regression/tst_miller.py, then add print statements to see</span></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: transparent; font-style: normal;"><span>how they work (run the command with e.g. "P31" so that it only</span></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: transparent; font-style: normal;"><span>exercises</span><span> one space group).</span></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: transparent; font-style: normal;"><br><span></span></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: transparent; font-style:
 normal;"><span>However, the best way to compute f_calc given an array of f_obs</span></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: transparent; font-style: normal;"><span>is via</span></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: transparent; font-style: normal;"><br><span></span></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: transparent; font-style: normal;"><span>&nbsp; f_calc = f_obs.structure_factors_from_scatterers(</span></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: transparent; font-style: normal;"><span>&nbsp;&nbsp;&nbsp; xray_structure).f_calc()</span></div><div
 style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: transparent; font-style: normal;"><br><span></span></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: transparent; font-style: normal;"><span>This way the f_calc are directly compatible with the f_obs array.<br class="yui-cursor"></span></div><div><br></div><div>Ralf</div><div><br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><div style="font-family: Courier New, courier, monaco, monospace, sans-serif; font-size: 10pt;"><div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"><font face="Arial" size="2"><hr size="1"><b><span style="font-weight:bold;">From:</span></b> Jan Marten Simons &lt;marten@xtal.rwth-aachen.de&gt;<br><b><span style="font-weight:
 bold;">To:</span></b> cctbxbb@phenix-online.org<br><b><span style="font-weight: bold;">Sent:</span></b> Monday, April 11, 2011 3:00 AM<br><b><span style="font-weight: bold;">Subject:</span></b> Re: [cctbxbb] Best way to compare incomplete f_hkl to calculated f_hkl<br></font><br> 
Hi,<br><br>I'm looking at the best (=fastest) way to compare a (possibly incomplete) list <br>of observed reflections f_hkl_obs (or fo2_hkl_obs) to the f_hkl_calc of&nbsp; <br>calculated structure factors or intensities from a model structure.<br><br>in <a target="_blank" href="http://miller.py">miller.py</a> there is a function to calculate a difference between f_obs and <br>f_calc, but it asserts that all reflections are present in f_obs:<br><br>def f_obs_minus_f_calc(self, f_obs_factor, f_calc):<br> assert f_calc.is_complex_array()<br> assert self.indices().all_eq(f_calc.indices())<br> assert self.anomalous_flag() is f_calc.anomalous_flag()<br>...<br><br>In my case it's possible that some reflections could not be observed so they <br>should either be skipped or be assumed to be of zero intensity. As I could not <br>locate the definition for .all_eq(...), yet I'm not sure if this is already <br>handled and if it is how it is done.<br><br>Then there is
 f_obs_minus_xray_structure_f_calc in miller.py as well. Would <br>this be a better approach if the model structure changes quite often? What if <br>I just got f_calc from another source (like doing some custom sped-up partial <br>structure factor calculation)?<br><br>In general: What would be your advice on this with cctbx?<br><br><br>With regards,<br><br> Dipl. Phys.<br>&nbsp; Jan M. Simons<br> <br>Institute of Crystallography<br>RWTH Aachen University<br>_______________________________________________<br>cctbxbb mailing list<br><a ymailto="mailto:cctbxbb@phenix-online.org" href="mailto:cctbxbb@phenix-online.org">cctbxbb@phenix-online.org</a><br>http://phenix-online.org/mailman/listinfo/cctbxbb<br><br><br></div></div></blockquote></div></div></body></html>