[cctbxbb] Getting r1_factor of miller arrays with different count of miller indices

Jan Marten Simons marten at xtal.rwth-aachen.de
Fri Jul 6 11:59:27 PDT 2012


Hi,

I'm facing a new challenge while working with cctbx:

Imagine a set of (possibly incomplete) measured intesities, or integrated 
intensities from xrd powder patterns (I_obs) and a fitting crystal symmetry 
(xtal_symm). Now if I want to check if a given structure would generate the 
same intensities. (--> low R1) the following code exibits the problem:

# -*- coding: utf-8 -*-
from __future__ import division
from cctbx import xray
from cctbx import crystal
from cctbx.array_family import flex
from libtbx import Auto

obs_file = "Test.hkl"              # in shelx hklf4 format
xtal_symm = crystal.symmetry(
    unit_cell=(4.000, 5.4321, 7.531, 90.0, 90.0, 90.0),
    space_group_symbol="P mm2")

trial_structure = xray.structure(
  special_position_settings=crystal.special_position_settings(
    crystal_symmetry=xtal_symm),
  scatterers=flex.xray_scatterer([
    xray.scatterer(
      label="Si",
      site=(0.0,0.0,0.0),
      u=0.2)]))

# load (integral) intensities from diffraction data
from iotbx import reflection_file_reader
rfl = reflection_file_reader.any_reflection_file("amplitudes="+obs_file,
                                                  ensure_read_access=True)
I_obs = rfl.as_miller_arrays(crystal_symmetry=xtal_symm,
                              force_symmetry=False,
                              merge_equivalents=True,
                              base_array_info=None)[0]
I_obs = I_obs.discard_sigmas()
f_obs = I_obs.as_amplitude_array()

f_calc = trial_structure.structure_factors(d_min=1.0).f_calc()
f_calc.merge_equivalents()

R1 = f_calc.r1_factor(f_obs, scale_factor=Auto, assume_index_matching=False)

gives:
"    assert other.indices().size() == self.indices().size()
AssertionError                               "


Is there some way to get the R1_factor for this kind of scenario?

Cheers and thanks in advance,
Jan


More information about the cctbxbb mailing list