International
Tables for
Crystallography
Volume I
X-ray absorption spectroscopy and related techniques
Edited by C. T. Chantler, F. Boscherini and B. Bunker

International Tables for Crystallography (2024). Vol. I. ch. 6.23, pp. 843-847
https://doi.org/10.1107/S1574870720003481

Chapter 6.23. xafsX: a program to process, analyse and reduce X-ray absorption fine-structure spectra

Markus Winterera*

aNanoparticle Process Technology, University of Duisburg-Essen, Lotharstrasse 1, 47057 Duisburg, Germany
Correspondence e-mail: [email protected]

xafsX is a terminal/command-based interactive data-analysis program to process, analyse and reduce X-ray absorption fine-structure spectra, including XANES (X-ray absorption near-edge structure) and EXAFS (extended X-ray absorption fine structure). The Fortran code runs on UNIX-based operating systems such as Linux and MacOSX. xafsX contains empirical line-shape analysis of pre-edge and XANES data as well as standard analysis of EXAFS data based on FEFF amplitude and phase functions, including a variety of methods especially for analysing disordered systems.

Keywords: xafsX; EXAFS; XANES; data processing; data reduction.

1. Introduction

The xafsX program allows the data analysis of XANES and EXAFS spectra, focusing on disordered solid systems such as glasses or amorphous and nanocrystalline materials. More elaborate methods such as reverse Monte Carlo modelling (Winterer, 2000link to reference, 2002link to reference; Winterer et al., 2002link to reference; Djenadic et al., 2010link to reference; Kompch et al., 2015link to reference) need xafsX as a data-processing and reduction tool. Originally, the xafsX code was developed for pre-Mac OS X and UNIX systems and described as xafs at the Ninth International Conference on X-ray Absorption Fine Structure in Grenoble, France, in 1996 (Winterer, 1997link to reference; Winterer et al., 1997alink to reference).

2. General aspects of the xafsX code

xafsX is an intuitive terminal/command-based interactive program to process, analyse and reduce X-ray absorption fine structure spectra, including XANES and EXAFS (see Fig. 1link to figure for an overview). The data analysis was developed by implementing most of the methods described in Teo (1986link to reference), Bianconi (1988link to reference) and especially Sayers & Bunker (1988link to reference) and Crozier et al. (1988link to reference).

[Figure 1]

Figure 1

Screen photograph of a terminal running xafsX and displaying keywords/options in the sequence of a normal data analysis. The letters in parentheses (…) are the commands to operate xafsX by entering them at the prompt >.

The code relies on singular value decomposition and Levenberg–Marquardt linear and nonlinear least-squares fitting routines (Press et al., 1986link to reference; Bevington, 1969link to reference). xafsX allows the data range to be selected, old parameters to be read, data to be simulated, parameters to be kept variable or fixed and parameter values to be correlated and confined. The user may select different modes to compute the error/data weight and other fit control parameters. Data analysis is facilitated in most cases by estimated initial values supplied automatically. All data-analysis steps are automatically displayed using gnuplot (Williams & Kelley, 1986link to reference) called directly from xafsX (using a subroutine published by Mahaffy, 1995link to reference; see Fig. 2link to figure). All resulting fitting parameters are automatically saved and can be used as input to simulate data or as initial values for fitting. The most important parameters determined are included in the header of the output files.

[Figure 2]

Figure 2

Top: screen photograph of gnuplot called directly from xafsX displaying the results of the data analysis, here the Co K-edge XANES spectrum of nanocrystalline Co0.2Zn0.8O (the red circles are data points and the blue line is the XANES fit). Bottom: enlarged view of XANES fit after normalization to the edge step height including the residual of the fit and the spectral contributions of the model (for parameter values see Table 1link to table).

In the following, we use Co K-edge XAFS data of nanocrystalline ZnO doped with 20 atom% Co (Djenadic et al., 2010link to reference) as an illustrative example. X-ray absorption spectra were obtained using beamline 12-BM-B at the Advanced Photon Source (APS). The absorption of the samples was optimized by diluting appropriate amounts homogeneously into starch powder and pressing a pellet uniaxially. Transmission spectra were collected at ambient temperature.

2.1. Importing data

