py4DSTEM: Open Source Software for 4D-STEM Data Analysis

Benjamin H. Savitzky, Lauren Hughes, Karen C. Bustillo, Haitao D. Deng, Norman L. Jin, Eder G. Lomeli, William C. Chueh, Patrick Herring, Andrew Minor, Colin Ophus
2019 Microscopy and Microanalysis  
py4DSTEM is a free, open source, python-based data analysis package for the emerging field of fourdimensional scanning transmission electron microscopy (4D-STEM). In 4D-STEM, the electron beam is rastered across a sample and a diffraction pattern is collected at each scan position, yielding highly information-rich datasets which can be used to virtually recreate images that map sample orientation, local lattice parameters, strain, and short/medium range ordering, or to reconstruct the
more » ... tic potential itself [1]. These datasets can easily reach tens or even hundreds of GB in size, and almost always require significant computational processing to extract useful results. The aim of py4DSTEM is to make 4D-STEM data analysis easy and accessible for everyone [2]. A sample workflow generating a strain map of an FePO4 microplatelet is shown in Figs. 1-3. Figure 1a shows a virtual bright-field image generated from a 4D-STEM data hypercube. The three scan positions indicated by a blue, green, and red dot correspond to the three diffraction patterns shown in Fig. 1b . In the workflow demonstrated here, a template of the vacuum probe is generated (Fig. 1a , inset) and then cross correlated with the diffraction patterns to identify all the Bragg peaks in each diffraction pattern (Fig. 1c) . The Bragg peaks are summed over all scan positions to generate the plots shown in Fig. 2a,b, showing the location of Bragg reflections in diffraction space; we refer to these plots as average deconvolutions. We find images of the real space microplatelet structure at each reciprocal lattice reflection (Fig. 2a ) of the average deconvolution; these are caused by the translation of each diffraction pattern with the rastering of the beam. Fitting and correcting the diffraction shifts causes each Bragg reflection to collapse into a sharp peak (Fig. 2b) . After removing the bright central beam (Fig. 2c) and taking a Radon transform, each reciprocal lattice peak becomes one of the eponymous sinusoidal curves of a sinogram (Fig. 2d) . The angles where these curves converge immediately identifies the high symmetry zone axes (red arrows and dashed lines); a simple scoring function yields these lattice directions (Fig. 2e) . The lattice vectors can then be extracted, and the Bragg peaks indexed (Fig. 2f ). Using these indices and (average) lattice vectors as initial guesses, the lattice vectors corresponding to the detected Bragg peaks at each individual diffraction pattern can be extracted (Fig. 3a) . Finally, the changes in the lattice vectors from one scan position to the next are used to calculate the infinitesimal strain matrix, "# (Fig. 3b) . The py4DSTEM package includes functions for scripting, Jupyter notebooks with clearly worked examples including all of the processing described above, and a GUI for quick data visualization and interaction. py4DSTEM defines set structured data object types for 4D-STEM data processing, and establishes a set of HDF5-based file format conventions to facilitate open and reproducible processing of 124
doi:10.1017/s1431927619001351 fatcat:7e2tdlakqzavnc547hforszgea