FlexibleAnnularDetector
FlexibleAnnularDetector#
- class abtem.detectors.FlexibleAnnularDetector(step_size=1.0, inner=0.0, outer=None, to_cpu=True, url=None)[source]#
Bases:
abtem.detectors._AbstractRadialDetectorThe flexible annular detector allows choosing the integration limits after running the simulation by binning the intensity in annular integration regions.
- Parameters
step_size (float, optional) – Radial extent of the bins [mrad] (default is 1).
inner (float, optional) – Inner integration limit of the bins [mrad].
outer (float, optional) – Outer integration limit of the bins [mrad].
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 True.
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__([step_size, inner, outer, to_cpu, url])angular_limits(waves)The outer limits of the detected scattering angles in x and y [mrad] for the given waves.
apply(array_object)Apply the transform to the given waves.
copy()Make a copy.
detect(waves)Detect the given waves producing polar measurements.
ensemble_blocks([chunks])Split the ensemble into an array of smaller ensembles.
generate_blocks([chunks])Generate chunks of the ensemble.
get_detector_regions([waves])Get the polar detector regions as a polar measurement.
select_block(index, chunks)Select a block from the ensemble.
show([waves])Show the segmented detector regions as a polar plot.
Attributes
List of AxisMetadata.
Spacing between the azimuthal detector bins [mrad].
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.
Inner integration limit [mrad].
Metadata added to the waves when applying the transform.
Outer integration limit [mrad].
Spacing between the radial detector bins [mrad].
Rotation of the bins around the origin [rad].
Shape of the ensemble.
Step size [mrad].
The measurements are copied to host memory.
The storage location of the measurement data.
- angular_limits(waves)#
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
- apply(array_object)#
Apply the transform to the given waves.
- Parameters
array_object (ArrayObject) – The array object to transform.
- Returns
transformed_array_object
- Return type
- property axes_metadata: abtem.core.axes.AxesMetadataList#
List of AxisMetadata.
- Return type
AxesMetadataList
- property azimuthal_sampling: float#
Spacing between the azimuthal detector bins [mrad].
- Return type
float
- 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.
- detect(waves)#
Detect the given waves producing polar measurements.
- Parameters
waves (Waves) – The waves to detect.
- Returns
measurement
- Return type
- property ensemble_axes_metadata: list[abtem.core.axes.AxisMetadata]#
Axes metadata describing the ensemble axes added to the waves when applying the transform.
- 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: tuple[int, ...]#
The shape of the ensemble axes added to the waves when applying the transform.
- Return type
tuple[int,...]
- generate_blocks(chunks=1)#
Generate chunks of the ensemble.
- Parameters
chunks (iterable of tuples) – Block sizes along each dimension.
- get_detector_regions(waves=None)#
Get the polar detector regions as a polar measurement.
- Parameters
waves (BaseWaves) – The waves to derive the polar detector regions from.
- Returns
detector_region
- Return type
- property inner: float#
Inner integration limit [mrad].
- Return type
float
- property metadata: dict#
Metadata added to the waves when applying the transform.
- Return type
dict
- property outer: float#
Outer integration limit [mrad].
- Return type
float
- property radial_sampling: float#
Spacing between the radial detector bins [mrad].
- Return type
float
- property rotation#
Rotation of the bins around the origin [rad].
- 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#
Shape of the ensemble.
- show(waves=None, **kwargs)#
Show the segmented detector regions as a polar plot.
- Parameters
waves (BaseWaves) – The waves to derive the segmented detector regions from.
kwargs – Optional keyword arguments for PolarMeasurements.show.
- Returns
visualization
- Return type
- property step_size: float#
Step size [mrad].
- Return type
float
- property to_cpu#
The measurements are copied to host memory.
- property url#
The storage location of the measurement data.