Skip to content
Discussion options

You must be logged in to vote

Your reading is almost right, with one important difference: the cylinder axis is always the box z-axis (lab frame). It is not tied to the orientation of your molecule.

From CylindricalSelection._apply:

vecs = group.positions - sel.center_of_geometry()            # L477 (minimum-imaged if periodic)
mask = (vecs[:, 2] > self.zmin) & (vecs[:, 2] < self.zmax)   # L516
radii = vecs[:, 0] ** 2 + vecs[:, 1] ** 2                    # L522
mask = radii < self.exRadius**2                              # L523

So with COG = (x_g, y_g, z_g), cyzone R zMax zMin sel selects atoms with

  • z_g + zMin < z < z_g + zMax (strict), and
  • (x - x_g)² + (y - y_g)² < R². This is the distance in the xy-plane from the a…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@peabreu
Comment options

Answer selected by peabreu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants