def asphericity(self, freq = 1):
"""compute asphericity of the Voronoi cell"""
#progress bar
frames = int(self.traj.n_frames / freq)
bar = ChargingBar('Processing', max=frames,
suffix='%(percent).1f%% - %(eta)ds')
for i in range(0, self.traj.n_frames, freq):
for j in range(self.traj.n_atoms):
if self.traj.atom_names[i][j] == self.center:
#center coordinate
c = self.traj.coords[i][j]
#coordinates
cs = self.traj.coords[i]
#box_size
L = self.traj.box_size[i]
#new coordinates after wrapping
nc = self.wrap_box(c, cs, L)
points = self.polyhedron(nc, j, L)
e = self.compute_vc(points)
self.raw.append(e)
bar.next()
bar.finish()
评论列表
文章目录