Binning Surface

Changed in version 2.0.0: Renamed module from surface to binning_surface.

With surface_method='binning', MembraneCurvature derives a surface by partitioning the dimensions of the simulation box into a regular n_x_bins x n_y_bins grid along the x and y directions. For each bin MembraneCurvature computes the average z coordinate of the atoms that fall inside the bin to form the discrete height field. Empty bins are represented as numpy.nan.

This height field is then used to calculate mean and Gaussian curvature using finite differences.

For more details on the binning method, refer to the 2.2. Binning method section in the Algorithm page.

Note

The binning method supports a brick-wall filter to remove high-frequency noise from the height field. The filter is applied to the height field before calculating curvature. For more details, check the API documentation for the FFT filtering module.

Functions

membrane_curvature.binning_surface.derive_surface(atoms, n_cells_x, n_cells_y, max_width_x, max_width_y)[source]

Derive surface from atom positions in AtomGroup.

Parameters:
  • atoms (AtomGroup.) – AtomGroup of reference selection to define the surface of the membrane.

  • n_cells_x (int.) – number of cells in the grid of size max_width_x, x axis.

  • n_cells_y (int.) – number of cells in the grid of size max_width_y, y axis.

  • max_width_x (float.) – Maximum width of simulation box in x axis. (Determined by simulation box dimensions)

  • max_width_y (float.) – Maximum width of simulation box in y axis. (Determined by simulation box dimensions)

Returns:

z_coordinates – Average z-coordinate values. Return Numpy array of floats of shape (n_cells_x, n_cells_y).

Return type:

numpy.ndarray

membrane_curvature.binning_surface.get_z_surface(coordinates, n_x_bins=10, n_y_bins=10, x_range=(0, 100), y_range=(0, 100))[source]

Derive surface from distribution of z coordinates in grid.

Parameters:
  • coordinates (numpy.ndarray) – Coordinates of AtomGroup. Numpy array of shape=(n_atoms, 3).

  • n_x_bins (int.) – Number of bins in grid in the x dimension.

  • n_y_bins (int.) – Number of bins in grid in the y dimension.

  • x_range (tuple of (float, float)) – Range of coordinates (min, max) in the x dimension with shape=(2,).

  • y_range (tuple of (float, float)) – Range of coordinates (min, max) in the y dimension with shape=(2,).

Returns:

z_surface – Surface derived from set of coordinates in grid of x_range, y_range dimensions. Returns Numpy array of floats of shape (n_x_bins, n_y_bins)

Return type:

np.ndarray

membrane_curvature.binning_surface.normalized_grid(grid_z_coordinates, grid_norm_unit)[source]

Calculates average z coordinates in unit cell.

Parameters:
  • grid_z_coordinates (np.array) – Array of size (l,m) with z coordinates stored in unit cell.

  • grid_norm_unit (np.array) – Array of size (l,m) with number of atoms in unit cell.

Returns:

z_surface – Normalized z coordinates in grid. Returns Numpy array of floats of shape (n_x_bins, n_y_bins)

Return type:

np.ndarray