Demonstration using NumPy to manipulate IMP data.
10 if not IMP.IMP_KERNEL_HAS_NUMPY:
11 print(
"IMP was not built with NumPy support.")
20 p = m.add_particle(
"p")
24 d.set_coordinates_are_optimized(
True)
31 contents = nbl.get_contents()
39 xyz, r = m.get_spheres_numpy()
46 dists = numpy.linalg.norm(numpy.diff(xyz[contents], axis=1), axis=2).flatten()
48 print(
"Distribution of center-center particle distances:")
49 print(
"Min %.2f Max %.2f Mean %.2f" % (dists.min(), dists.max(), dists.mean()))