Raw Data and Evaluation Scripts: Minimizing Beam-Induced Damage in Helium Ion Beam Nanopatterning of Suspended Hexagonal Boron Nitride
收藏资源简介:
Extraction and Evaluation of Diffraction Data The damage-profiling line scans are processed in two consecutive Jupyter notebooks. The data extraction.ipynb extracts three position-resolved intensity profiles from raw 4D-STEM data as described in the main manuscript, and data evaluation.ipynb evaluates these profiles for all samples to obtain the cut width and the extent of the amorphous zone. Both notebooks load all available samples automatically and display all intermediate steps for the selected active sample. Apart from the notebooks, the zip-file contains all used raw data in folder "damage_profiling_raw_data", all used images in the target output folder "damage_profiling_images_and_output", the BCA modeling results required for the publication plots in "BCA_modeling_results" and a Matlab code with GUI to manually extract diffraction spots. Data Extraction For the selected sample the "extraction.ipynb" script proceeds in the following steps: Load the raw 4D-STEM diffraction data of the line scan (.npy container)together with its metadata (.json) from damage profiling raw data. Reduce to 3D: the singleton scan dimension is removed, leaving an array of(scan position, kx, ky ); here 512 positions on a 250 × 250 px detector. Align every diffraction pattern to the zero-order beam: its centre is located bya Laplacian-of-Gaussian (LoG) blob detection and each frame is shifted onto acommon reference centre. HAADF profile: integrate the intensity inside a high-angle ring aperture (r =80–120 px) at every probe position. Entire-diffraction profile: integrate a ring aperture (r = 8–100 px) thatexcludes the zero-order diffraction spot. Bragg-spot profiles: detect the diffraction spots (LoG, deliberately over-detecting), remove the zero-order spot, add missing symmetry partners, resolveoverlaps and refine the positions. The intensity of each spot is then integrated andsummed. Falsely detected spots can be removed interactively by right-clickingthem. Save the profiles as commented CSV files and the aligned stack as .npy todamage profiling extracted data Python, from where the evaluation scriptreads them. How to run: Open the notebook in Jupyter with the interactive backend (%matplotlib widget, package ipympl) and run the cells top to bottom. The configuration cell lists all detected samples; the active sample is chosen via its index in SAMPLES, and the extraction parameters (ring radii, blob threshold BLOB THRESHOLD, intensity percentile DIFFRACTION THRESHOLD PERCENTILE) are set there. Ring radii can additionally be tuned with sliders. Every change is saved automatically. Notes: The extraction must be checked visually for each sample, and within one STEM session the same parameter set should be used for all samples. Bragg spots can only be removed, never added by hand, which prevents the introduction of non-existent reflections. Processing is intended for a single sample at a time; an automatediteration is not recommended. Data Evaluation The "data_evaluation.ipynb" script evaluates the extracted profiles of all samples in the following steps. Load the three CSV profiles (HAADF, entire diffraction, diffraction spots) ofeach sample from damage profiling extracted data Python. Detect the cuts: the dip positions in the profiles are found with a prominencethreshold and confirmed by a local depth-below-median sanity check. Baseline correction: for each cut a local quadratic baseline is fitted to thesegment edges and used for normalization. Cut width: determined as the FWHM of a Savitzky–Golay smoothed cut. Anerror-function smooth-box model and a Holtsmark-type test model are addition-ally fitted to illustrate the broadening mechanisms, but are not used for theFWHM itself. Degree of amorphization: the Bragg-spot intensity is scaled to the entire-diffraction signal and subtracted, yielding a difference profile that reflects thedegree of amorphization as a function of probe position. Amorphous-zone extent: a double-Gaussian fit of the difference profile (with anormalised-RMSE sanity check) gives the peak separation; the amorphous extentis obtained as (peak separation − cut width)/2. Publication output: after looping over all samples, the figures for the selectedsamples are generated and saved to damage profiling images and output. How to run: Open the notebook with the inline backend (%matplotlib inline) and run the cells top to bottom. Besides NumPy, SciPy, pandas and Matplotlib, the package lmfit is required. The active sample is selected via ACTIVE SAMPLE INDEX. Samples whose folder name ends in inverted (180◦ rotated line scan) are detected and handled automatically. Peak-detection and fit parameters are collected in the configuration cell, and the mapping of the four cuts to the beam scan velocities is set via BEAM VEL. Notes: Although plausibility checks and fallback solutions are implemented for insufficient data or poor fit quality, a visual cross-check is strongly recommended for every evaluated sample. Fits exceeding the normalised-RMSE threshold(GAUSS NRMSE THRESH) are flagged as failed. The publication plots request the Arial font through the Matplotlib configuration. If it is unavailable, Matplotlib falls back to a default font with a warning. Some plots additionally require the BCA modeling files (e.g. thickness *.txt) to be present.



