abtem.bloch.utils#
Module Contents#
Functions#
Check if all positions have a relative periodic pair. |
|
Check if two vectors are orthogonal within a given tolerance. |
|
Automatically detect the lattice centering of a crystal structure. |
|
Check if three vectors are pairwise orthogonal within a given tolerance. |
|
Calculate excitation errors for a set of reciprocal space vectors. |
|
Filter reciprocal space vectors based on excitation errors and reflection conditions. |
|
Generate all possible linear combinations of the given vectors with the given coefficients. |
|
Returns a boolean mask indicating which reflections satisfy the reflection condition based on the given lattice centering. |
|
Get the length of the shortest reciprocal space vector in the given unit cell. |
|
Calculate the reciprocal cell of a unit cell. |
|
Returns the relative positions for each lattice centering type. |
|
Convert a raveled array to a 3D array with the shape of the structure factor. |
|
API#
- abtem.bloch.utils.all_positions_have_relative_periodic_pair(...) bool[source]#
Check if all positions have a relative periodic pair.
- abtem.bloch.utils.are_vectors_orthogonal(...) bool[source]#
Check if two vectors are orthogonal within a given tolerance.
- abtem.bloch.utils.auto_detect_centering(...) str[source]#
Automatically detect the lattice centering of a crystal structure.
- abtem.bloch.utils.check_orthogonality(...) bool[source]#
Check if three vectors are pairwise orthogonal within a given tolerance.
- abtem.bloch.utils.excitation_errors(...) ndarray[source]#
Calculate excitation errors for a set of reciprocal space vectors.
- abtem.bloch.utils.filter_reciprocal_space_vectors(...) ndarray[source]#
Filter reciprocal space vectors based on excitation errors and reflection conditions.
- Parameters:
hkl (ndarray) – Reciprocal space vectors.
cell (Cell) – Unit cell.
energy (float) – Electron energy [eV].
sg_max (float) – Maximum excitation error [1/Å].
g_max (float) – Maximum scattering vector length [1/Å].
centering (str, optional) – Crystal centering must be one of ‘P’, ‘I’, ‘A’, ‘B’, ‘C’ or ‘F’. Default is ‘P’.
orientation_matrices (ndarray, optional) – Orientation matrices for each crystallographic direction.
- Returns:
Mask for the reciprocal space vectors.
- Return type:
- abtem.bloch.utils.generate_linear_combinations(...) ndarray[source]#
Generate all possible linear combinations of the given vectors with the given coefficients.
- abtem.bloch.utils.get_reflection_condition(...) ndarray[source]#
Returns a boolean mask indicating which reflections satisfy the reflection condition based on the given lattice centering.
- abtem.bloch.utils.get_shortest_g_vec_length(...) float[source]#
Get the length of the shortest reciprocal space vector in the given unit cell.
- Parameters:
cell (Cell) – Unit cell.
- Returns:
Length of the shortest reciprocal space vector [1/Å].
- Return type:
- abtem.bloch.utils.reciprocal_cell(...) ndarray[source]#
Calculate the reciprocal cell of a unit cell.
- Parameters:
cell (3x3 numpy.ndarray) – The unit cell.
- Returns:
The reciprocal cell.
- Return type:
3x3 numpy.ndarray
- abtem.bloch.utils.relative_positions_for_centering() dict[str, ndarray][source]#
Returns the relative positions for each lattice centering type.
- Returns:
A dictionary where the keys are the centering types and the values are the relative positions.
- Return type:
- abtem.bloch.utils.retrieve_structure_factor_values(...) ndarray[source]#
Convert a raveled array to a 3D array with the shape of the structure factor.
- Parameters:
array (ndarray) – The raveled array.
hkl_source (ndarray) – The reciprocal space vectors as Miller indices for the source array.
hkl_destination (ndarray) – The reciprocal space vectors as Miller indices for the destination array.
gpts (tuple of ints) – The number of grid points in the 3D structure factor.
- Returns:
The 3D array.
- Return type: