CTF#

class abtem.transfer.CTF(semiangle_cutoff=inf, soft=True, focal_spread=0.0, angular_spread=0.0, aberration_coefficients=None, energy=None, extent=None, gpts=None, sampling=None, flip_phase=False, wiener_snr=0.0, **kwargs)[source]#

Bases: abtem.transfer._HasAberrations, abtem.transfer.BaseAperture

The contrast transfer function (CTF) describes the aberrations of the objective lens in HRTEM and specifies how the condenser system shapes the probe in STEM.

abTEM implements phase aberrations up to 5th order using polar coefficients. See Eq. 2.22 in the reference 1.

Cartesian coefficients can be converted to polar using the utility function abtem.transfer.cartesian2polar.

Partial coherence is included as envelopes in the quasi-coherent approximation. See Chapter 3.2 in reference 1.

Parameters
  • semiangle_cutoff (float, optional) – The semiangle cutoff describes the sharp reciprocal-space cutoff due to the objective aperture [mrad] (default is no cutoff).

  • soft (bool, optional) – If True, the edge of the aperture is softened (default is True).

  • focal_spread (float, optional) – The standard deviation of the focal spread due to chromatic aberration and lens current instability [Å] (default is 0).

  • angular_spread (float, optional) – The standard deviation of the angular deviations due to source size [Å] (default is 0).

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

  • flip_phase (bool, optional) – Changes the sign of all negative parts of the CTF to positive (following doi:10.1016/j.ultramic.2008.03.004) (default is False).

  • wiener_snr (float, optional) – Applies a Wiener filter to the CTF (following doi:10.1016/j.ultramic.2008.03.004) with a given SNR value. If no value is given, the default value of 0.0 means that no filter is applied.

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

References

1(1,2)

Kirkland, E. J. (2010). Advanced Computing in Electron Microscopy (2nd ed.). Springer.

__init__(semiangle_cutoff=inf, soft=True, focal_spread=0.0, angular_spread=0.0, aberration_coefficients=None, energy=None, extent=None, gpts=None, sampling=None, flip_phase=False, wiener_snr=0.0, **kwargs)[source]#

Methods

__init__([semiangle_cutoff, soft, ...])

apply(waves)

Apply the transform to the given waves.

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.

profiles([gpts, max_angle, phi])

Calculate radial line profiles for each included component (phase aberrations, aperture, temporal and spatial envelopes) of the contrast transfer function.

select_block(index, chunks)

Select a block from the ensemble.

set_aberrations(aberration_coefficients)

Set the phase of the phase aberration.

show(**kwargs)

to_diffraction_patterns([max_angle, gpts])

to_point_spread_functions(gpts, extent)

Attributes

C10

C12

C21

C23

C30

C32

C34

C41

C43

C45

C5

C50

C52

C54

C56

Cs

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].

angular_spread

The standard deviation of the angular deviations due to source size [mrad].

astigmatism

astigmatism_angle

axes_metadata

List of AxisMetadata.

base_axes_metadata

List of AxisMetadata of the base axes.

base_shape

Shape of the base axes.

coma

coma_angle

crossover_angle

The first zero-crossing of the phase at Scherzer defocus [mrad].

defocus

Defocus equivalent to negative C10.

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.

flip_phase

If true the signs of all negative parts of the CTF are changed to positive.

focal_spread

The standard deviation of the focal spread [Å].

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.

nyquist_sampling

Nyquist sampling corresponding to the semiangle cutoff of the aperture [Å].

phi12

phi21

phi23

phi32

phi34

phi41

phi43

phi45

phi52

phi54

phi56

point_resolution

The Scherzer point resolution [Å].

reciprocal_space_sampling

Reciprocal-space sampling in reciprocal Ångstrom.

sampling

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

scherzer_defocus

The Scherzer defocus [Å].

semiangle_cutoff

The semiangle cutoff [mrad].

shape

Shape of the ensemble.

soft

True if the aperture has a soft edge.

wavelength

Relativistic wavelength in Ångstrom.

wiener_snr

If true a Wiener filter is applied to the CTF.

property aberration_coefficients#

The aberration coefficients as a dictionary.

property accelerator: abtem.core.energy.Accelerator#

Accelerator object describing the acceleration energy.

Return type

Accelerator

property angular_sampling: tuple[float, float]#

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

Return type

tuple[float, float]

property angular_spread: float | BaseDistribution#

The standard deviation of the angular deviations due to source size [mrad].

Return type

float | BaseDistribution

apply(waves)#

Apply the transform to the given waves.

Parameters

array_object (ArrayObject) – The array object to transform.

Returns

transformed_array_object

Return type

ArrayObject

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 of the base axes.

Return type

list[AxisMetadata]

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

Shape of the base axes.

Return type

tuple[int, ...]

copy()#

Make a copy.

property crossover_angle#

The first zero-crossing of the phase at Scherzer defocus [mrad].

property defocus: float | BaseDistribution#

Defocus equivalent to negative C10.

Return type

float | BaseDistribution

property energy#

Electron acceleration energy in electron volts.

property ensemble_axes_metadata#

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#

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

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 flip_phase: bool#

If true the signs of all negative parts of the CTF are changed to positive.

Return type

bool

property focal_spread: float | BaseDistribution#

The standard deviation of the focal spread [Å].

Return type

float | BaseDistribution

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

property in_place: bool#

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

Return type

bool

match_grid(other, check_match=False)#

Match the grid to another object with a Grid.

property metadata#

Metadata added to the waves when applying the transform.

property nyquist_sampling: float#

Nyquist sampling corresponding to the semiangle cutoff of the aperture [Å].

Return type

float

property point_resolution#

The Scherzer point resolution [Å].

profiles(gpts=1000, max_angle=None, phi=0.0)[source]#

Calculate radial line profiles for each included component (phase aberrations, aperture, temporal and spatial envelopes) of the contrast transfer function.

Parameters
  • gpts (int) – Number of grid points along the line profiles.

  • max_angle (float) – The maximum scattering angle included in the radial line profiles [mrad]. The default is 1.5 times the semiangle cutoff or 50 mrad if no semiangle cutoff is set.

  • phi (float) – The azimuthal angle of the radial line profiles [rad]. Default is 0.

Returns

ctf_profiles – Ensemble of reciprocal space line profiles. The first ensemble dimension represents the different

Return type

ReciprocalSpaceLineProfiles

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 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, …]

property scherzer_defocus#

The Scherzer defocus [Å].

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: float | BaseDistribution#

The semiangle cutoff [mrad].

Return type

float | BaseDistribution

set_aberrations(aberration_coefficients)#

Set the phase of the phase aberration.

Parameters

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

property shape#

Shape of the ensemble.

property soft: float#

True if the aperture has a soft edge.

Return type

float

property wavelength#

Relativistic wavelength in Ångstrom.

property wiener_snr: float#

If true a Wiener filter is applied to the CTF.

Return type

float