Structural and chemical properties of superconducting Co-doped BaFe2As2 thin films grown on CaF2

Thin films of Co-doped BaFe2As2 of similar thickness (~40 nm) were grown with different growth rates (0.4 Å s−1 and 0.9 Å s−1) by pulsed laser deposition on CaF2(001) substrates. Analytical transmission electron microscopy (TEM) was applied to analyze the microstructure and secondary phases. The formation of BaF2 and a high concentration of planar defects (mainly stacking faults) are observed for the sample grown at a low rate. A higher growth rate results in high-quality epitaxial films with only few antiphase boundaries. A higher T c was measured for the sample grown at a low growth rate, which is attributed to the difference in strain state induced by the high concentration of defects. Large crystalline Fe precipitates are observed in both samples. Chemical analysis shows a pronounced O and slight F content at the planar defects which highlights the role of O in defect formation. Electron-beam-induced irradiation damage during TEM measurements is observed and discussed.


Introduction
Iron-based superconductors (IBSs) have received much interest in the scientific community since their discovery in 2006 [1,2]. Besides leading to new insights into the fundamental mechanisms of superconductivity, these materials are also promising for technical applications [3,4]. For example, the combination of high critical magnetic fields (H c2 ) and low magnetic-field anisotropy (γ) make IBS interesting for low-T high-field magnets. Iron-based superconducting epitaxial thin Original content from this work may be used under the terms of the Creative Commons Attribution 4.0 licence. Any further distribution of this work must maintain attribution to the author(s) and the title of the work, journal citation and DOI.
films are an ideal model platform for fundamental and applied research to study the superconducting properties and the influence of different fabrication parameters on the microstructure [5]. Furthermore, thin films occasionally exhibit higher critical temperatures T c compared to their bulk counterparts [6]. Co-doped BaFe 2 As 2 (Ba122) is an extensively studied IBS due to its chemical stability and easier thin-film fabrication compared to, e.g. K-doped Ba122. CaF 2 recently gained much interest as a substrate for Ba122 due to generally higher T c of the superconducting thin films compared with other substrates [5]. This observation is usually explained by the large mismatch of thermal expansion coefficients between CaF 2 and Ba122 leading to biaxial strain upon cooling, which then enhances T c . Indeed, the effects of strain on the superconducting properties can be investigated in thin-film systems by using different substrates with varying lattice mismatch with respect to Ba122 [7,8]. Despite this scientific progress, the mechanisms of Ba122 growth on CaF 2 via pulsed laser deposition (PLD) are still not fully understood due to the influence of various fabrication parameters and possible interactions with the (heated) substrate [9][10][11]. For example, different types of planar defects can form in Ba122 thin films and bulk samples [12][13][14][15][16][17]. Furthermore, F diffusion into IBS is possible when grown on CaF 2 [18][19][20]. Regarding the influence of fabrication parameters, considerable differences in thinfilm quality and superconducting properties are observed in Ba122 films when varying the deposition rate [21,22]. For the Ba122 films investigated in this work, the formation of Ferich precipitates and BaF 2 was observed by x-ray diffraction measurements [22]. BaF 2 formation could be fully suppressed at higher deposition rates, which, however, was accompanied by a reduction of T c . The formation of BaF 2 clearly indicates a reaction of Ba122 with CaF 2 during PLD, the degree of which depends on deposition rate and substrate temperature.
To gain more insight into these aspects, we investigated the microstructural and chemical properties of two Ba122 thin films on CaF 2 deposited with different rates by analytical and high-resolution scanning transmission electron microscopy (STEM) in combination with energy-dispersive x-ray spectroscopy (EDXS) and electron energy loss spectroscopy (EELS). The aforementioned different types of defects and secondary phases are analyzed in detail. We also show that irradiation damage by the electron beam has to be considered for the interpretation of experimental results in the Ba122-CaF 2 system.
To protect the film during TEM sample preparation, protective layers of evaporated C (and sputtered Pt for sample/slow) were deposited on the sample surface with a Leica ACE600 coater. Cross-section samples were prepared by focused Ga + -ion-beam (FIB) milling using the in-situ liftout technique [23] in an FEI Strata 400S dual-beam system. These samples were cut out of the film so that the Ba122 [100] zone axis can be oriented parallel to the electron-beam direction in the TEM. Ga + -ion energies ranging from 30 keV to 2 keV were used for lift-out and thinning to electron transparency. The use of lower ion energies reduces the thickness of undesired amorphous surface layers on the sample during the final preparation step. After this preparation, the cross-section samples were transferred to the TEM as fast as possible to minimize oxidation and contamination in ambient air.

Electron microscopy
An FEI Titan 3 80-300 operated at 300 kV with an aberration corrector implemented in the imaging-lens system was used for STEM and high-resolution (HR)TEM imaging as well as STEM-EELS spectrum image acquisition. In a spectrum image, an EELS/EDXS spectrum is collected at each scan position in a raster image. Atomic number (Z)-contrast images were obtained by high-angle annular dark-field (HAADF) STEM where the local image intensity is correlated with the (average) atomic number of the material for a TEM sample with reasonably constant thickness. This will be exploited for the interpretation of atomic-resolution HAADF-STEM images, where atomic Ba columns appear with high intensity compared to columns occupied by atoms with lower atomic number. Likewise, regions with a high concentration of O and F show a low image intensity. HAADF-STEM imaging was performed with a camera length setting of 185 mm in combination with a Fischione Model 3000 ADF detector. The probe convergence semi-angle for STEM imaging and STEM-EELS acquisition was about 8.5 mrad (50 µm condenser-2 aperture). EELS spectra in STEM mode were acquired with a post-column Tridiem 865 ER Gatan Imaging Filter (GIF) on a Gatan Ultrascan 1000 CCD camera. A nominal camera length of 29.5 mm was used in combination with an ADF detector (Gatan DF), which acts as the GIF entrance aperture. This setup resulted in a collection semi-angle of roughly 19 mrad.
The Gatan DF signal was used for sample-drift correction. The microscope descan option was used to keep the beam stationary in the GIF entrance aperture (diffraction) plane during STEM-EELS acquisition. The synchronization of electronbeam position and GIF acquisition was controlled by the 'Tecnai User Interface' microscope software.
An FEI Tecnai Osiris operated at 200 kV was used for HAADF-STEM imaging and STEM-EDXS spectrum image acquisition. The microscope is equipped with ChemiSTEM technology for EDXS [24], which combines a high-brightness field-emission electron source with four silicon-drift detectors placed around the sample for high x-ray collection efficiency. The signal of the HAADF detector segment (at 115 mm camera length) was used for drift correction during spectrum acquisition with the Bruker Esprit 1.9 software. The convergence semi-angle for EDXS spectrum image acquisition and high-resolution HAADF-STEM imaging was roughly 10.5 mrad (70 µm beam-limiting condenser-2 aperture).

Data evaluation
Different software tools were used for data processing, most of which are currently freely available. Multivariate statistical analysis was applied to increase the signal-to-noise level in qualitative EDXS/EELS mappings through dimensionality reduction of spectrum images via principal component analysis (PCA) [25]. EDXS spectrum images were evaluated with the python-based HyperSpy package [26]. In particular, the overlap of the F K α (677 eV) and Fe L α (705 eV) x-ray lines was resolved by multiple linear least-squares fitting of the amplitudes of Gaussian functions with fixed positions (at the expected x-ray line energy) and widths (calculated from the spectral resolution of the EDXS detector). A Jupyter notebook showing the applied data treatment for EDXS analysis is available [27]. Elemental concentrations were derived by standardless quantification based on theoretically calculated Cliff-Lorimer factors in Bruker Esprit 2.1. EELS spectrum images were PCA-filtered with the basic version of the 'temDM MSA' plugin (version 1.96) [25] for Digital Micrograph. The coreloss signals were extracted by a combined model fit consisting of a power-law background model and Hartree-Slater scattering cross-section models for each core-loss edge in a spectrum image (using the commercial EELS package by Gatan). This procedure is used to separate the overlapping Ba-M 4,5 edges (energy losses of 796/781 eV) and Co-L 2,3 edges (energy losses of 794/779 eV).
Noise in high-resolution images was reduced by the 'HRTEM Filter' plugin [28] for Digital Micrograph using a combination of a Butterworth filter (BW) and an average background subtraction filter based on the work of Kilaas [29]. The (standard) settings of Step 2, Delta % 5, Cycles 50, and BW n 4 were used. The BW ro setting was adjusted for each image roughly to the ratio between the highest resolved crystalline spatial frequency and Nyquist frequency. To highlight atomic details in some of the images, low-frequency intensity modulations were removed by subtracting a background model obtained by anisotropic diffusion prior to noise filtering (see appendix figure A1). For distance measurements in high-resolution STEM images, the locations of atomic columns were evaluated by two-dimensional Gaussian peak fitting using the Atomap python package [30], which is shown in a Jupyter notebook [27]. JEMS [31] was used for simulating diffraction patterns with crystallographic (.cif) files obtained from the inorganic crystal structure database (ICSD) [32].

