WavesDetector#
- class abtem.detectors.WavesDetector(gpts=None, to_cpu=False, url=None)[source]#
Bases:
BaseDetectorDetect the complex wave functions.
- Parameters:
gpts (two int, optional) – Number of grid points of the detected wave functions. The waves are Fourier-interpolated onto gpts points over their unchanged extent, as
abtem.waves.Waves.downsample()does. If not given (default), the waves keep their grid.to_cpu (bool, optional) – If True, copy the measurement data from the calculation device to CPU memory after applying the detector, otherwise the data stays on the respective devices. Default is False: unlike the other detectors, this one returns the (large) wave functions themselves, and it is the implicit detector used when no detectors are given, so the data is left on the calculation device rather than forcing a device-to-host copy of every exit wave.
url (str, optional) – If this parameter is set the measurement data is saved at the specified location, typically a path to a local file. A URL can also include a protocol specifier like s3:// for remote data. If not set (default) the data stays in memory.
Methods
__init__([gpts, to_cpu, url])angular_limits(waves)The outer limits of the detected scattering angles in x and y [mrad] for the given waves.
apply(waves[, max_batch])copy()Make a copy.
detect(waves)Detect the given waves directly as complex waves.
ensemble_blocks([chunks])Split the ensemble into an array of smaller ensembles.
generate_blocks([chunks])Generate chunks of the ensemble.
Attributes
List of AxisMetadata.
List of AxisMetadata of the base axes.
Shape of the base axes.
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.
Number of grid points of the detected wave functions.
Metadata added to the waves when applying the transform.
Shape of the ensemble.
The measurements are copied to host memory.
The storage location of the measurement data.
- angular_limits(waves)[source]#
The outer limits of the detected scattering angles in x and y [mrad] for the given waves.
- Parameters:
waves (BaseWaves) – The waves to derive the detector limits from.
- Returns:
limits
- Return type:
tuple of float
- 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 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.
- 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 of the detected wave functions.
- property metadata: dict#
Metadata added to the waves when applying the transform.
- property shape: tuple[int, ...]#
Shape of the ensemble.
- property to_cpu: bool#
The measurements are copied to host memory.
- property url: str | None#
The storage location of the measurement data.