Analyze the convergence of the IMP.em.FitRestraint. The script build a simple model and then displays the derivatives, em score and how well conjugate gradients converges under various displacements of the model.
20 prb.set_name(
"rigid body")
24 print "initial frame", drb.get_reference_frame()
26 drb.set_coordinates_are_optimized(
True)
28 refiner.add_particle(prb, [p])
30 print [p.get_name()
for p
in refiner.get_refined(prb)]
35 d.set_coordinates_are_optimized(
True)
43 dheader.set_resolution(1)
45 dmap.set_particles([p])
64 m.set_log_level(IMP.base.SILENT)
68 def try_point(i, j, k):
71 to_move.set_coordinates(vc)
78 print "score and derivatives", v, to_move.get_derivatives()
82 print "after", d.get_coordinates()
83 mag= to_move.get_coordinates().get_magnitude()
88 sg.set_color(converge_color)
89 sg.set_name(
"converge")
92 try_point(-bd,-bd,-bd)