pad_atoms

Contents

pad_atoms#

abtem.atoms.pad_atoms(atoms, margins, directions='xyz')[source]#

Repeat the atoms in the given directions, retaining only the repeated atoms within the margin distance from the cell boundary.

Atoms are cropped only along the directions that were repeated. Along any other direction, including a padded direction with a zero margin, every atom is kept, even one outside the cell.

Parameters:
  • atoms (ase.Atoms) – The atoms that should be padded.

  • margins (one or tuple of three floats) – The padding margin. Can be specified either as a single value for all directions, or three separate values for x, y and z.

  • directions (str) – The directions to pad the atoms as a concatenation of one or more of x, y and z for each of the principal directions.

Returns:

padded – Padded atoms.

Return type:

ase.Atoms