Surface

Calculation of curvature requires a surface of reference. In MembraneCurvature, the surface of reference is defined by the z position of the atoms in AtomGroup.

Functions

membrane_curvature.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.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.surface.normalized_grid(grid_z_coordinates, grid_norm_unit)[source]

Calculates average z coordinates in unit cell.

Parameters:
  • z_ref (np.array) – Empty array of (l,m)

  • 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