PED quickstart

Hide code cell source
%config InlineBackend.rc = {"figure.dpi": 72, "figure.figsize": (6.0, 4.0)}
%matplotlib inline

import ase
import matplotlib.pyplot as plt
from abtem.tilt import precession_tilts
from ase.io import read

import abtem

PED quickstart#

atoms = read("data/SiO2_zeolite.cif")

cell = atoms.cell.copy()

atoms *= (1, 1, 20)

abtem.show_atoms(atoms, plane="xy");
../../../_images/920428f6e7cda525a33974e0120c8f024007b2397f295350d4ed3ff123aabf86.png
frozen_phonons = abtem.FrozenPhonons(atoms, 4, sigmas=0.078)
potential = abtem.Potential(
    frozen_phonons,
    sampling=.5,
    projection="infinite",
    slice_thickness=1,
)
wave = abtem.PlaneWave(energy=100e3)
wave.grid.match(potential)
wave.tilt = precession_tilts(50, 5)
measurement = wave.multislice(potential).diffraction_patterns().mean(0).compute()
[########################################] | 100% Completed | 2.46 sms
spots = (
    measurement.crop(25)
    .block_direct()
    .index_diffraction_spots(cell=atoms, threshold=1e-5)
)
visualization = spots.show(explode=True, scale=0.8, figsize=(16, 5))
visualization.axis_off(spines=False)
../../../_images/c388fe7f15b26c0e8bbb3037741fc2d798b7b9b7558cccb9322864fbce813aa5.png