Probe#

class abtem.waves.Probe(semiangle_cutoff=None, extent=None, gpts=None, sampling=None, energy=None, soft=True, tilt=(0.0, 0.0), device=None, aperture=None, aberrations=None, positions=None, metadata=None, **kwargs)[source]#

Bases: abtem.waves._WavesBuilder

Represents electron-probe wave functions for simulating experiments with a convergent beam, such as CBED and STEM.

Parameters
  • semiangle_cutoff (float, optional) – The cutoff semiangle of the aperture [mrad]. Ignored if a custom aperture is given.

  • 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 [1 / Å]. If ‘gpts’ is also given, will be ignored.

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

  • soft (float, optional) – Taper the edge of the default aperture [mrad] (default is 2.0). Ignored if a custom aperture is given.

  • tilt (two float, two 1D BaseDistribution, 2D BaseDistribution, optional) – Small-angle beam tilt [mrad]. This value should generally not exceed one degree.

  • device (str, optional) – The probe wave functions will be build and stored on this device (‘cpu’ or ‘gpu’). The default is determined by the user configuration.

  • aperture (BaseAperture, optional) – An optional custom aperture. The provided aperture should be a subtype of BaseAperture.

  • aberrations (dict or Aberrations) – The phase aberrations as a dictionary.

  • transforms (list of WaveTransform) – A list of additional wave function transforms which will be applied after creation of the probe wave functions.

  • kwargs – Provide the aberrations as keyword arguments, forwarded to the Aberrations.

__init__(semiangle_cutoff=None, extent=None, gpts=None, sampling=None, energy=None, soft=True, tilt=(0.0, 0.0), device=None, aperture=None, aberrations=None, positions=None, metadata=None, **kwargs)[source]#

Methods

__init__([semiangle_cutoff, extent, gpts, ...])

build([scan, max_batch, lazy])

Build probe wave functions at the provided positions.

check_can_build([potential])

Check whether the wave functions can be built.

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.

multislice(potential[, scan, detectors, ...])

Run the multislice algorithm for probe wave functions at the provided positions.

profiles([angle])

Create a line profile through the center of the probe.

scan(potential[, scan, detectors, ...])

Run the multislice algorithm from probe wave functions over the provided scan.

select_block(index, chunks)

Select a block from the ensemble.

show([complex_images])

Show the intensity of the probe wave function.

Attributes

aberrations

Phase aberrations of the probe wave functions.

accelerator

Accelerator object describing the acceleration energy.

angular_sampling

Reciprocal-space sampling in units of scattering angles [mrad].

antialias_cutoff_gpts

The number of grid points along the x and y direction in the simulation grid at the antialiasing cutoff scattering angle.

antialias_valid_gpts

The number of grid points along the x and y direction in the simulation grid for the largest rectangle that fits within antialiasing cutoff scattering angle.

aperture

Condenser or probe-forming aperture.

axes_metadata

List of AxisMetadata.

base_axes_metadata

List of AxisMetadata for the base axes in real space.

base_shape

Shape of the base axes of the waves.

ctf

Contrast transfer function describing the probe.

cutoff_angles

Scattering angles at the antialias cutoff [mrad].

device

The device where the waves are created.

dtype

The datatype of waves.

energy

Electron acceleration energy in electron volts.

ensemble_axes_metadata

List of AxisMetadata of the ensemble axes.

ensemble_shape

Shape of the ensemble axes of the waves.

extent

Extent of grid for each dimension in Ångstrom.

full_cutoff_angles

Scattering angles corresponding to the full wave function size [mrad].

gpts

Number of grid points for each dimension.

grid

Simulation grid.

metadata

Metadata describing the probe wave functions.

positions

The position(s) of the probe.

reciprocal_space_axes_metadata

List of AxisMetadata for base axes in reciprocal space.

reciprocal_space_sampling

Reciprocal-space sampling in reciprocal Ångstrom.

