abtem.bloch.indexing#

Module Contents#

Functions#

antialiased_disk

Create an array representing disk with antialiased edges.

create_ellipse

Create an ellipse with semi-major and semi-minor axes.

estimate_necessary_excitation_error

index_diffraction_spots

Indexes diffraction spots in an array.

integrate_ellipse_around_pixels

Integrate an ellipse around pixels in an array.

miller_to_miller_bravais

Convert Miller indices to Miller-Bravais indices.

overlapping_spots_mask

Create a mask for overlapping diffraction spots. Spots with the same h and k indices are considered overlapping.

validate_cell

Validate the cell input.

API#

abtem.bloch.indexing.antialiased_disk(...) ndarray[source]#

Create an array representing disk with antialiased edges.

Parameters:
  • r (float) – The radius of the disk.

  • sampling (two float) – The sampling rate of the array in the x and y directions. Units are arbitrary.

Returns:

A 2D array representing the disk.

Return type:

ndarray

abtem.bloch.indexing.create_ellipse(...) ndarray[source]#

Create an ellipse with semi-major and semi-minor axes.

Parameters:
  • a (int) – The semi-major axis of the ellipse.

  • b (int) – The semi-minor axis of the ellipse.

Returns:

The ellipse.

Return type:

ndarray

abtem.bloch.indexing.estimate_necessary_excitation_error(...) float[source]#
abtem.bloch.indexing.index_diffraction_spots(...) ndarray[source]#

Indexes diffraction spots in an array.

Parameters:
  • array (ndarray) – The input array containing diffraction spot intensities.

  • hkl (ndarray) – The Miller indices to index.

  • sampling (tuple[float, float]) – The sampling rate of the array in the x and y directions [Å].

  • cell (Cell | ndarray) – The unit cell of the crystal structure.

  • energy (float) – The energy of the incident electrons [eV].

  • orientation_matrices (ndarray, optional) – The orientation matrices of the crystal structure. Defaults to None.

  • radius (float, optional) – The radius of the diffraction spots to integrate. Defaults to None.

Returns:

A tuple containing the indexed hkl values, wavevector transfer values, pixel coordinates, and intensities.

Return type:

tuple[ndarray, ndarray, ndarray, ndarray]

abtem.bloch.indexing.integrate_ellipse_around_pixels(...) ndarray[source]#

Integrate an ellipse around pixels in an array.

Parameters:
  • array (ndarray) – The input array containing diffraction spot intensities.

  • nm (ndarray) – The pixel coordinates of the diffraction spots.

Returns:

The integrated intensities around the pixels.

Return type:

ndarray

abtem.bloch.indexing.miller_to_miller_bravais(...) tuple[int, int, int, int][source]#

Convert Miller indices to Miller-Bravais indices.

Parameters:

hkl (tuple) – The Miller indices (h, k, l).

Returns:

The Miller-Bravais indices (H, K, I, L).

Return type:

tuple

abtem.bloch.indexing.overlapping_spots_mask(...) ndarray[source]#

Create a mask for overlapping diffraction spots. Spots with the same h and k indices are considered overlapping.

abtem.bloch.indexing.validate_cell(...) ase.cell.Cell[source]#

Validate the cell input.

Parameters:

cell (Atoms | Cell | float | tuple[float, float, float]) – The unit cell of the crystal structure.

Returns:

The validated cell.

Return type:

Cell