All input and output data are column-oriented text files (ASCII code). xafsX contains a convenient, versatile data-import tool which facilitates user-defined column and header formats, including the importing and averaging of multiple data sets and the averaging of data from multiple fluorescence detectors. Available column data types are energy (eV or keV) or any abcissa, reference (I0), transmission (I1), fluorescence (I1), single channel, multiple averaged fluorescence (I1), calibration standard (I2), absolute error, xafs [for example ln(I0/I1)] or any ordinate. Corresponding file formats are saved for further use. If original signals are imported, errors are estimated according to Lee et al. (1981link to reference). Additionally, simulated FEFF data (Ankudinov et al., 1998link to reference; Kas et al., 2024link to reference) can be imported either as phase and amplitude (from feff####.dat files) or EXAFS signal (from chi.dat files).

2.2. Data preparation (preprocessing)

Data-preparation (preprocessing) tools contain deglitching, data rebinning and pre-edge analysis using a Victoreen (transmission data) or polynomial fit (fluorescence data). Data rebinning improves the signal-to-noise ratio at the cost of resolution.

The post-edge background subtraction is also performed empirically using either a spline function after subtraction of the edge (determined in the XANES fit) including white lines or alternatively (default) by a combination of an error function (for the absorption edge up to a chosen k value, the default value is 3 Å−1) and a cubic spline. This improves the spline fit considerably as the steep absorption edge is already fitted and taken care of in the prior XANES fit.

Arithmetic operations on spectra are included to perform, for example, Δμ XANES analysis or extraction of partial signals such as atomic XAFS (Ramaker & Koningsberger, 2010link to reference). This tool uses mapping of a second data-set abscissa to a data set chosen first by cubic spline interpolation; it allows a constant shift in abscissa and adjustment of the amplitude of the second data set.

2.3. XANES data analysis

XANES data analysis in xafsX is based on empirical line-shape functions. Besides spectroscopic information about pre-edge and edge features, this analysis provides reliable and reproducible values for the step height and position of the absorption edge. This is important for subsequent EXAFS data-analysis steps. Line-shape functions implemented for the absorption edge are arctangent, error function, a general step function (linear combination of arctangent and error function) and those for peak features are Lorentzian, Gaussian or pseudo-Voigt functions, as well as a Breit–Wigner–Fano function (Bianconi, 1988link to reference).

In Fig. 2link to figure the fit of the Co K-edge X-ray absorption spectrum of nanocrystalline ZnO doped with 20 atom% Co (Djenadic et al., 2010link to reference) is displayed with a corresponding fit of pre-edge peak, step and XANES features. The `deconvolution' by line-shape analysis provides unambiguous information about the position and height of the absorption edge as well as pre-edge and XANES features (Table 1link to table).

Table 1
Results of data analysis of Co K-edge XANES spectra for nanocrystalline Co0.2Zn0.8O using xafsX

E, position in energy (point of inflection or mode); w, width; a, amplitude; f, fraction of arctagent or Lorentzian line-shape function.

Line-shape functionE (eV)w (eV)a/astep f
Step function 7717.7 (3) 4.8 (2) 1.000 (1) 0.0 (1)
Pseudo-Voigt 7707.9 (3) 1.4 (1) 0.047 (5) 0.0 (10)
Pseudo-Voigt 7723.4 (3) 8.4 (2) 0.53 (1) 1.0 (1)

2.4. EXAFS data analysis

EXAFS data analysis in xafsX can be performed using different empirical models: `standard' using the classical EXAFS formula (Sayers & Bunker, 1988link to reference), `general' (including the third and fourth cumulant), `analytical distribution' (Crozier et al., 1988link to reference), `numerical distribution' (histogram), cumulant analysis of phase and amplitude signals (Bunker, 1983link to reference; Dalba et al., 1993link to reference) and distribution reconstruction (splice method) (Crozier et al., 1988link to reference). EXAFS data analysis is performed in k-space. Multiple scattering is not considered.

The analysis of the Co K-edge EXAFS signal of nanocrystalline ZnO doped with 20 atom% Co (Djenadic et al., 2010link to reference) up to the second coordination shell (Table 2link to table, Figs. 3link to figure and 4link to figure) provides local structure information about the Co dopant which is identical within the estimated errors with analysis results obtained using ARTEMIS (Ravel & Newville, 2024link to reference) or RMCXAS (Djenadic et al., 2010link to reference) for the Co–O and Co–Zn contribution. In case of the (minor) Co–Co contribution to the second shell, this type of data analysis is at the limit since Co and Zn are difficult to distinguish as backscatterers. The large estimated errors in the Debye–Waller factor for the Co–Co contributions and the deviation in the Co–Zn coordination number are probably an artefact owing to the parameter correlation between NCo–Co and NCo–Zn used in the fit.

Table 2
Results of data analysis of Co K-edge EXAFS spectra for nanocrystalline Co0.2Zn0.8O

A comparison to results obtained by analysis using ARTEMIS and RMCXAS can be found in Djenadic et al. (2010link to reference). N, coordination number; R, coordination distance; σ2, Debye–Waller factor.

ShellNR (Å)σ2 (10−3 Å2)
Co–O 3.7 (2) 1.962 (3) 5.9 (4)
Co–Co 3.6 3.453 (3) 14 (100)
Co–Zn 8.4 (30) 3.22 (3) 10 (1)
As we cannot simultaneously analyse two spectra (here the Zn K edge as well), we used the parameter correlation NCo–Co = 12 − NCo–Zn.
[Figure 3]

Figure 3

xafsX fit of EXAFS data of the Co K-edge EXAFS spectrum for nanocrystalline Co0.2Zn0.8O using xafsX after filtering the first and second shell in R space (0.5–3.4 Å, compare Fig. 4link to figure). The red points are filtered data, the blue line is the fit and the green line is the residual (for parameter values see Table 2link to table).

[Figure 4]

Figure 4

Magnitude of the Fourier transform of the xafsX fit of the Co K-edge EXAFS spectrum (Fig. 3link to figure) for nanocrystalline Co0.2Zn0.8O after filtering the first and second shell in R space (0.5–3.4 Å, compare Fig. 3link to figure). The red points are original, unfiltered data, the blue line is the fit and the green line is the residual. Since filtered data were fitted, the residual and fit signals are flat above 3.4 Å.

Detailed analysis of the first shell using different methods (Table 3link to table) shows that higher than second moments do not contribute significantly to the distribution of the Co–O coordination distances in this sample. This Gaussian distribution is consistent with the moment analysis of the partial pair distribution function obtained by RMC analysis of the same data (Djenadic et al., 2010link to reference). Deviations regarding the Co–O distance observed for the cumulant expansion and the general fit are likely to be due to probing different parts of the bond-distance distribution compared with other methods, since cumulant expansion and general fit include the third and fourth cumulants as fitting variables. This is likely to enlarge the flexibility of the fitting routine, although the higher cumulants remain insignificant. The rather small errors in the Co–O distance are a consequence of the single shell fits and the narrow Co–O distribution of Co substituting Zn in wurtzite-type ZnO.

Table 3
Results of data analysis of Co K-edge EXAFS spectra for nanocrystalline Co0.2Zn0.8O for the Co–O shell only using different data-analysis methods)

