A script‐based method for achieving distortion‐free selected area electron diffraction

Abstract Electron diffraction patterns obtained on a TEM contain elliptical distortion resulting from column defects. This distortion can be corrected by applying offsets to the objective lens stigmators to cancel distortions occurring further down the column. In this work, a DigitalMicrographTM script‐based method has been developed to identify the optimum objective stigmator settings which produce a distortion minimum in diffraction. Initially, a manual (by eye) correction is used to determine the stigmator values necessary to bring the pattern distortion below the threshold at which it is no longer visible to the naked eye (<1%). Thereafter, an automated acquisition script is used to acquire matrices of diffraction patterns while varying the stigmator values about the values which were identified as producing a distortion minimum in the preceding step. This analysis can be applied iteratively to refine the location of the distortion minimum, using progressively finer step changes in objective stigmator values. The optimum stigmator values producing the distortion minimum in diffraction are very different to those in imaging. These imaging and diffraction stigmator values can be saved to script and subsequently recalled at the click of a button, making their application very simple. Using this method, diffraction pattern elliptical distortion in a newly installed TEM was reduced from 1.6% to 0.3%, on a measurement precision of 0.3%, effectively producing distortion‐free diffraction. The relevant scripts can be freely downloaded from the internet. Research Highlights This paper reports a DigitalMicrograph script‐based method to identify and subsequently apply optimized objective stigmator values in diffraction mode. These effectively eliminate elliptical distortion inherent to this diffraction technique.


| INTRODUCTION
In terms of precision and accuracy, electron diffraction in a transmission electron microscope (TEM) is a poor relation of neutron and x-ray methods. Where the technique does excel is in its spatial resolution, permitting diffraction information from individual grains or defects to be obtained. The lack of a fixed diffracting geometry within the microscope, means that pattern centers are not fixed and software methods for locating centers and measuring diffraction spot/ring spacings and angles are required (Mitchell, 2008a;Mitchell, 2008b;Mitchell & Van den Berg, 2016). Even with software intervention, it can be difficult to measure d-spacings with better than 1% precision due to the presence of geometrical distortion within the pattern. Such distortions can arise from lens defects in the microscope column (Capitani et al., 2006;Hou & Li, 2008;Mugnaioli et al., 2009), as well as magnetization retained in the viewing chamber casting (private communication). Off-axis camera systems may also introduce distortion. As such, the magnitude and direction of distortion can vary significantly, even between identical models of microscope. This distortion is generally accepted by microscope vendors and techniques or procedures for correcting it at source are typically not available to installation engineers or sophisticated users. Typical microscope installation specifications call for measured distortions to be ≤2%, and provided the values fall below this threshold, the system is deemed to be performing satisfactorily.
This makes it somewhat of a lottery as to whether an installed system will be suitable for distortion-free diffraction. A distortion in the range 1%-2% results in diffraction rings where the ellipticity is evident to the naked eye. Only once it falls below 1% can it become difficult to observe without using accurate measurement techniques such as graphical methods (Capitani et al., 2006;Hou & Li, 2008;Mugnaioli et al., 2009)  The elliptical distortion in a pattern can be nulled by compressing the pattern along the major axis and expanding it along the minor axis, and such a tool is included with the EFA script for postacquisition correction. Removing the geometric distortion originating from the microscope, then permits any lattice distortion due to crystal effects to be determined (Xiong et al., 2018). Graphical methods have also been used to carry out post-acquisition measurement and correction of distortions enabling accurate lattice parameter determination in minerals (Capitani et al., 2006;Mugnaioli et al., 2009).
While such corrections enhance the precision with which crystallographic analysis can be performed, collection of distorted data followed by correction is less than ideal. A far better option would be to eliminate the distortion at the microscope. Hou and Li (2008)  (2 k Â 2 k) were acquired on a Rio16 camera (Gatan Inc.), integrating for 8 s. Pattern distortion was measured using the EFA analysis script.
The microscope in this work was not fitted with an energy filter.
Energy filters, either in-column or post-column, will introduce their own distortion. Only post-column filters actively correct for this.
Although not tested on energy filtered microscopes, the scripting approach reported here should work on such systems, provided the filter is operated under fixed conditions during calibration and use.
However, unless energy filtering is specifically required, such microscopes are best avoided in preference for those offering direct capture to camera.    In order to apply the optimum objective stigmator values for imaging and diffraction modes, the SADP Distortion Corrector script was used (Figure 1a). In imaging mode, amorphous carbon was used to correct image distortion by manually adjusting the objective stigmators to produce an astigmatism-free image in the usual manner.

| RESULTS AND DISCUSSION
These stigmator values were then saved to the script by clicking on the Imaging Mode: Save Microscope Stigs button in the script. In practice, given the acute sensitivity of image astigmatism to the objective stigmator settings, the values saved for imaging would likely be updated at each diffraction session. The microscope was then  (Table 1)  The distortion of a diffraction pattern in diffraction mode is relatively insensitive to the objective stigmator values (compared to image distortion in imaging mode) and the optimum objective stigmator values for distortion-free diffraction are likely to be quite stable and to not require recalibration, provided no major realignments or column maintenance are carried out. In order to obtain reliable and consistent electron diffraction data, it is essential to standardize the diffraction conditions used (Mitchell, 2008a). Lens degaussing (twice) upon switching from imaging to diffraction modes is strongly advised, to ensure consistent camera length calibration and distortion correction. The scripts reported in this work enable accurate determination and application of the optimum objective stigmator values required to produce distortion-free diffraction patterns in a facile manner. This technique has been used to demonstrate a better than five-fold reduction in distortion, effectively eliminating distortion in electron diffraction.
F I G U R E 3 Application of the SADP Distortion Corrector script: (a) with the objective stigmators optimized for imaging a distorted diffraction pattern is obtained (yellow points/cyan line is the ellipse fitted to the diffraction ring and the red line is the equivalent circle of radius equal to the major axis of the ellipse); (b) after applying the saved optimum objective stigmator values for diffraction a distortionfree pattern is obtained and the best-fit ellipse and equivalent circle are in much closer registry; (c) switching from diffraction to imaging mode with optimum objective stigmator values for diffraction in place results in a highly astigmatic image; (d) recall of the saved optimum objective stigmator settings from for imaging results in a astigmatismfree image 4 | CONCLUSIONS Diffraction patterns acquired on a TEM contain distortions arising from column defects. A script-based method of measuring distortion and correcting it using the objective lens stigmators has been developed and applied. A second script has been developed which allows the optimum objective lens stigmator values to be effortlessly applied in their respective imaging and diffraction modes by a click of a button. Using this method, pattern distortion has been reduced five-fold from 1.6% to 0.3%. Since the precision in measurement is of the same order, this method effectively results in distortion-free electron diffraction.

ACKNOWLEDGMENTS
This work was carried out at the Electron Microscopy Centre of the University of Wollongong, using equipment funded by the University.

CONFLICT OF INTEREST
The author declares no potential conflict of interest.

DATA AVAILABILITY STATEMENT
Scripts used in this script are available for free download from the author's website (www.dmscripting.com). Data used in this publication are available from the author by request.