Ensembles

Contents

import abtem
import numpy as np

Ensembles#

The concept of ensembles is key to several features in abTEM, most of the key objects in abTEM has a set of base axes and a set of ensemble axes. The base axes are basic axes necessary to describe an object type, for example, the \(xy\)-part of a wave function, described by for example Waves or Probe, requires at least two axes. However, additional ensemble axes may be used to describe multiple wave function with different experimental parameters, for example a series of defocus, scan positions and exit plane thicknesses.

probe = abtem.Probe(extent=10, gpts=256, semiangle_cutoff=30, defocus=np.linspace())

Each wave in the ensemble is independent, hence allowing for trivial parallelization across the ensemble. abTEM uses Dask to automatically distribute the ensemble over the available resources.

Advanced usage#

ctf = abtem.CTF(defocus=np.linspace(0,100,4), Cs=np.linspace(0,100,4))

blocks = ctf.ensemble_blocks(4).compute()

blocks
array([[<abtem.transfer.CTF object at 0x7fa3c5c4f580>,
        <abtem.transfer.CTF object at 0x7fa3c5c4f1f0>],
       [<abtem.transfer.CTF object at 0x7fa3c5c4f520>,
        <abtem.transfer.CTF object at 0x7fa3c5c4f1c0>]], dtype=object)