Higher cumulants/moments are not significant; a comparison to results obtained using ARTEMIS and RMCXAS can be found in Djenadic et al. (2010link to reference).

xafsX optionsNR (Å)σ2 = c2 = p2 (10−3 Å2)
Standard 3.7 (1) 1.960 (1) 6.0 (2)
Cumulant expansion 3.6 (1) 1.973 (4) 4.8 (3)
General 3.5 (1) 1.945 (4) 4.8 (5)
Analytical distribution 3.7 (1) 1.960 (2) 6.0 (6)
Numerical distribution 4.0 (2) 1.961 (1) 9.5 (3)
Splice reconstruction 3.6 (2) 1.960 (1) 10.5 (3)
Parameters determined and errors estimated from Gaussian fits to the distributions.

Together with results at the Zn K edge, the local structure shows that Co replaces Zn substitutionally in the wurtzite lattice, creating a solid solution of Co in ZnO consistent with X-ray diffraction and RMC data analysis (Djenadic et al., 2010link to reference).

2.5. Postprocessing tools

The postprocessing tools in xafsX are forward Fourier transformation including optical, phase-corrected transformation as well as backward Fourier transformation for filtering.

3. Peculiar aspects of the xafsX code

As an interactive program, xafsX leads the user step by step through data analysis and supports the user through estimates for (most) input parameters. xafsX contains a convenient, highly versatile data-import tool provided that the data are ASCII coded and column oriented, including averaging multiple columns from fluorescence detectors. xafsX allows good control of fitting procedures and saves all results automatically in separate files. In particular, xafsX provides accurate, reliable and reproducible data regarding edge position and step height owing to the empirical data analysis of the near-edge part of the spectrum not relying on finding maxima in noisy derivative signals and multiple spectral contributions and by providing different line-shape functions. Regarding the analysis of EXAFS data, different methods modelling distributions of bond distances are available, which is especially important for highly disordered systems.

The program has been used for data reduction and analysis of nanocrystalline materials (see, for example, Winterer et al., 1997link to referenceb), glasses (see, for example, Farges et al., 2001link to reference) and geochemical/mineralogical samples (see, for example, Ona-Nguema et al., 2005link to reference). Presently, it is mostly used for empirical pre-edge and XANES analysis, as well as data processing for EXAFS data refinement using more powerful codes such as RMCXAS (see, for example, Djenadic et al., 2010link to reference; Kompch et al., 2015link to reference) as well as analysis and postprocessing of the corresponding refinement results. xafsX is public domain and is available from the author by downloading from http://www.xafsx.de after registration via e-mail. The compiled code for Unix-type operating systems is supplied with some test-data, readme and help files explaining most of the features and procedures.

4. Trends and future perspectives

