Bullseye#
- class abtem.transfer.Bullseye(num_spokes, spoke_width, num_rings, ring_width, semiangle_cutoff, energy=None, extent=None, gpts=None, sampling=None, edge_softness=0.0, corner_radius=0.0)[source]#
Bases:
BaseApertureBullseye aperture.
The aperture is divided radially into num_rings periods, each consisting of an open annulus followed by an opaque gap; ring_width is the open fraction of each period. The open annulus width is
ds = semiangle_cutoff * ring_width / (ring_width + num_rings - 1), and a ring_width of 1 gives a fully open disk. Opaque spokes cross all rings except the central disk; each spoke is a straight bar of constant linear widthspoke_width * ds(in the same reciprocal-angle units as ds), not a wedge of constant angular width. Consequently spoke_width has no meaningful upper bound of 1 the way ring_width does: a fixed spoke_width blocks a larger angular fraction of rings closer to the center than rings farther out, so increasing it reduces transmission monotonically but not linearly, with rings saturating to fully blocked from the center outward. The central disk is never affected by spokes, so transmission approaches (but never reaches) “central disk only” as spoke_width grows.- Parameters:
num_spokes (int) – Number of spokes.
spoke_width (float) – Width of the opaque spokes, as a multiple of the open annulus width ds (see above) rather than an angular fraction. Must be non-negative; unlike ring_width, values greater than 1 are valid and simply widen the spokes further.
num_rings (int) – Number of rings.
ring_width (float) – Open fraction of each radial ring period. Must be in the interval (0, 1], where 1 gives a fully open disk.
semiangle_cutoff (float) – The cutoff semiangle of the aperture [mrad].
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.
edge_softness (float, optional) – Edge softness in mrads. Default value is 0.0.
corner_radius (float, optional) – Corner radius in mrads. Default value is 0.0
- __init__(num_spokes, spoke_width, num_rings, ring_width, semiangle_cutoff, energy=None, extent=None, gpts=None, sampling=None, edge_softness=0.0, corner_radius=0.0)[source]#
Methods
__init__(num_spokes, spoke_width, num_rings, ...)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.
show([max_angle])to_diffraction_patterns([max_angle, gpts])Converts the transfer function instance to DiffractionPatterns.
Attributes
Accelerator object describing the acceleration energy.
The sampling in scattering angles of the transfer function [mrad].
List of AxisMetadata.
List of AxisMetadata of the base axes.
Shape of the base axes.
Corner radius [mrads]
distributionsEdge softness [mrads]
Electron acceleration energy in electron volts.
Axes metadata describing the ensemble axes added to the waves when applying the transform.
The shape of the ensemble axes added to the waves when applying the transform.
Extent of grid for each dimension in Ångstrom.
Number of grid points for each dimension.
Simulation grid.
The array representing the waves may be modified in-place.
Metadata added to the waves when applying the transform.
Number of rings.
Number of spokes.
Nyquist sampling corresponding to the semiangle cutoff of the aperture [Å].
Reciprocal-space sampling in reciprocal Ångstrom.
Open fraction of each radial ring period.
Grid sampling for each dimension in Ångstrom per grid point.
Semiangle cutoff of the aperture [mrad].
Shape of the ensemble.
True if the aperture has a soft edge
True if using soft edges
Width of the opaque spokes as a multiple of the open annulus width.
Relativistic wavelength in Ångstrom.
- 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 corner_radius: float#
Corner radius [mrads]
- property edge_softness: float#
Edge softness [mrads]
- 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 num_rings: int#
Number of rings.
- property num_spokes: int#
Number of spokes.
- property nyquist_sampling: float#
Nyquist sampling corresponding to the semiangle cutoff of the aperture [Å].
- property reciprocal_space_sampling: tuple[float, float]#
Reciprocal-space sampling in reciprocal Ångstrom.
- property ring_width: float#
Open fraction of each radial ring period.
- property sampling: tuple[float, float] | None#
Grid sampling for each dimension in Ångstrom per grid point.
- property semiangle_cutoff: float | BaseDistribution#
Semiangle cutoff of the aperture [mrad].
- property shape: tuple[int, ...]#
Shape of the ensemble.
- property soft: bool#
True if the aperture has a soft edge
- property soft_edges: bool#
True if using soft edges
- property spoke_width: float#
Width of the opaque spokes as a multiple of the open annulus width.
- 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:
- property wavelength: float#
Relativistic wavelength in Ångstrom.