[cctbxbb] bin data by a Miller index
Pavel Afonine
pafonine at lbl.gov
Fri Apr 24 12:55:44 PDT 2015
Hi Blaine,
I would be surprised if there is no better way of doing this, but here
is what I could type in 5 minutes:
***
from cctbx.development import random_structure
from cctbx import sgtbx
from cctbx.array_family import flex
def exercise():
# generate random structure
xrs = random_structure.xray_structure(
space_group_info = sgtbx.space_group_info("P212121"),
elements = ["N","C","O"]*10)
# compute structure factors up to given resolution
f_calc = xrs.structure_factors(d_min=1.5).f_calc()
# obtain selection for miller indices you are interested in
selection = flex.bool()
for mi in f_calc.indices():
h,k,l = mi
if(h==1 or h==3): selection.append(True)
else: selection.append(False)
print "Number of reflections selected %d out of total %d"%(
selection.count(True), selection.size())
# apply obtained selection
f_calc_selected = f_calc.select(selection)
# do binning
f_calc_selected.setup_binner(reflections_per_bin = 50)
for i_bin in f_calc_selected.binner().range_used():
sel_i_bin = f_calc_selected.binner().selection(i_bin)
d_range = f_calc_selected.binner().bin_legend(
i_bin=i_bin, show_bin_number=True, show_counts=True)
print d_range
if(__name__ == "__main__"):
exercise()
***
Hope this does the job for you!
Pavel
On 4/24/15 10:22 AM, Mooers, Blaine H.M. (HSC) wrote:
> Dear cctbxbb:
>
> I have a simple question.
>
> I have a data set with a strong off origin Patterson peak (0,0,0.11).
> I want to
> plot the average I/sig per zone l = n. I expect to see enhanced values
> at l=9n.
> How do you bin data by the L Miller index in iotbx?
>
> Best regards,
>
> Blaine
>
> Blaine Mooers, Ph.D.
> Assistant Professor
> Director of the Laboratory of Biomolecular Structure and Function
> Department of Biochemistry and Molecular Biology
> University of Oklahoma Health Sciences Center
> S.L. Young Biomedical Research Center Rm. 466
>
> Shipping address:
> 975 NE 10th Street, BRC 466
> Oklahoma City, OK 73104-5419
>
> Letter address:
> P.O. Box 26901, BRC 466
> Oklahoma City, OK 73190
>
> office: (405) 271-8300 lab: (405) 271-8313 fax: (405) 271-3910
> e-mail: blaine-mooers at ouhsc.edu
>
> Faculty webpage:
> http://www.oumedicine.com/department-of-biochemistry-and-molecular-biology/faculty/blaine-mooers-ph-d-
>
> Small Angle Scattering webpage:
> http://www.oumedicine.com/docs/default-source/ad-biochemistry-workfiles/small-angle-scattering-links-27aug2014.html?sfvrsn=0
>
> X-ray lab webpage:
> http://www.oumedicine.com/department-of-biochemistry-and-molecular-biology/department-facilities/macromolecular-crystallography-laboratory
>
>
>
> _______________________________________________
> cctbxbb mailing list
> cctbxbb at phenix-online.org
> http://phenix-online.org/mailman/listinfo/cctbxbb
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://phenix-online.org/pipermail/cctbxbb/attachments/20150424/9c50840b/attachment-0001.htm>
More information about the cctbxbb
mailing list