A batch version for fast data analysis of multiple data sets will provide more convenient analysis for multiple data sets. Additionally, the author may include user-specific modules upon request. Presently, a GUI or versions for Windows are not pursued.

Acknowledgements

The author gratefully acknowledges the discussion with and encouragement by Francois Farges. The author is grateful for all the beam time made available and supported by BNL, HASYLAB, SRS, BESSY, ANKA, APS, CLS, Diamond and especially their beamline scientists and technicians, and funding by the Alexander von Humboldt Foundation (AvH) and German Research Foundation (DFG).

References

First citationAnkudinov, A. L., Ravel, B., Rehr, J. J. & Conradson, S. D. (1998). Phys. Rev. B, 58, 7565–7576.Google Scholar
First citationBevington, P. R. (1969). Data Reduction and Error Analysis for the Physical Sciences. New York: McGraw–Hill.Google Scholar
First citationBianconi, A. (1988). X-ray Absorption: Principles, Applications, Techniques of EXAFS, SEXAFS, and XANES, edited by D. C. Koningsberger & R. Prins, pp. 573–662. New York: John Wiley & Sons.Google Scholar
First citationBunker, G. (1983). Nucl. Instrum. Methods Phys. Res. 207, 437–444.Google Scholar
First citationCrozier, E. D., Rehr, J. J. & Ingalls, R. (1988). X-ray Absorption: Principles, Applications, Techniques of EXAFS, SEXAFS, and XANES, edited by D. C. Koningsberger & R. Prins, pp. 373–442. New York: John Wiley & Sons.Google Scholar
First citationDalba, G., Fornasini, P. & Rocca, F. (1993). Phys. Rev. B, 47, 8502–8514.Google Scholar
First citationDjenadic, R., Akgül, G., Attenkofer, K. & Winterer, M. (2010). J. Phys. Chem. C, 114, 9207–9215.Google Scholar
First citationFarges, F., Brown, G. E., Petit, P. E. & Munoz, M. (2001). Geochim. Cosmochim. Acta, 65, 1665–1678.Google Scholar
First citationKas, J. J., Vila, F. D. & Rehr, J. J. (2024). Int. Tables Crystallogr. I, ch. 6.8, 764–769 .Google Scholar
First citationKompch, A., Sahu, A., Notthoff, C., Ott, F., Norris, D. J. & Winterer, M. (2015). J. Phys. Chem. C, 119, 18762–18772.Google Scholar
First citationLee, P. A., Citrin, P. H., Eisenberger, P. & Kincaid, B. M. (1981). Rev. Mod. Phys. 53, 769–806.Google Scholar
First citationMahaffy, J. (1995). plot2. http://www.personal.psu.edu/jhm/f90/examples/plot2.html .Google Scholar
First citationOna-Nguema, G., Morin, G., Juillot, F., Calas, G. & Brown, G. E. (2005). Environ. Sci. Technol. 39, 9147–9155.Google Scholar
First citationPress, W. H., Flannery, B. P., Teukolsky, S. A. & Vetterling, W. T. (1986). Numerical Recipes in C: The Art of Scientific Computing. Cambridge University Press.Google Scholar
First citationRamaker, D. E. & Koningsberger, D. C. (2010). Phys. Chem. Chem. Phys. 12, 5514–5534. Google Scholar
First citationRavel, B. & Newville, M. (2024). Int. Tables Crystallogr. I, ch. 6.1, 723–727 .Google Scholar
First citationSayers, D. E. & Bunker, B. A. (1988). X-ray Absorption: Principles, Applications, Techniques of EXAFS, SEXAFS, and XANES, edited by D. C. Koningsberger & R. Prins, pp. 211–256. New York: John Wiley & Sons.Google Scholar
First citationTeo, B. K. (1986). EXAFS: Basic Principles and Data Analysis. Berlin, Heidelberg: Springer.Google Scholar
First citationWilliams, T. & Kelley, C. (1986). gnuplot. http://www.gnuplot.info .Google Scholar
First citationWinterer, M. (1997). J. Phys. IV, 7, C2-243–C2-244.Google Scholar
First citationWinterer, M. (2000). J. Appl. Phys. 88, 5635–5644.Google Scholar
First citationWinterer, M. (2002). Nanocrystalline Ceramics: Synthesis and Structure. Berlin, Heidelberg: Springer.Google Scholar
First citationWinterer, M., Delaplane, R. & McGreevy, R. (2002). J. Appl. Cryst. 35, 434–442.Google Scholar
First citationWinterer, M., Nitsche, R. & Hahn, H. (1997a). J. Phys. IV, 7, C2-1211–C2-1212.Google Scholar
First citationWinterer, M., Nitsche, R. & Hahn, H. (1997b). Nanostruct. Mater. 9, 397–400.Google Scholar








































to end of page
to top of page