Inverse of Box.wrap

Issue #93 resolved
Bryan Vansaders created an issue

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)

  1. Bryan Vansaders 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

  2. Eric Harper

    It actually looks like there is an unwrap function, but it isn't exposed. This should be easy to expose.

  3. Log in to comment