[cctbxbb] Computing E^4 from an mtz file

Nathaniel Echols nechols at lbl.gov
Thu Dec 13 08:29:43 PST 2012


On Thu, Dec 13, 2012 at 8:18 AM,  <Graeme.Winter at diamond.ac.uk> wrote:
> That gave me six and a bit: specifically
>
>     sm.show()
>     print f.second_moment(use_binning = False)
>
> 6.46063790107
>
> The E^2 = I/<I> need to be computed in bins. After that (E^2)^2 should be fine. This got me confused - it must be in there somewhere

Ah, I think I see - look at the "data" attribute:

 sm = f.second_moment(use_binning=True)
 print sm. data
[None, 2.3279309836355044, 2.8099112859261517, 2.1769967857271175,
2.200637763782145, 2.2919308734359407, 2.000356888782398,
1.7555453224108684, 1.4836662688931992, None]

(using a dataset from the PDB)  I've never fully understood what the
first and last elements are supposed to mean (at least one is for
"unused" data) - but you can get the elements of interested this way:

  for i_bin in f.binner().range_used() :
    # etc.

-Nat


More information about the cctbxbb mailing list