Irradiation-induced artifacts in the Ba122-CaF 2 system
During our investigations, we noticed that the Ba122-CaF 2 system is susceptible to electron-/ion-beam-induced irradiation damage. An overview of potential sources of sample damage is presented in figure 2. We note that the images in figure 2(a) were taken from another sample with larger Ba122 layer thickness, which was deposited in a similar way as sample/slow and sample/fast analyzed in this work. During FIB sample preparation for TEM, preferentially regions near the Ba122-CaF 2 interface are damaged (figure 2(a)), even though a relatively low Ga + -ion energy of 2 keV was used for final thinning. The ADF-STEM image of a thinner region of the sample (left image in figure 2(a)) shows a partially destroyed Ba122 layer near the interface (marked by red dotted lines). The thinner TEM sample region also has a thinner protective Pt layer due to extended FIB milling. The damaged layer is absent in a slightly thicker TEM sample region from the same sample (right ADF-STEM image in figure 2(a)), which was milled simultaneously under the same conditions. From this observation we can conclude that special care must be taken during the FIB preparation of TEM samples with a thickness of less than approximately 50 nm. Preferential milling at the film/substrate interface could be caused by strain, abrupt composition changes and/or chemical reactions. A gentler thinning in an Ar-ion polishing system or lower Ga + -ion energies (below 2 keV, as used in modern dual-beam instruments) may be necessary to produce artifact-free TEM samples in this thickness regime. Still, TEM samples between about 50 nm and 100 nm could be prepared routinely by FIB milling without these artifacts.
Besides preparation damage, the rapid formation of an amorphous Ba122 reaction layer at the Ba122-CaF 2 interface under electron-beam irradiation was observed. As an example, a HRTEM image is shown in figure 2(b), which was taken with an acceleration voltage of 300 kV under a relatively high electron dose commonly used for HRTEM investigations in materials science. Initially, this reaction layer forms rapidly under irradiation and exhibits a constant thickness with minimal changes during further irradiation. The final thickness of the damaged layer can vary. Two videos serve as examples for the initial generation of such a reaction layer and also the formation of a constant layer thickness under prolonged irradiation [27]. This effect indicates that the amorphization of Ba122 is driven by a chemical reaction at the interface. Presumably, residual O 2 and H 2 O molecules on the sample and in the microscope vacuum react with CaF 2 (and BaF 2 ) under electron-beam irradiation [33,34]. The damage mechanism of Ba122 could be etching with side-products of the reaction, i.e. HF, charging effects, and/or mechanical stress due to the formation of HF/F gas bubbles in CaF 2 . These gas bubbles form a superlattice in the CaF 2 region with a periodicity of 10-30 nm [33,35]. The thickness at which the reaction layer becomes (relatively) stable may, therefore, depend mostly on the cleanliness of the sample and microscope vacuum. As a practical aspect, this reaction layer is easily created by the operator, e.g. during the screening of the TEM lamella at low magnification or during alignment of the microscope on the sample. We also observed that a combination of high electron doses during STEM imaging can induce planar defects with dark contrast. The same effect was observed by Thersleff et al [36] for oxide substrates and may therefore be intrinsic to Ba122. This process is visible during continuous image acquisition of the same sample area (appendix figure A2). Since this effect appeared in varying severity in different TEM samples, it may depend on TEM sample thickness and microscope vacuum/sample cleanliness. These observations show that the electron dose on the sample during microscope alignment and for artifact-free high-resolution imaging must be kept to a minimum. Figure 2(c) shows the possibility of in-situ oxidation of CaF 2 and BaF 2 [33,34] during dose-intensive EDXS and EELS measurements. Even though the secondary phase BaF 2 was identified by Fourier-transform (FT) analysis (figure 2(c), BaF 2 structure ICSD code 64717) and x-ray diffraction measurements [22], elemental maps obtained by STEM-EDXS or STEM-EELS often show an O signal instead of F as depicted in figure 2(c). A rapid oxidation process during spectrum collection explains the O content in the BaF 2 region. In addition, volatile F is removed during STEM-EDXS acquisition [33,37], resulting in the absence of the F signal. The O may stem from the microscope vacuum and the sample itself, i.e. oxidation of BaF 2 and Ba122 during sample transport or storage. The latter effect may be especially relevant if BaF 2 at the TEM cross-section sample surface is exposed to ambient air. In addition, O contamination of the PLD target could be another source of O in BaF 2 and Ba122. The CaF 2 substrate also shows a pronounced O signal after spectrum collection due to oxidation. Furthermore, Ba122 also reacts with O. Therefore, sample exposure to ambient air should be minimized and thin TEM samples may degrade (oxidize) rapidly if not stored under inert gas atmosphere. To minimize this problem, TEM measurements in this work were only conducted on freshly prepared FIB lamellas. Electron-beam-induced measurement artifacts during STEM-EDXS were also reported by Haindl et al [20] for SmO 1−x F x FeAs films on CaF 2 . These observations show that spectroscopic measurements in the Ba122-CaF 2 system must be interpreted carefully, especially concerning O and F. Figure 3 shows overview HAADF-STEM cross-section images of the two Ba122 thin films with different growth rates. In general, both samples show a homogeneous Ba122 film thickness of about 40 nm (sample/fast) and 37 nm (sample/slow). Defects and precipitates are visible Regions of both samples with low defect densities were analyzed by STEM-EDXS with elemental maps of Ba, Fe, Co, As, O, F, and Ca shown in figures 4(a) and (b) to compare their compositions. A planar defect was in the field of view for sample/slow and is marked by an arrow. Below the Pt/C protection layer, both samples show an O-rich surface layer of around 5 nm thickness with an amorphous structure. The O content reduces the intensity in the HAADF-STEM images compared to the crystalline Ba122 in HAADF images (figures 3(a) and (b)). The oxidized surface was also observed by surface-sensitive measurements [38] and forms during storage in ambient air [39]. As the substrate was heated to 700 • C during film deposition, a possible reaction of the substrate with the film is of interest. From the elemental maps in figures 4(a) and (b), Ba, Fe, Co, and As are only detected in the film and Ca and F in the substrate, indicating the absence of interdiffusion. A faint O signal at the Ba122-CaF 2 interface is visible only for sample/slow (figure 4(b)) and may result from the presence of BaF 2 , which oxidizes during TEM analysis. This aspect will be further outlined below.

