ACOM of polycrystalline WS2 thin film - disk detection
This notebook performs disk detection for the AuAgPd nanowire 4D-STEM bullseye experiment. The data has been downsampled for the purposes of the tutorial.
Our goal is to perform automated crystal orientation mapping (ACOM), as described in:
Automated Crystal Orientation Mapping in py4DSTEM using Sparse Correlation Matching
Data
polycrystal_2D_WS2.h5 (1.0 GB)
WS2.cif (2 kB)
This dataset is a simulation of a polycrystalline WS2 thin film, where each grain has an [0001] zone axis orientation, and a random in-plane rotation. Each grain has been randomly strained by -2%, -1%, 0%, 1%, or 2%, for e_xx, e_yy, and e_xy. This makes checking the output strain maps easier, as each grain has an exact multiple of 1% strain for each value in the strain tensor. The dataset for this tutorial has also been downsampled in both real and diffraction space to make a small example.
pymatgen
This notebook requires that pymatgen is installed.
Acknowledgements
This tutorial was created by the py4DSTEM instructor team:
- Colin Ophus (clophus@lbl.gov)
- Alex Rakowski (arakowski@lbl.gov)
- Stephanie Ribet (sribet@lbl.gov)
- Ben Savitzky (bhsavitzky@lbl.gov)
- Steve Zeltmann (steven.zeltmann@berkeley.edu)
0.14.3
Load data
/ |---4DSTEM |---datacube |---calibration
Virtual imaging
VirtualDiffraction( A 2-dimensional array of shape (128, 128) called 'dp_mean', with dimensions: dim0 = [0,1,2,...] pixels dim1 = [0,1,2,...] pixels )
We can see the polycrystalline grain structure of the WS2 in the maximum diffraction pattern. Many diffraction rings are present, with Bragg peaks at many different rotations along these rings.
Two kinds of contrast changes are visible in the virtual dark field image:
- The grain boundaries show up as bright lines bordering the polycrystalline grains.
- Some grains appear brighter or darker - this is because the applied strain fields increase or decrease the atomic density of the grains, leading to more or less diffraction into the annular dark field region.
Probe template
100%|████████████████████████████████████████████████████████████████████████████████| 399/399 [00:00<00:00, 607.87it/s]
Bragg disk detection
Finding Bragg Disks: 100%|██████████████████████████████████████████████████████████| 16.4k/16.4k [00:33<00:00, 485DP/s]
Centering and calibration
Pixel size calibration
/home/cophus/anaconda3/envs/py4dstem/lib/python3.11/site-packages/pymatgen/io/cif.py:1145: UserWarning: Issues encountered while parsing CIF: Some fractional coordinates rounded to ideal values to avoid issues with finite precision. warnings.warn("Issues encountered while parsing CIF: " + "\n".join(self.warnings))
{'center': True, 'ellipse': False, 'pixel': True, 'rotate': False}
100%|███████████████████████████████████████████████████████████████████████████| 16384/16384 [00:01<00:00, 8928.09it/s]
Automated crystal orientation mapping (ACOM)
/ |---datacube_root |---braggvectors |---_v_uncal
Reading PointListArray: 100%|████████████████████████████████████████████| 16384/16384 [00:02<00:00, 6017.15PointList/s] /home/cophus/anaconda3/envs/py4dstem/lib/python3.11/site-packages/pymatgen/io/cif.py:1145: UserWarning: Issues encountered while parsing CIF: Some fractional coordinates rounded to ideal values to avoid issues with finite precision. warnings.warn("Issues encountered while parsing CIF: " + "\n".join(self.warnings))
Orientation plan: 100%|██████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 327.02 zone axes/s]
/home/cophus/anaconda3/envs/py4dstem/lib/python3.11/site-packages/py4DSTEM/process/diffraction/crystal_ACOM.py:776: UserWarning: Warning: bragg peaks not elliptically calibrated warn('Warning: bragg peaks not elliptically calibrated') /home/cophus/anaconda3/envs/py4dstem/lib/python3.11/site-packages/py4DSTEM/process/diffraction/crystal_ACOM.py:781: UserWarning: bragg peaks not rotationally calibrated warn('bragg peaks not rotationally calibrated') Matching Orientations: 100%|█████████████████████████████████████████████| 16384/16384 [00:49<00:00, 330.10 PointList/s]
Strain maps
For each diffraction pattern, we have both the measured diffraction pattern Bragg peaks, and the Bragg peaks calculated from the best-fit orientation. We can therefore directly calculate a strain map, just by measuring the best-fit transformation tensor between these two sets of peaks.
/home/cophus/anaconda3/envs/py4dstem/lib/python3.11/site-packages/py4DSTEM/process/diffraction/crystal_ACOM.py:1667: UserWarning: bragg peaks not elliptically calibrated warn('bragg peaks not elliptically calibrated') /home/cophus/anaconda3/envs/py4dstem/lib/python3.11/site-packages/py4DSTEM/process/diffraction/crystal_ACOM.py:1672: UserWarning: bragg peaks not rotationally calibrated warn('bragg peaks not rotationally calibrated') Calculating strains: 100%|██████████████████████████████████████████████| 16384/16384 [00:11<00:00, 1386.36 PointList/s]