Commit 6c55001d authored by cmaffeo2's avatar cmaffeo2
Browse files

Do better job selecting stack in pdb reader

parent 466df3d2
......@@ -195,9 +195,13 @@ def find_stacks( u, centers, transforms, selection_text='all' ):
## Convert distances to stacks
stacks_above = -np.ones(len(sel), dtype=np.int)
_z = np.array((0,0,1))
for i in np.unique(idx1):
js = idx2[ idx1 == i ]
j = np.argmin(dists[i])
angles = [np.arccos( transforms[j].T.dot( transforms[i].dot(_z) ).dot( _z ) ) for j in js]
angles = np.array( angles )
tmp = np.argmin(dists[i][js] + 1.0*angles)
j = js[tmp]
stacks_above[i] = j
return stacks_above
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment