Aberrations#

class abtem.transfer.Aberrations(aberration_coefficients=None, energy=None, extent=None, gpts=None, sampling=None, **kwargs)[source]#

Bases: BaseTransferFunction, _HasAberrations

Phase aberrations.

Parameters:
  • aberration_coefficients (dict, optional) – Mapping from aberration symbols to their corresponding values. All aberration magnitudes should be given in [Å] and angles should be given in [radian].

  • energy (float, optional) – Electron energy [eV]. If not provided, inferred from the wave functions.

  • extent (float or two float, optional) – Lateral extent of wave functions [Å] in x and y directions. If a single float is given, both are set equal.

  • gpts (two ints, optional) – Number of grid points describing the wave functions.

  • sampling (two float, optional) – Lateral sampling of wave functions [Å]. If ‘gpts’ is also given, will be ignored.

  • kwargs (dict, optional) – Optionally provide the aberration coefficients as keyword arguments.

__init__(aberration_coefficients=None, energy=None, extent=None, gpts=None, sampling=None, **kwargs)[source]#

Methods

__init__([aberration_coefficients, energy, ...])

apply(waves[, max_batch])

copy()

Make a copy.

ensemble_blocks([chunks])

Split the ensemble into an array of smaller ensembles.

generate_blocks([chunks])

Generate chunks of the ensemble.

match_grid(other[, check_match])

Match the grid to another object with a Grid.

set_aberrations(aberration_coefficients)

Set the phase of the phase aberration.

show([max_angle])

to_diffraction_patterns([max_angle, gpts])

Converts the transfer function instance to DiffractionPatterns.

Attributes

aberration_coefficients

The aberration coefficients as a dictionary.

accelerator

Accelerator object describing the acceleration energy.

angular_sampling

The sampling in scattering angles of the transfer function [mrad].

axes_metadata

List of AxisMetadata.

base_axes_metadata

List of AxisMetadata of the base axes.

base_shape

Shape of the base axes.

defocus

The defocus [Å].

distributions

energy

Electron acceleration energy in electron volts.

ensemble_axes_metadata

Axes metadata describing the ensemble axes added to the waves when applying the transform.

ensemble_shape

The shape of the ensemble axes added to the waves when applying the transform.

extent

Extent of grid for each dimension in Ångstrom.

gpts

Number of grid points for each dimension.

grid

Simulation grid.

in_place

The array representing the waves may be modified in-place.

metadata

Metadata added to the waves when applying the transform.

reciprocal_space_sampling

Reciprocal-space sampling in reciprocal Ångstrom.

sampling

Grid sampling for each dimension in Ångstrom per grid point.

shape

Shape of the ensemble.

wavelength

Relativistic wavelength in Ångstrom.

C10

C12

phi12

C21

phi21

C23

phi23

C30

C32

phi32

C34

phi34

C41

phi41

C43

phi43

C45

phi45

C50

C52

phi52

C54

phi54

C56

phi56

Cs

C5

astigmatism

astigmatism_angle

astigmatism3

astigmatism3_angle

astigmatism5

astigmatism5_angle

coma

coma_angle

coma4

coma4_angle

trefoil

trefoil_angle

trefoil4

trefoil4_angle

quadrafoil

quadrafoil_angle

quadrafoil5

quadrafoil5_angle

pentafoil

pentafoil_angle

hexafoil

hexafoil_angle

property aberration_coefficients: Mapping[str, float | BaseDistribution]#

The aberration coefficients as a dictionary.

property accelerator: Accelerator#

Accelerator object describing the acceleration energy.

property angular_sampling: tuple[float, float]#

The sampling in scattering angles of the transfer function [mrad].

property axes_metadata: AxesMetadataList#

List of AxisMetadata.

property base_axes_metadata: list[AxisMetadata]#

List of AxisMetadata of the base axes.

property base_shape: tuple[int, ...]#

Shape of the base axes.

copy()#

Make a copy.

Return type:

Self

property defocus: float | BaseDistribution#

The defocus [Å].

property energy: float | None#

Electron acceleration energy in electron volts.

property ensemble_axes_metadata: list[AxisMetadata]#

Axes metadata describing the ensemble axes added to the waves when applying the transform.

ensemble_blocks(chunks=None)#

Split the ensemble into an array of smaller ensembles.

Parameters:

chunks (iterable of tuples) – Block sizes along each dimension.

Return type:

Array

property ensemble_shape: tuple[int, ...]#

The shape of the ensemble axes added to the waves when applying the transform.

property extent: tuple[float, float] | None#

Extent of grid for each dimension in Ångstrom.

generate_blocks(chunks=1)#

Generate chunks of the ensemble.

Parameters:

chunks (iterable of tuples) – Block sizes along each dimension.

Return type:

Generator[tuple[tuple[int, ...], tuple[slice, ...], ndarray], None, None]

property gpts: tuple[int, int] | None#

Number of grid points for each dimension.

property grid: Grid#

Simulation grid.

property in_place: bool#

The array representing the waves may be modified in-place.

match_grid(other, check_match=False)#

Match the grid to another object with a Grid.

property metadata: dict#

Metadata added to the waves when applying the transform.

property reciprocal_space_sampling: tuple[float, float]#

Reciprocal-space sampling in reciprocal Ångstrom.

property sampling: tuple[float, float] | None#

Grid sampling for each dimension in Ångstrom per grid point.

set_aberrations(aberration_coefficients)#

Set the phase of the phase aberration.

Parameters:

aberration_coefficients (dict) – Mapping from aberration symbols to their corresponding values.

Return type:

None

property shape: tuple[int, ...]#

Shape of the ensemble.

to_diffraction_patterns(max_angle=None, gpts=None)#

Converts the transfer function instance to DiffractionPatterns.

Parameters:
  • max_angle (float, optional) – The maximum diffraction angle in radians. If not provided, the maximum angle will be determined based on the self._max_semiangle_cutoff attribute of the instance. If neither max_angle nor self._max_semiangle_cutoff is available, a RuntimeError will be raised.

  • gpts (int | tuple[int, int], optional) – The number of grid points in reciprocal space for performing Fourier Transform. If not provided, a default value of 128 will be used.

Returns:

The diffraction patterns obtained from the conversion.

Return type:

abtem.measurements.DiffractionPatterns

property wavelength: float#

Relativistic wavelength in Ångstrom.