Inverse of Box.wrap
It would be useful to have a function that reverses Box.wrap robustly. For instance to put the points returned by NearestNeighbors.getNeighbors into a compact neighbor shell
Comments (5)
-
-
reporter I asked Eric about this and he told me to make an issue: I think he has something in mind. A better way to say what I meant is a function that re-centers the box on a coordinate within it. This would be used to easily examine features that had been split by the periodic boundaries.
I just ended up doing this for myself:
(p is the index of a point)
L = np.array(nn.getBox().getL())[0]
shell = positions[frame,nn.getNeighbors(p)]
pos = positions[frame,p,:]
shell = np.mod((shell-pos+L/4), L/2) - L/4
This re-assembles a neighbor shell back into one peice
-
It actually looks like there is an unwrap function, but it isn't exposed. This should be easy to expose.
-
- changed status to resolved
Resolves Issue
#93and Issue#55Wraps vectors of any length and will unwrap a vector into a given image
→ <<cset 3c12d56a80e0>>
-
Resolves Issue
#93and Issue#55Wraps vectors of any length and will unwrap a vector into a given image
→ <<cset 3c12d56a80e0>>
- Log in to comment
Could you expand a bit more on what you mean?