Strange behaviour of resolution filter
Hi, I discovered a rather strange behaviour of the miller.index_generator. Sample code showing the weirdness: -----8<--------------------------- from __future__ import division from cctbx import xray from cctbx import crystal from cctbx.array_family import flex structure = xray.structure( special_position_settings=crystal.special_position_settings( crystal_symmetry=crystal.symmetry( unit_cell=(3.14098, 4.08327, 5.33966, 83, 109, 129), space_group_symbol="P 1")), scatterers=flex.xray_scatterer([ xray.scatterer( label="Si", site=(0.,0.,0.), u=0.0)])) fc1 = structure.structure_factors(d_min=1.0).f_calc().sort() d_max, d_min = fc1.resolution_range() fc2 = structure.structure_factors(d_min=d_min).f_calc().sort() print(fc1.size(), fc2.size()) #fc1.show_array() fc1.show_comprehensive_summary() print("\nd_min: {}\n".format(d_min)) fc2.show_comprehensive_summary() #fc2.show_array() -----8<--------------------------- fc1 has 105 indices, while fc2 only has 104. Also fc2 has a higher d_min than fc1 although I'd expect both to have the same. To me it seems like the index with d==d_min is not included and only indices with d>d_min are calculated. I wonder if this behaviour is the desired one or rather a bug, as I was quite surprised when I discovered this. With regards, Dipl. Phys. Jan M. Simons Institute of Crystallography RWTH Aachen University
Hi, it's due to rounding errors. A safer way of doing this is: (...) fc1 = structure.structure_factors(d_min=1.0).f_calc().sort() fc2 = fc1.structure_factors_from_scatterers(xray_structure=structure).f_calc() (...) which will guarantee that miller indices of fc1 and fc2 are identical. BTW, I did not realize that there is "resolution_range()". I always use ".d_max_min()" function, which is clearer as it exactly tells what it returns. Pavel On 2/8/13 4:16 AM, Jan Marten Simons wrote:
Hi,
I discovered a rather strange behaviour of the miller.index_generator.
Sample code showing the weirdness:
-----8<---------------------------
from __future__ import division from cctbx import xray from cctbx import crystal from cctbx.array_family import flex
structure = xray.structure( special_position_settings=crystal.special_position_settings( crystal_symmetry=crystal.symmetry( unit_cell=(3.14098, 4.08327, 5.33966, 83, 109, 129), space_group_symbol="P 1")), scatterers=flex.xray_scatterer([ xray.scatterer( label="Si", site=(0.,0.,0.), u=0.0)]))
fc1 = structure.structure_factors(d_min=1.0).f_calc().sort() d_max, d_min = fc1.resolution_range() fc2 = structure.structure_factors(d_min=d_min).f_calc().sort()
print(fc1.size(), fc2.size()) #fc1.show_array() fc1.show_comprehensive_summary() print("\nd_min: {}\n".format(d_min)) fc2.show_comprehensive_summary() #fc2.show_array()
-----8<---------------------------
fc1 has 105 indices, while fc2 only has 104. Also fc2 has a higher d_min than fc1 although I'd expect both to have the same. To me it seems like the index with d==d_min is not included and only indices with d>d_min are calculated. I wonder if this behaviour is the desired one or rather a bug, as I was quite surprised when I discovered this.
With regards,
Dipl. Phys. Jan M. Simons
Institute of Crystallography RWTH Aachen University _______________________________________________ cctbxbb mailing list [email protected] http://phenix-online.org/mailman/listinfo/cctbxbb
participants (2)
-
Jan Marten Simons
-
Pavel Afonine