rectangle_cutoff_angles

Scattering angles corresponding to the sides of the largest rectangle within the antialias cutoff [mrad].

sampling

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

semiangle_cutoff

The semiangle cutoff [mrad].

shape

Shape of the waves.

soft

True if the aperture has a soft edge.

tilt

The small-angle tilt of applied to the Fresnel propagator [mrad].

wavelength

Relativistic wavelength in Ångstrom.

property aberrations: abtem.transfer.Aberrations#

Phase aberrations of the probe wave functions.

Return type

Aberrations

property accelerator: abtem.core.energy.Accelerator#

Accelerator object describing the acceleration energy.

Return type

Accelerator

property angular_sampling: tuple[float, float]#

Reciprocal-space sampling in units of scattering angles [mrad].

Return type

tuple[float, float]

property antialias_cutoff_gpts: tuple[int, int]#

The number of grid points along the x and y direction in the simulation grid at the antialiasing cutoff scattering angle.

Return type

tuple[int, int]

property antialias_valid_gpts: tuple[int, int]#

The number of grid points along the x and y direction in the simulation grid for the largest rectangle that fits within antialiasing cutoff scattering angle.

Return type

tuple[int, int]

property aperture: abtem.transfer.Aperture#

Condenser or probe-forming aperture.

Return type

Aperture

property axes_metadata: abtem.core.axes.AxesMetadataList#

List of AxisMetadata.

Return type

AxesMetadataList

property base_axes_metadata: list[abtem.core.axes.AxisMetadata]#

List of AxisMetadata for the base axes in real space.

Return type

list[AxisMetadata]

property base_shape: tuple[int, int]#

Shape of the base axes of the waves.

Return type

tuple[int, int]

build(scan=None, max_batch='auto', lazy=None)[source]#

Build probe wave functions at the provided positions.

Parameters
  • scan (array of xy-positions or BaseScan, optional) – Positions of the probe wave functions. If not given, scans across the entire potential at Nyquist sampling.

  • max_batch (int, optional) – The number of wave functions in each chunk of the Dask array. If ‘auto’ (default), the batch size is automatically chosen based on the abtem user configuration settings “dask.chunk-size” and “dask.chunk-size-gpu”.

  • lazy (bool, optional) – If True, create the wave functions lazily, otherwise, calculate instantly. If not given, defaults to the setting in the user configuration file.

Returns

probe_wave_functions – The built probe wave functions.

Return type

Waves

check_can_build(potential=None)#

Check whether the wave functions can be built.

copy()#

Make a copy.

property ctf#

Contrast transfer function describing the probe.

property cutoff_angles: tuple[float, float]#

Scattering angles at the antialias cutoff [mrad].

Return type

tuple[float, float]

property device#

The device where the waves are created.

property dtype#

The datatype of waves.

property energy#

Electron acceleration energy in electron volts.

property ensemble_axes_metadata: list[abtem.core.axes.AxisMetadata]#

List of AxisMetadata of the ensemble axes.

Return type

list[AxisMetadata]

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#

Shape of the ensemble axes of the waves.

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

Extent of grid for each dimension in Ångstrom.

Return type

tuple[float] | tuple[float, float] | tuple[float, …]

property full_cutoff_angles: tuple[float, float]#

Scattering angles corresponding to the full wave function size [mrad].

Return type

tuple[float, float]

generate_blocks(chunks=1)#

Generate chunks of the ensemble.

Parameters

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

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

Number of grid points for each dimension.

Return type

tuple[int] | tuple[int, int] | tuple[int, …]

property grid: abtem.core.grid.Grid#

Simulation grid.

Return type

Grid

match_grid(other, check_match=False)#

Match the grid to another object with a Grid.

property metadata: dict#

Metadata describing the probe wave functions.

Return type

dict

multislice(potential, scan=None, detectors=None, max_batch='auto', lazy=None)[source]#

