Пример #1
0
    def test_distance(self):
        for i in range(100):
            coords1 = np.random.random(6 * self.nrigid) * 4
            coords2 = np.random.random(6 * self.nrigid) * 4

            coords1[:3 * self.nrigid] = 0
            coords2[:3 * self.nrigid] = 0

            measure1 = am.MeasureAngleAxisCluster(self.topology)
            measure2 = am.MeasureRigidBodyCluster(self.topology)

            #print
            self.assertAlmostEqual(measure1.get_dist(coords1, coords2),
                                   measure2.get_dist(coords1, coords2))
Пример #2
0
        break

    fin.readline()
    coords = np.zeros([26, 3])
    for i in range(26):
        x = [float(x) for x in fin.readline().split()[1:]]
        coords[i] = x
    path_xyz.append(coords)

print("length of path:", len(path_xyz))

path = [map_to_aa(xyz) for xyz in path_xyz]

# this block aligns the images
transform = aamindist.TransformAngleAxisCluster(system.aasystem)
measure = aamindist.MeasureAngleAxisCluster(system.aasystem,
                                            transform=transform)

com = measure.get_com(path[0])
transform.translate(path[0], -com)
for i in range(1, len(path)):
    com = measure.get_com(path[i])
    transform.translate(path[i], -com)
    dist, rot = measure.find_rotation(path[i - 1], path[i])
    transform.rotate(path[i], rot)

#p#ath = [ x for x in IntterpolatedPath(db.minima[19], )]
#path = [ x for x in InterpolatedPath(path[0].copy(), path[-1].copy(), 34) ]
traj = open("traj.xyz", "w")
#for x in path:
#    #export_xyz(traj, x)
#    #ret = quench.mylbfgs(x, pot.getEnergyGradient)