orthogonalize_cell#
- abtem.atoms.orthogonalize_cell(atoms, max_repetitions=5, return_transform=False, allow_transform=True, plane='xy', origin=(0.0, 0.0, 0.0), box=None, tolerance=0.01)[source]#
Make the cell of the given atoms 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 number, the remaining difference is made up by applying strain.
- Parameters:
atoms (ase.Atoms) – The non-orthogonal atoms.
max_repetitions (int) – The maximum number of repetitions 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.
allow_transform (bool) – If false no transformation is applied to make the cell orthogonal, hence a non-orthogonal cell may be returned. plane : str or two tuples of three float, optional The plane relative to the provided atoms mapped to xy plane of the potential, i.e. provided plane is perpendicular to the propagation direction. If given as a string, it must be a concatenation of two of x, y and z; the default value ‘xy’ indicates that potential slices are cuts along the xy-plane of the atoms. The plane may also be specified with two arbitrary 3D vectors, which are mapped to the x and y directions of the potential, respectively. The length of the vectors has no influence. If the vectors are not perpendicular, the second vector is rotated in the plane to become perpendicular to the first. Providing a value of ((1., 0., 0.), (0., 1., 0.)) is equivalent to providing ‘xy’.
plane (str or two tuples of three float, optional) – The plane relative to the provided atoms mapped to xy plane of the potential, i.e. provided plane is perpendicular to the propagation direction. If given as a string, it must be a concatenation of two of x, y and z; the default value ‘xy’ indicates that potential slices are cuts along the xy-plane of the atoms. The plane may also be specified with two arbitrary 3D vectors, which are mapped to the x and y directions of the potential, respectively. The length of the vectors has no influence. If the vectors are not perpendicular, the second vector is rotated in the plane to become perpendicular to the first. Providing a value of ((1., 0., 0.), (0., 1., 0.)) is equivalent to providing ‘xy’.
origin (three float, optional) – The origin relative to the provided atoms mapped to the origin of the potential. This is equivalent to translating the atoms. The default is (0., 0., 0.).
box (three float, optional) – The extent of the potential in x, y and z. If not given this is determined from the atoms’ cell. If the box size does not match an integer number of the atoms’ supercell, an affine transformation may be necessary to preserve periodicity, determined by the periodic keyword.
tolerance (float) – Determines what is defined as a plane. All atoms within a distance equal to tolerance [Å] from a given plane will be considered to belong to that plane.
- Returns:
atoms (ase.Atoms) – The orthogonal atoms.
transform (tuple of arrays, optional) – The applied transform given as Euler angles (by default not returned).