CustomScan#

class abtem.scan.CustomScan(positions=(0.0, 0.0), squeeze=False)[source]#

Bases: BaseScan

Custom scan based on explicit 2D probe positions.

Parameters:

positions (np.ndarray, optional) – Scan positions [Å]. Anything that can be converted to an ndarray of shape (n, 3) is accepted. Default is (0., 0.).

__init__(positions=(0.0, 0.0), squeeze=False)[source]#

Methods

__init__([positions, squeeze])

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.

get_positions()

Get the scan positions as numpy array.

match_probe(probe)

Sets the positions to a single position in the center of the probe extent.

select_block(index, chunks)

Select a block from the ensemble.

Attributes

axes_metadata

List of AxisMetadata.

base_axes_metadata

List of AxisMetadata of the base axes.

base_shape

Shape of the base axes.

distributions

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.

in_place

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

limits

Lower left and upper right corner of the bounding box containing all positions in the scan.

metadata

Metadata added to the waves when applying the transform.

num_positions

Number of probe positions in the scan.

positions

Scan positions [Å].

shape

The shape the scan.

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

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: tuple[int, ...]#

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

generate_blocks(chunks=1)#

Generate chunks of the ensemble.

Parameters:

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

get_positions()[source]#

Get the scan positions as numpy array.

Return type:

ndarray

property in_place: bool#

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

property limits#

Lower left and upper right corner of the bounding box containing all positions in the scan.

match_probe(probe)[source]#

Sets the positions to a single position in the center of the probe extent.

Parameters:

probe (Probe or BaseSMatrix) – The matched probe or s-matrix.

property metadata: dict#

Metadata added to the waves when applying the transform.

property num_positions: int#

Number of probe positions in the scan.

property positions#

Scan positions [Å].

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 shape#

The shape the scan.