Structural and chemical properties of Ba122 layers
Both samples show the same chemical composition obtained from standardless quantification in defect-free regions, i.e. without precipitates, secondary phases, and the Orich surface layer (table 1). With the given errors, the actual Co content would be slightly too high and the As content slightly too low compared to the nominal composition. However, these error values are calculated by the Esprit software and may underestimate the actual error in the standardless quantification procedure [40]. Therefore, the deviations from the nominal Ba122 composition may also result from other error sources inherent to standardless quantification. The O signal was excluded from the quantification (among other spurious signals) in table 1 because oxidation of the TEM sample during transfer from the FIB-SEM system to the TEM will modify the O concentration that is measured in the Ba122 films.
Even though the used EDXS detector is capable of detecting light elements (here O and F) with its windowless design, low energy x-rays (<1 keV) are still prone to absorption inside the specimen itself or in possible contamination layers (ice and hydrocarbons) on the detector [41]. Therefore, EELS spectrum images were collected for larger sample regions exploiting the good sensitivity of this technique for light-element detection. The extracted qualitative elemental maps for both samples are shown in figures 5(a) and (b).
Larger precipitates in the film show a pronounced Fe/Co signal (figures 5(a) and A5(a)). Such Fe/Co precipitates were observed in both samples (figures 3(a) and (b)) and are denoted as 'Fe precipitates' in the following for brevity. The presence of crystalline Fe precipitates in both samples is also confirmed by nanobeam electron diffraction patterns, which show Fe along the [110] zone-axis orientation (see appendix figure  A3). The small in-plane lattice mismatch of 2.2% between the Fe(110) (0.203 nm) and Ba122(020) (0.198 nm) planes enables coherent growth of this Fe orientation inside the Ba122 matrix. The same crystallographic relationship is observed when using an Fe buffer layer between the substrate and Ba122 [42,43]. In growth direction, a lattice mismatch of 1.2% exists between nine Fe(002) planes corresponding to 1.287 nm (lattice-plane distance of Fe(002): 0.143 nm) and one Ba122(001) plane with 1.302 nm spacing. In the film, inclined boundaries of the Fe precipitates inside the Ba122 matrix are observed (figures 5(a), A3(a) and A5(a)). These precipitates are too large to act as efficient vortex pinning defects because such defects should be of similar size as the coherence length (a few nanometers for IBS [44]). Fe precipitates do not seem to nucleate directly at the CaF 2 substrate but often on top of BaF 2 precipitates for sample/slow (see figures 3(b) and 6(a)). In sample/fast, only Ba122 and Fe precipitates are observed, while As-or Ba-rich secondary phases are absent. The removal of volatile As and Ba during deposition from stoichiometric sintered Ba122 targets might be the reason for the formation of Fe precipitates. A reduction of Fe (and Co) content in the PLD target could therefore reduce the formation of these precipitates. A~3 times higher coverage of Fe precipitates at the film surface was observed for sample/fast (22%, number density of precipitates 42 µm −2 ) compared to sample/slow (7%, number density of precipitates 15 µm −2 ) as measured by scanning electron microscopy (SEM) imaging (figure A4). A similar average Fe precipitate diameter of 75-80 nm was found for both samples, but this value must be interpreted carefully due to possible systematic errors introduced during SEM imaging and image segmentation. Even though SEM imaging only shows the surface structure of the Fe  )). Another visible difference is a faint O signal at the Ba122-CaF 2 interface for sample/slow in (b), which is absent for sample/fast. This is also observed in EELS measurements shown in figure 5(b). No F diffusion into the Ba122 layer is visible in the EDXS measurement, whereas a faint F content was measured by EELS for sample/slow (figures 5(b) and (c)). precipitates, a large number of Fe precipitates can be analyzed compared to only few Fe precipitates in a TEM sample. In addition, the size of the Fe precipitates corresponds roughly to the TEM cross-section sample thickness. This results in erroneous size measurements by TEM as the precipitates are randomly intersected during FIB lamella preparation (see scheme in figure A5(b)). An additional EDXS map of Fe precipitates is included in the appendix (figure A5). A pronounced O signal at the substrate interface is visible for sample/slow (figure 5(b)) in accordance with the O map in figure 4(b). Region (3) (marked in the ADF-STEM image) shows an O-rich region, which clearly extends into the CaF 2 substrate. In contrast to figure 4, the EELS F map shows a faint signal in the Ba122 layer, e.g. in regions (1) and (2). To further investigate the presence of F in Ba122 and the Orich region (3) in the substrate, EELS spectra from the marked regions (1)-(4) in figure 5(b) are displayed in figure 5(c). The edge onset near the F K edge (dashed arrow) in spectra (1) and (2) verifies the presence of F in the Ba122 film. Comparing the two spectra of regions (1) and (2), a high O and enhanced Ba content are visible for region (2) close to the substrate interface. The combination of Ba and O is also visible in region (3) in the substrate, which indicates the formation of a secondary phase containing Ba and O. For a comparison with region (3), EELS spectra were also extracted from a reference region (4). The latter lies in the substrate region and has the same distance to the Ba122 layer as region (3) (3) can grow as small columnar defects as shown in the ADF image in figure 5(b) but also to large regions visible in figure 3(c) and is only observed for sample/slow. We suspect that this phase is oxidized BaF 2 as further discussed in the following.
High-resolution HAADF-STEM images from this Ba-/Orich phase in sample/slow are presented in figure 6 together with FT analyses of the local crystalline structure below the images. Figure 6(a) shows a commonly observed case, where the growth of this secondary phase starts within the CaF 2 substrate and an Fe precipitate forms on top. A similar situation is visible in figure 3(b). The images shown in figures 6(b) and (c) were taken from two different regions containing larger secondary phases similar to that shown in figure 3(c). In all cases, the best match of the FT patterns in figures 6(a)-(c) with simulated diffraction patterns (not shown here) is obtained for BaF 2 . This phase is also supported by x-ray diffraction measurements on these samples [22]. From spectroscopic measurements, however, O instead of F is present in these regions (see O map in figure 5(b)). Simulations of diffraction patterns of possible O-containing phases like BaO (cubic, ICSD code 58663) and BaO 2 (tetragonal, ICSD code 24729) show deviations compared to the experimental FT patterns. BaO with its cubic structure shows the same symmetry in the diffraction patterns as BaF 2 but has a 10.6% smaller lattice parameter. As the accuracy of the measured lattice-plane distances depend on the magnification calibration of the microscope, we used the CaF 2 substrate as a reference. As outlined in section 3.1, we assume that an irradiation-induced oxidation of BaF 2 by residual O 2 and H 2 O molecules in the TEM is the cause for the exchange of F by O. Therefore, the pronounced O signal detected by EELS for sample/slow ( figure 5(b)) could stem from BaF 2 originally formed at the interface during film deposition, which is oxidized during TEM sample preparation, sample transfer through air, and TEM measurement.
To further investigate the CaF 2 -Ba122 interface, figures 7(a) and (b) show the crystalline structure of the layer near the substrate interface for both growth rates. For sample/fast (figures 7(a), (d), and (e)) epitaxial growth is observed in this field of view with undisturbed growth of Ba122 on CaF 2 and confirmed by the FT of the interface region (figure 7(e)). The Ba122(001) planes grow parallel to CaF 2 (001), and the in-plane lattice parameters of Ba122(020) and CaF 2 (220) only have a small lattice-parameter mismatch. The Ba122 growth starts with the Ba layer (figure 7(d)), which was also observed by Lee [45]. No reaction layer between CaF 2 and Ba122 is visible. The absence of a reaction layer with a thickness of a few nanometers is in contrast to earlier studies [8,10,13,46]. As shown in figure 2(b), an irradiationinduced reaction layer forms during exposure with the electron beam, which is not present in the deposited thin film if irradiation damage is avoided. Therefore, we suspect that previously detected reaction layers could have been caused by electron-beam irradiation.
For sample/slow, BaF 2 precipitates and ab-plane-oriented planar defects are visible in HAADF-STEM images (see also figures 3(b) and (c)) and are also observable in the highresolution STEM image in figure 7(b) (horizontal regions with dark contrast). These defects were also observed by other groups in films [12][13][14], polycrystalline bulk samples [15], and single crystals [16,17]. A BaF 2 precipitate is visible (indicated by an arrow in figure 7(b) and verified by FT analysis not shown here), which has formed at the substrate interface. The slowly grown Ba122 thin film is clearly more disrupted by defects and secondary phases. As for sample/fast, the Ba122 growth in sample/slow seems to start directly at the substrate as observed in figure 7(f) with the expected zig-zag stacking of the bright Ba atomic columns in the first atomic layers (see also inserted structure model in figure 7(f) and Ba122 structure in figure 1). Epitaxial growth is again confirmed by FT analysis at the interface (figure 7(g)). Therefore, a full coverage of the CaF 2 substrate with a BaF 2 reaction layer can be ruled out. Still, partial coverage of the interface with BaF 2 and subsequent oxidation during TEM analysis could explain the pronounced O signal at the interface (figures 4(a) and 5(b)). Another possible explanation is oxidation of the CaF 2 surface by residual gas during PLD.
Another type of defect is depicted in figure 7(c). The highresolution HAADF-STEM image shows the upper part of the crystalline Ba122 layer of sample/fast covered by the amorphous, oxidized surface layer. Two domains of Ba122 are separated by an antiphase boundary (APB, marked by the red arrow), for which a shift of the crystal structure parallel to the c-axis (growth direction) is observed. The inset shows the APB at higher magnification with the Ba planes marked by horizontal lines. The shift between the two Ba122 lattices is measured to be (0.272 ± 0.025) nm, where the error corresponds to the standard deviation without considering systematic errors due to erroneous length calibration and scan distortions. This distance agrees well with the spacing of the Ca planes in the substrate of 0.274 nm ( figure 1). Hence, the APB may have originated from an atomic step in the CaF 2 .   The strain introduced by these different defects may be the reason for the differences in T c between the two Ba122 films ( figure 8). Indeed, a higher T c was measured for sample/slow (T c,50 = 25 K, i.e. 50% of normal state resistance), which contains a higher concentration of planar defects and BaF 2 precipitates than sample/fast (T c,50 = 24 K).
As suspected in context with figure 7(c), surface steps with accompanied APBs can be observed in HAADF-STEM images of the interface region in sample/fast (figures 9(a) and (b)). The arrows in figure 9(a) mark atomic steps at the substrate surface. The image in figure 9(b) is a magnified view of the region within the red frame in figure 9(a). In this example, the APB is annihilated by a stacking fault (marked by the arrow in figure 9(b)) after a few unit cells of Ba122 leading to the merging of two Ba122 domains. As shown in figure 7(c), APBs can also extend through the whole Ba122 layer, thereby acting as extended grain boundaries that may affect the superconducting properties due to a disruption of the superconducting Fe-As planes [20]. Figure 9(d) shows an APB in sample/slow demonstrating that APBs are present in both samples. Nevertheless, APBs are observed with higher concentration and larger extension in sample/fast. The APB in figure 9(d) is observed in the bottom part of the image and then annihilated by a stacking fault at the Ba planes in the left Ba122 domain as indicated by the superimposed structure model. This image also shows that stacking faults generally appear with darker contrast compared to undisturbed Ba122 whereas the APBs do not show a contrast change. Therefore, the latter can be overlooked in HAADF-STEM images. From this observation, we conclude that there are fewer APBs in sample/slow because (a) the presence of a high concentration of planar defects (i.e. stacking faults) can annihilate the APBs, and (b) substrate steps possibly also act as nucleation sites for BaF 2 as a competitive process in sample/slow. Different growth of Ba122 is observed in the first atomic planes (figure 9(c)) in the vicinity of the substrate step shown in figure 9(b) compared to the expected growth shown in figure 7(d). The first unit cell is enlarged to (0.83 ± 0.01) nm in growth direction and the Ba planes are shifted by half of an inplane lattice parameter, similar to a stacking fault (figures 9(d) and 10(a)). A dark region is observed between the bottom Ba plane and the first Fe-As plane, which may stem from an atomic layer of light elements (O or F) due to the low image intensity in this region. We could not clarify the exact atomic structure from our high-resolution HAADF-STEM images, which may require (STEM) imaging modes that also show light elements like annular bright-field or integrated differential phase-contrast imaging [47].
A more detailed analysis of two commonly observed planar defects in sample/slow is presented in figure 10. One type is a stacking fault and characterized by a missing Fe-As plane (figure 10(a), large black arrow). This leads to a strong reduction of the spacing between the adjacent Ba planes to (0.37 ± 0.02) nm while the distances to the adjacent Ba planes above and below increase by around 4.2% (dashed red arrows) relative to the other Ba planes in this field of view. Overall, the measured c/2 values are all larger than the literature value of c/2 = 0.65 nm for bulk Ba122 (ICSD code 169555, dashed red line). This is also observed in x-ray diffraction measurements [22] and indicates an enlargement of the Ba122 unit cell in c-direction due to compressive in-plane strain (Poisson effect, see also [5]) for these thin films. For sample/slow an enlargement of the out-of-plane (c) lattice parameter by 0.8% and a decrease of 2.0% for the in-plane (a/b) lattice parameters was measured from electron diffraction patterns (appendix figure A3). The latter are less prone to errors compared to a strain determination by the shown high-resolution STEM images, which may be affected by scan distortions. Another type of planar defect shown in figure 10(b) consists of a single Ba plane, which suddenly exhibits a lower HAADF-STEM intensity. The distance to the neighboring Ba planes is increased by around 20% (figure 10(c)) in agreement with the results by Zheng et al [16]. In the following, these defects are denoted as 'isolated Ba planes'. Similar to figure 9(c), we could not clarify by HAADF-STEM if another atomic layer of light elements (probably O) surrounds the Ba plane (marked by white arrows in figure 10(c)) thereby causing the reduced image intensity. As noted in section 3.1, these planar defects can also be generated during scanning with the electron beam (appendix figure A2). Similar to the oxidation of BaF 2 and CaF 2 , residual O could play an important role for the generation of these defects. Overall, stacking faults and isolated Ba planes show a distinct dark contrast in HAADF-STEM images and were observed in thin films [12][13][14] but also in (poly-and single-crystalline) bulk samples of Ba122 [15][16][17], which highlights the importance of understanding their origin. These defects locally introduce strain in Ba122 [48] due to the observed lattice-parameter changes, which influences the superconducting properties. Furthermore, both types of planar defects shown in figure 10 could act as vortex  pinning centers for external magnetic fields H||ab. Similar to the discussion for vertical defects in Ba122 [46,49], planar defects are most effective for H||ab-pinning if their vertical size is roughly 2ξ c , with the coherence length in c-direction of ξ c = 1.2 nm for Ba122 [50]. The isolated Ba planes shown in figures 10(b) and (c) have a size of roughly 1.6-1.8 nm. For the stacking faults a size of roughly 2 nm is observed, assuming that the strongly strained Fe-As planes surrounding the stacking fault are not superconducting (see blue vertical arrow in figure 10(a)). Indeed, earlier works found evidence for H||abpinning by such stacking faults in Ba122 films [14]. Therefore, both types of planar defects could act as effective vortex pinning centers for H||ab with a plate-like, two-dimensional structure.
The chemical analysis of a planar defect with dark appearance in Z-contrast images is shown in figure 11. An EELS spectrum image was collected and all spectra parallel to the defect (horizontal direction) were summed up prior to signal extraction to increase the signal-to-noise ratio. The extraction of the core-loss signals shows the chemical composition along the vertical direction, which is superimposed on the ADF-STEM image ( figure 11(b)). At the defect, increased intensities for the Ba and O signals are clearly visible. Due to the increase in Ba signal, the planar defect is identified as a stacking fault ( figure 10(a)). Because of the limited spatial resolution of our STEM-EELS setup, adjacent Ba planes at the stacking fault (see black arrow in figure 10(a)) contribute simultaneously to the EELS signal. This leads to an increased Ba signal compared to a single Ba plane in undisturbed Ba122 or an isolated Ba plane ( figure 10(b) and (c)). In addition, a faint F signal is observed. The Fe, Co, and As signals are reduced at the defect, which is in agreement with missing Fe-As planes at both types of defects shown in figure 10. The presence of O explains the reduced Z-contrast of these defects in HAADF-STEM imaging, even though the content of heavy Ba atoms is nearly unchanged. In the Ba122 matrix, a constant O signal is observed which may be due to oxidation of Ba122 during transfer from FIB preparation into the TEM. Since oxidation of the planar defects due to contact with ambient air cannot be ruled out completely from this measurement alone, we additionally prepared TEM samples and took HAADF-STEM images with a SEM in a dual-beam system without breaking vacuum (appendix figure A6). Here the same dark contrast at planar defects is observed. Furthermore, these defects are also observed in films on F-free substrates [12] and in bulk Ba122 [15][16][17], which makes in-situ oxidation of an F-rich phase at stacking faults during TEM measurements unlikely. The latter aspect is in contrast to oxidation of BaF 2 /CaF 2, which was discussed earlier (section 3.1). From these results we conclude that O is already present at these defects during thinfilm deposition and that O plays an important role in defect formation in Ba122. Possible sources are remnant O 2 or Ocontaining molecules in the vacuum of the PLD system or contamination of the target material with O-containing phases. As can also be seen in figure 11(b), the F signal completely vanishes in the Ba122 film. Combining this measurement with the large-area EELS elemental maps shown in figure 5, we conclude that F is present at (planar) defects and BaF 2 but not in the undisturbed Ba122 film in concentrations above the detection limit of our measurements. The planar defects are not visible in figure 5(b) due to the relatively large step size of 2.6 nm between spectrum collection points. F might first diffuse along vertical (out-of-plane) defects, i.e. BaF 2 , and then into planar (in-plane) defects. However, we cannot completely rule out that F diffusion is (partially) driven by interaction with the electron beam.

