Structures¶
Module for modifying ASE atoms objects for use in abTEM.

abtem.structures.
cut_rectangle
(atoms, origin, extent, margin=0.0)[source]¶ Cuts out a cell starting at the origin to a given extent from a sufficiently repeated copy of atoms.
 Parameters
atoms (ASE atoms object) – This should correspond to a repeatable unit cell.
origin (two float) – Origin of the new cell. Units of Angstrom.
extent (two float) – xyextent of the new cell. Units of Angstrom.
margin (float) – Atoms within margin from the border of the new cell will be included. Units of Angstrom. Default is 0.
 Returns
 Return type
ASE atoms object

abtem.structures.
is_cell_hexagonal
(atoms)[source]¶ Function to check whether the cell of an ASE atoms object is hexagonal.
 Parameters
atoms (ASE atoms object) – The atoms that should be checked.

abtem.structures.
is_cell_orthogonal
(atoms, tol=1e12)[source]¶ Check whether an Atoms object has an orthogonal cell.
 Parameters
atoms (ASE atoms object) – The atoms that should be checked.
tol (float) – Components of the lattice vectors below this value are considered to be zero.

abtem.structures.
is_cell_valid
(atoms, tol=1e12)[source]¶ Check whether the cell of an ASE atoms object can be converted to a structure that is usable by abTEM.
 Parameters
atoms (ASE atoms object) – The atoms that should be checked.
tol (float) – Components of the lattice vectors below this value are considered to be zero.
 Returns
If true, the atomic structure is usable by abTEM.
 Return type
bool

abtem.structures.
orthogonalize_cell
(atoms, max_repetitions=5, return_transform=False, transform=True, tolerance=0.01)[source]¶ Make the cell of an ASE atoms object orthogonal. This is accomplished by repeating the cell until lattice vectors are close to the three principal Cartesian directions. If the structure is not exactly orthogonal after the structure is repeated by a given maximum the remaining difference will be made up by applying strain.
 Parameters
atoms (ASE atoms object) – The nonorthogonal atoms object.
max_repetitions (int) – The maximum number of repetions allowed. Increase this to allow more repetitions and hence less strain.
return_transform (bool) – If true, return the transformations that were applied to make the atoms orthogonal.
transform (bool) – If false no transformation is applied to make the cell orthogonal, hence a nonorthogonal cell may be returned.
 Returns
atoms (ASE atoms object) – The orthogonal atoms.
transform (tuple of arrays) – The applied transform in the form the euler angles

abtem.structures.
pad_atoms
(atoms, margin, directions='xy', in_place=False)[source]¶ Repeat the atoms in x and y, retaining only the repeated atoms within the margin distance from the cell boundary.
 Parameters
atoms (ASE Atoms object) – The atoms that should be padded.
margin (float) – The padding margin.
 Returns
Padded atoms.
 Return type
ASE Atoms object

abtem.structures.
standardize_cell
(atoms, tol=1e12)[source]¶ Standardize the cell of an ASE atoms object. The atoms are rotated so one of the lattice vectors in the xyplane aligns with the xaxis, then all of the lattice vectors are made positive.
 Parameters
atoms (ASE atoms object) – The atoms that should be standardized
tol (float) – Components of the lattice vectors below this value are considered to be zero.
 Returns
atoms – The standardized atoms.
 Return type
ASE atoms object