Run the multislice algorithm for probe wave functions at the provided positions.

Parameters
  • potential (BasePotential or Atoms) – The scattering potential. Optionally atoms can be directly given.

  • scan (array of xy-positions or BaseScan, optional) – Positions of the probe wave functions. If not given, scans across the entire potential at Nyquist sampling.

  • detectors (BaseDetector or list of BaseDetector, optional) – A detector or a list of detectors defining how the wave functions should be converted to measurements after running the multislice algorithm. If not given, defaults to the flexible annular detector.

  • max_batch (int, optional) – The number of wave functions in each chunk of the Dask array. If ‘auto’ (default), the batch size is automatically chosen based on the abtem user configuration settings “dask.chunk-size” and “dask.chunk-size-gpu”.

  • lazy (bool, optional) – If True, create the wave functions lazily, otherwise, calculate instantly. If None, this defaults to the setting in the user configuration file.

Returns

measurements

Return type

BaseMeasurements or Waves or list of BaseMeasurement

property positions: abtem.scan.BaseScan#

The position(s) of the probe.

Return type

BaseScan

profiles(angle=0.0)[source]#

Create a line profile through the center of the probe.

Parameters

angle (float, optional) – Angle with respect to the x-axis of the line profile [degree].

Return type

RealSpaceLineProfiles

property reciprocal_space_axes_metadata: list[abtem.core.axes.AxisMetadata]#

List of AxisMetadata for base axes in reciprocal space.

Return type

list[AxisMetadata]

property reciprocal_space_sampling: tuple[float] | tuple[float, float] | tuple[float, ...]#

Reciprocal-space sampling in reciprocal Ångstrom.

Return type

tuple[float] | tuple[float, float] | tuple[float, …]

property rectangle_cutoff_angles: tuple[float, float]#

Scattering angles corresponding to the sides of the largest rectangle within the antialias cutoff [mrad].

Return type

tuple[float, float]

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

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

Return type

tuple[float] | tuple[float, float] | tuple[float, …]

scan(potential, scan=None, detectors=None, max_batch='auto', lazy=None)[source]#

Run the multislice algorithm from probe wave functions over the provided scan.

Parameters
  • potential (BasePotential or Atoms) – The scattering potential.

  • scan (BaseScan) – Positions of the probe wave functions. If not given, scans across the entire potential at Nyquist sampling.

  • detectors (BaseDetector, list of BaseDetector, optional) – A detector or a list of detectors defining how the wave functions should be converted to measurements after running the multislice algorithm. See abtem.measurements.detect for a list of implemented detectors.

  • max_batch (int, optional) – The number of wave functions in each chunk of the Dask array. If ‘auto’ (default), the batch size is automatically chosen based on the abtem user configuration settings “dask.chunk-size” and “dask.chunk-size-gpu”.

  • lazy (bool, optional) – If True, create the measurements lazily, otherwise, calculate instantly. If None, this defaults to the value set in the configuration file.

Return type

BaseMeasurements | Waves | list[BaseMeasurements | Waves]

Returns

  • detected_waves (BaseMeasurements or list of BaseMeasurement) – The detected measurement (if detector(s) given).

  • exit_waves (Waves) – Wave functions at the exit plane(s) of the potential (if no detector(s) given).

select_block(index, chunks)#

Select a block from the ensemble.

Parameters
  • index (tuple of ints) – Index of selected block.

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

property semiangle_cutoff#

The semiangle cutoff [mrad].

property shape#

Shape of the waves.

show(complex_images=False, **kwargs)[source]#

Show the intensity of the probe wave function.

Parameters
  • complex_images (bool) – If true shows complex images using domain-coloring instead of the intensity.

  • kwargs (Keyword arguments for the Images.show() function.) –

property soft#

True if the aperture has a soft edge.

property tilt#

The small-angle tilt of applied to the Fresnel propagator [mrad].

property wavelength#

Relativistic wavelength in Ångstrom.