Conclusions
In this work, two superconducting Ba122 thin films grown on CaF 2 (001) substrates with different deposition rates were investigated with analytical TEM. We show that electron/ionbeam-induced radiation damage in the Ba122-CaF 2 system can substantially alter microstructural and chemical properties, which complicates interpretation of experimental results. Most important, the formation of an amorphous interface reaction layer and oxidation of BaF 2 /CaF 2 during electron-beam exposure is observed. The deposition of Ba122 with a low growth rate (0.4 Å s −1 ) results in a higher concentration of (planar) defects and the formation of BaF 2 precipitates. These defects are suppressed if a high growth rate (0.9 Å s −1 ) is applied. F diffusion into the Ba122 layer was observed only in combination with (planar) defects or in BaF 2 precipitates, i.e. only for the low growth rate.
Both Ba122 films showed larger crystalline Fe precipitates with effective diameters of a few 10 nm. Their origin is not clear, but a desorption of volatile As and Ba during film deposition from stoichiometric sintered Ba122 targets is possible. Careful tuning of the PLD target composition may reduce these precipitates.
Stacking faults at the Ba planes (i.e. missing Fe-As planes) and isolated Ba planes appear with a distinct dark contrast in HAADF-STEM images and locally increase the c lattice parameter. These two defects were mostly observed for the sample grown at a low rate. The dark HAADF-STEM Z-contrast is attributed to a high O content. Residual O in the PLD chamber and contamination of the Ba122 target material with O are the most likely sources. These results show that O plays an important role in the defect formation in IBS. Another defect type in the form of antiphase (grain) boundaries (APBs) was observed, which result from a shift of Ba122 grains parallel to the c-direction. APBs were more extended and observed in larger concentrations for the sample grown with a high rate and originate from atomic steps on the substrate surface. The findings in this work may help in the understanding of defect formation and optimized engineering of bulk and thin film Ba122.

