Demonstration using NumPy to manipulate IMP data.
10 (m, c) = IMP.example.create_model_and_particles()
12 if not IMP.IMP_KERNEL_HAS_NUMPY:
13 print(
"IMP was not built with NumPy support.")
21 contents = nbl.get_contents()
29 xyz, r = m.get_spheres_numpy()
36 dists = numpy.linalg.norm(numpy.diff(xyz[contents], axis=1), axis=2).flatten()
38 print(
"Distribution of center-center particle distances:")
39 print(
"Min %.2f Max %.2f Mean %.2f" % (dists.min(), dists.max(), dists.mean()))