<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Hi,<br>
      <br>
      can anyone tell me what's r1_factor and how it is different from
      classical text-book definition of R-factor, for example:<br>
      <br>
      <a class="moz-txt-link-freetext" href="http://en.wikipedia.org/wiki/R-factor_(crystallography)">http://en.wikipedia.org/wiki/R-factor_(crystallography)</a><br>
      <br>
      (or for those who doesn't trust wiki: page 147 in
      Blundell&amp;Johnson (1976))<br>
      <br>
      ?<br>
      <br>
      Are there r2_factor, r3_factor, ..., etc ?<br>
      <br>
      Thanks,<br>
      Pavel<br>
      <br>
      On 7/6/12 12:09 PM, Richard Gildea wrote:<br>
    </div>
    <blockquote
cite="mid:CACCG97EmHCfFwoF3vho=viwG7V3Cw_p6d9CXZiAbp5YNTi7=3g@mail.gmail.com"
      type="cite">Just to avoid any confusion between mine and Nat's
      responses, there are two similarly named functions in
      miller.array, common_set and common_sets.&nbsp;
      <div><br>
      </div>
      <div>Thus the following two lines (note singular common_set):</div>
      <div><br>
      </div>
      <div>f_obs = f_obs.common_set(f_calc)</div>
      <div>f_calc = f_calc.common_set(f_obs)</div>
      <div><br>
      </div>
      <div>is equivalent to the one-liner (note plural common_sets):</div>
      <div><br>
      </div>
      <div>f_obs, f_calc = f_obs.common_sets(f_calc)</div>
      <div><br>
      </div>
      <div>Cheers,</div>
      <div><br>
      </div>
      <div>Richard</div>
      <div><br>
        <br>
        <div class="gmail_quote">On 6 July 2012 12:04, Richard Gildea <span
            dir="ltr">&lt;<a moz-do-not-send="true"
              href="mailto:rgildea@gmail.com" target="_blank">rgildea@gmail.com</a>&gt;</span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Jan,
            <div><br>
            </div>
            <div>You will need to get a matching set of indices for both
              arrays before calculating the R1 factor. The simplest way
              to do this would be by calling the
              miller.array.common_sets() function:</div>
            <div>
              <br>
            </div>
            <div>e.g. where f_obs and f_calc are two arrays that are not
              necessarily matching sets of indices:</div>
            <div><br>
            </div>
            <div>f_obs, f_calc = f_obs.common_sets(f_calc)</div>
            <div><br>
            </div>
            <div>Hope that helps,</div>
            <div><br>
            </div>
            <div>Richard</div>
            <div class="HOEnZb">
              <div class="h5">
                <div>
                  <div><br>
                    <div class="gmail_quote">On 6 July 2012 11:59, Jan
                      Marten Simons <span dir="ltr">&lt;<a
                          moz-do-not-send="true"
                          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">Hi,<br>
                        <br>
                        I'm facing a new challenge while working with
                        cctbx:<br>
                        <br>
                        Imagine a set of (possibly incomplete) measured
                        intesities, or integrated<br>
                        intensities from xrd powder patterns (I_obs) and
                        a fitting crystal symmetry<br>
                        (xtal_symm). Now if I want to check if a given
                        structure would generate the<br>
                        same intensities. (--&gt; low R1) the following
                        code exibits the problem:<br>
                        <br>
                        # -*- coding: utf-8 -*-<br>
                        from __future__ import division<br>
                        from cctbx import xray<br>
                        from cctbx import crystal<br>
                        from cctbx.array_family import flex<br>
                        from libtbx import Auto<br>
                        <br>
                        obs_file = "Test.hkl" &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# in shelx
                        hklf4 format<br>
                        xtal_symm = crystal.symmetry(<br>
                        &nbsp; &nbsp; unit_cell=(4.000, 5.4321, 7.531, 90.0, 90.0,
                        90.0),<br>
                        &nbsp; &nbsp; space_group_symbol="P mm2")<br>
                        <br>
                        trial_structure = xray.structure(<br>
                        &nbsp;
                        special_position_settings=crystal.special_position_settings(<br>
                        &nbsp; &nbsp; crystal_symmetry=xtal_symm),<br>
                        &nbsp; scatterers=flex.xray_scatterer([<br>
                        &nbsp; &nbsp; xray.scatterer(<br>
                        &nbsp; &nbsp; &nbsp; label="Si",<br>
                        &nbsp; &nbsp; &nbsp; site=(0.0,0.0,0.0),<br>
                        &nbsp; &nbsp; &nbsp; u=0.2)]))<br>
                        <br>
                        # load (integral) intensities from diffraction
                        data<br>
                        from iotbx import reflection_file_reader<br>
                        rfl =
                        reflection_file_reader.any_reflection_file("amplitudes="+obs_file,<br>
                        &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                        &nbsp; ensure_read_access=True)<br>
                        I_obs =
                        rfl.as_miller_arrays(crystal_symmetry=xtal_symm,<br>
                        &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                        force_symmetry=False,<br>
                        &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                        merge_equivalents=True,<br>
                        &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                        base_array_info=None)[0]<br>
                        I_obs = I_obs.discard_sigmas()<br>
                        f_obs = I_obs.as_amplitude_array()<br>
                        <br>
                        f_calc =
                        trial_structure.structure_factors(d_min=1.0).f_calc()<br>
                        f_calc.merge_equivalents()<br>
                        <br>
                        R1 = f_calc.r1_factor(f_obs, scale_factor=Auto,
                        assume_index_matching=False)<br>
                        <br>
                        gives:<br>
                        " &nbsp; &nbsp;assert other.indices().size() ==
                        self.indices().size()<br>
                        AssertionError &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "<br>
                        <br>
                        <br>
                        Is there some way to get the R1_factor for this
                        kind of scenario?<br>
                        <br>
                        Cheers and thanks in advance,<br>
                        Jan<br>
                        _______________________________________________<br>
                        cctbxbb mailing list<br>
                        <a moz-do-not-send="true"
                          href="mailto:cctbxbb@phenix-online.org"
                          target="_blank">cctbxbb@phenix-online.org</a><br>
                        <a moz-do-not-send="true"
                          href="http://phenix-online.org/mailman/listinfo/cctbxbb"
                          target="_blank">http://phenix-online.org/mailman/listinfo/cctbxbb</a><br>
                      </blockquote>
                    </div>
                    <br>
                  </div>
                </div>
              </div>
            </div>
          </blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
cctbxbb mailing list
<a class="moz-txt-link-abbreviated" href="mailto:cctbxbb@phenix-online.org">cctbxbb@phenix-online.org</a>
<a class="moz-txt-link-freetext" href="http://phenix-online.org/mailman/listinfo/cctbxbb">http://phenix-online.org/mailman/listinfo/cctbxbb</a>
</pre>
    </blockquote>
    <br>
    <br>
  </body>
</html>