Data availability statement
Exemplary datasets demonstrating data treatment for figures 4(b) and 10(a) are available [27]. Other data that support the findings of this study are available upon reasonable request from the authors. Figure A1. Scheme of the image processing steps used in this work to remove low-frequency background fluctuations in HAADF-STEM images (e.g. from sample thickness variations due to preparation artifacts) prior to image filtering. The (a) original image (here from figure  7(b)) is processed by (b) a two-dimensional anisotropic diffusion filter to find a background model. We used the shown implementation [51] in the Fiji image processing software [52] (located under plugins → process → anisotropic diffusion 2D in version 1.52p), and the screenshot shows the used parameters. We only changed the first three parameters and kept the default values for the other parameters. The procedure creates an image stack with 21 images (0, 5, 10, …, 100 iterations of anisotropic diffusion). (c) Comparison of two representative images from the stack after 35 and 75 iterations. After 35 iterations, atomic detail is still visible which we aim to preserve. Therefore, more smoothing steps are necessary and the atomic detail vanishes after 75 iterations (subjective choice by the user). This image is used as the background model in this case. If atomic detail would be still visible in the last iteration, the 'number of iterations' and/or the 'smoothings per iteration' parameters can be increased. (d) The background model is subtracted from the original image, which gives a (noisy) image without low-frequency background modulations. Afterwards, image filtering can be used to reduce noise in the image. Here, the average background subtraction filter by Kilaas [29] from the 'HRTEM Filter' plugin [28] in Digital Micrograph was applied. Besides an Fe precipitate, undisturbed layer growth of Ba122 is observed. (b) After acquisition of another image at the same region at higher magnification, planar defects (dark contrast) have formed in Ba122 due to electron-beam-induced radiation damage. The inset shows the marked region at higher magnification. A slight dark contrast is already visible around the central Ba plane but the Ba plane spacing (brightest atomic columns) is mostly unchanged. (c) Another image acquired at the same area shows that the planar defects grow in horizontal (in-plane) direction. After the second exposure, the c lattice parameter around the defect is enlarged by roughly 20%, and the defect is now clearly visible due to its dark appearance. The total dose per image scan in (b) and (c) was approximately 600 electrons Å −2 (pixel size of 0.166 Å 2 , pixel dwell time of 8 µs, assumed probe current of 2 pA). However, the probe current was not measured directly and instead approximated by using similar STEM imaging conditions as in [53].
with the mean value µ and the standard deviation σ. The shown error values correspond to the fitting error. Sample/fast (surface coverage 22%, number density of precipitates 42 µm −2 ) shows a higher concentration of Fe precipitates compared to sample/slow (surface coverage 7%, number density of precipitates 15 µm −2 ). The precipitate areas were obtained by automatic segmentation of several SEM surface images by the 'Trainable Weka Segmentation' plugin [54] in Fiji [52] after training the algorithm to separate Fe precipitates in a single image. An Otsu threshold was applied to the resulting Weka 'probability maps' for the Fe precipitates to obtain binary images. These binary images were further processed by morphological operations (e.g. erosion, dilation, and watershed) to remove most of the falsely assigned pixels and to separate overlapping Fe precipitates. This procedure yields the surface area of the Fe precipitates. The equivalent diameters were calculated by assuming a circular area of the same size. (c) Representative SEM image and fully processed binary image from the marked region in (a). The arrow marks an isolated, falsely assigned pixel/precipitate. Such pixels were removed from the particle size analysis in Fiji by using a lower boundary of 50 nm for the equivalent diameter. This value is a subjective choice based on the shape of the histograms shown in (a) and (b), where an increase in relative probability was observed for equivalent diameters smaller than 50 nm (not shown here). The absolute size values of the Fe precipitates at the sample surface should be interpreted carefully due to possible systematic errors, e.g. the finite spatial resolution for the used SEM imaging parameters.  This measurement demonstrates that the planar defects already contain O (and possibly F) after preparation of the thin film in the PLD and not due to subsequent oxidation after TEM sample preparation and transfer. The sample was extensively thinned at low Ga + -ion energies (1 keV for the final step) to make it thin enough for STEM imaging at 30 keV. The bright region in the bright-field image in the CaF 2 region at the interface (in the Ba122 region in the left part) could result from sample damage during preparation (contamination with hydrocarbons during imaging). The images were taken in the immersion mode using a dedicated STEM holder, a nominal probe current of 50 pA, a 'high' beam (convergence) angle setting and drift-corrected frame integration (DCFI) to compensate for sample drift. Before imaging, the sample was aligned to CaF 2 [110] zone-axis orientation with an on-axis CCD camera, which allows the acquisition of on-axis diffraction patterns (Bruker OPTIMUS TKD detector).