computer programs\(\def\hfill{\hskip 5em}\def\hfil{\hskip 3em}\def\eqno#1{\hfil {#1}}\)

Journal logoJOURNAL OF
SYNCHROTRON
RADIATION
ISSN: 1600-5775

MAP2XANES: a Jupyter interactive notebook for elemental mapping and XANES speciation

crossmark logo

aALBA Synchrotron, Cerdanyola del Vallès, Barcelona 08290, Spain, bDepartament de Mineralogia, Petrologia i Geologia Aplicada, Facultat de Ciències de la Terra, Universitat de Barcelona, Barcelona 08028, Spain, cMuseu de Ciències Naturals de Barcelona, Passeig Picasso s/n, Barcelona 08003, Spain, and dDepartament d'Arquitectura de Computadors, Universitat Politècnica de Catalunya (UPC) BARCELONATECH, Barcelona 08034, Spain
*Correspondence e-mail: cmarini@cells.es

Edited by K. Kvashnina, ESRF – The European Synchrotron, France (Received 10 February 2021; accepted 2 April 2021; online 19 May 2021)

MAP2XANES is an intuitive Jupyter notebook that automatizes the analysis of synchrotron X-ray fluorescence imaging and X-ray absorption spectroscopy for the characterization of complex and heterogeneous samples. The notebook uses basic modules and functions from Numpy, Scipy, Pandas, iPywidgets and Matplotlib libraries for a powerful data reduction process that, in just a few clicks, guides the user through the visualization of elemental maps, space-resolved absorption spectra and their automatized analysis. In particular, by means of linear combination fit of the XANES spectra, the notebook determines the chemical species distribution in the sample under investigation. The direct output of the analysis process is the correlation between the different elemental distributions and the spatial localization of the chemical species detected. An application to mineralogy is thus presented, analyzing the Mn2+, Mn3+ and Mn4+ distribution in a mineral sample of hausmannite (Mn2+Mn23+O4), courtesy of the Museum of Natural Science of Barcelona.

1. Introduction

X-ray fluorescence (XRF) is a standard analytical, non-destructive technique that allows the determination of atomic elements in a sample, with a detection limit down to parts per million (p.p.m.) (Young et al., 2016[Young, K. E., Evans, C. A. K., Hodges, V., Bleacher, J. E. & Graff, T. G. (2016). Appl. Geochem. 72, 77-87.]) or a fraction of it (Castillo-Michel et al., 2017[Castillo-Michel, H. A., Larue, C., Pradas del Real, A., Cotte, M. & Sarret, G. (2017). Plant Physiol. Biochem. 110, 13-32.]). In combination with micrometre position tagged spectroscopy, micro-XRF (µ-XRF) makes it possible to display the compositional variations in complex and heterogeneous samples. The data acquisition is generally simple and fast, independent of the sample's size and shape. As an additional advantage, this method is highly sensitive for trace elements independently from the spatial resolution adopted in the sample characterization, thanks to the high photon flux of synchrotron facilities (Janssens et al., 2000[Janssens, K. H. A., Rindby, A. & Adams, F. C. V. (2000). Microscopic X-ray Fluorescence Analysis. Chichester: Wiley.], 2010[Janssens, K., De Nolf, W., Van Der Snickt, G., Vincze, L., Vekemans, B., Terzano, R. & Brenker, F. E. (2010). TrAC Trends Anal. Chem. 29, 464-478.]; Haschke et al., 2002[Haschke, M., Scholz, W., Theis, U., Nicolosi, J., Scruggs, B. & Herczeg, L. (2002). J. Phys. IV, 12, 592.]; Marcus et al., 2004[Marcus, M. A., MacDowell, A. A., Celestre, R., Manceau, A., Miller, T., Padmore, H. A. & Sublett, R. E. (2004). J. Synchrotron Rad. 11, 239-247.]).

Over the last few years, µ-XRF has been successfully used in many applications working with multiple material types from a wide range of scientific disciplines, including the examination of geological samples to determine the mineral and element distribution in rocks (Roqué-Rosell et al., 2017[Roqué-Rosell, J., Villanova-de-Benavent, C. & Proenza, J. A. (2017). Geochim. Cosmochim. Acta, 198, 48-69.]; Flude et al., 2017[Flude, S., Haschke, M. & Storey, M. (2017). Miner. Mag. 81, 923-948.]; van Dijk et al., 2019[Dijk, I. van, Mouret, A., Cotte, M., Len Houedec, S., Oron, S., Reichart, G.-J., Reyes-Herrera, J., Filipsson, H. L. & Barras, C. (2019). Front. Earth Sci. 7, 281.]), in material science to study a wide range of materials and composites (Tsompopoulou & Mergia, 2013[Tsompopoulou, E. & Mergia, K. (2013). HNPS Adv. Nucl. Phys. 21, 145-147.]; dos Santos Pereira et al., 2017[Pereira, A. P. S., Silva, M. H. P., Lima Júnior, P., Paula, A. S. & Tommasini, F. J. (2017). Mater. Res. 20, 411-420.]), in cultural heritage to characterize archaeological and art objects (Mantler & Schreiner, 2000[Mantler, M. & Schreiner, M. (2000). X-ray Spectrom. 29, 3-17.]; Meirer et al., 2013[Meirer, F., Liu, Y., Pouyet, E., Fayard, B., Cotte, M., Sanchez, C., Andrews, J. C., Mehta, A. & Sciau, P. J. (2013). J. Anal. At. Spectrom. 28, 1870.]; Capobianco et al., 2020[Capobianco, G., Sferragatta, A., Lanteri, L., Agresti, G., Bonifazi, G., Serranti, S. & Pelosi, C. (2020). J. Imaging, 6, 59.]; Roqué-Rosell et al., 2021[Roqué-Rosell, J., Pinto, A., Marini, C., Prieto Burgos, J., Groenen, J., Campeny, M. & Sciau, P. (2021). Ceram. Int. 47, 2715-2724.]; Gambardella et al., 2020[Gambardella, A., Cotte, M., de Nolf, W., Schnetz, K., Erdmann, R., van Elsas, R., Gonzalez, V., Wallert, A., Iedema, P. D., Eveno, M. & Keune, K. (2020). Sci. Adv. 6, eaay8782.]), in environmental science to study soils and particulate matter (Fittschen et al., 2011[Fittschen, U. & Falkenberg, G. (2011). At. Spectrosc. 66, 567-580.]), and many others (Vanhoof et al., 2020[Vanhoof, C., Bacon, J. R., Fittschen, U. E. A. & Vincze, L. (2020). J. Anal. At. Spectrom. 35, 1704-1719.]).

The high flux, focus and energy tunability of synchrotron light has opened up the possibility of coupling µ-XRF to micro X-ray absorption spectroscopy (µ-XAS) (Farfan et al., 2018[Farfan, G. A., Apprill, A., Webb, S. M. & Hansel, C. M. (2018). Anal. Chem. 90, 12559-12566.]; Xu et al., 2018[Xu, W., Du, L., Liu, S., Zhu, Y., Xiao, C. A. & Marcelli, A. (2018). Condens. Matter, 3, 29.]; Marini et al., 2019[Marini, C., Rovira, A. M. D., Ramanan, N., Olszewski, W., Joseph, B. & Simonelli, L. (2019). Sci. Rep. 9, 18857.]).

XAS is an element-specific technique, which directly enables the determination of the local structure and electronic properties around the element on which the absorption takes place. It allows to determine the absorber chemical species, the ligand coordination and the local neighbouring environment (Penner-Hahn et al., 1999[Penner-Hahn, J. E. (1999). Coord. Chem. Rev. 190-192, 1101-1123.]). In a complex and heterogeneous sample, where several chemical phases coexist, the obtained XAS spectrum can be interpreted as a linear combination of spectra, which represent the individual coexisting phases and thus provides a direct speciation analysis of the sample (Gaur & Shrivastava, 2015[Gaur, A. & Shrivastava, B. D. (2015). Ref. J. Chem. 5, 361-398.]).

Therefore, combining both µ-XAS and µ-XRF allows to correctly describe complex and heterogeneous samples. The µ-XRF and µ-XAS experiments are currently accessible in several synchrotron facilities worldwide (https://www.iucr.org/resources/commissions/xafs/beamlines-in-europe gives a list of the XAS beamlines available in Europe, which, in most of the cases, enable such a combination) and are routinely performed as a main source of chemical information especially when wet chemistry or other laboratory techniques fail, as it is in the case of the indirect calculation of the samples' oxidation state [for example, in petrology see Deer et al. (1966[Deer, W. A., Howie, R. A. & Zussman, J. (1966). An Introduction to the Rock Forming Minerals, p. 528. London: Longman.]); Sutton et al. (2020[Sutton, S. R., Lanzirotti, A., Newville, M., Dyar, M. D. & Delaney, J. (2020). Chem. Geol. 531, 119305.])]. In addition, methods like `full spectral XANES imaging' (Monico et al., 2015[Monico, L., Janssens, K., Alfeld, M., Cotte, M., Vanmeert, F., Ryan, C. G., Falkenberg, G., Howard, D. L., Brunetti, B. G. & Miliani, C. (2015). J. Anal. At. Spectrom. 30, 613-626.]) (consisting of analyzing a stack of µ-XRF maps recorded at a few different energy values around an absorption edge) or full-field XANES imaging (Fayard et al., 2013[Fayard, B., Pouyet, E., Berruyer, G., Bugnazet, D., Cornu, C., Cotte, M., Andrade, V. D., Chiaro, F. D., Hignette, O., Kieffer, J., Martin, T., Papillon, E., Salomé, M. & Sole, V. A. (2013). J. Phys. Conf. Ser. 425, 192001.]; Tack et al., 2014[Tack, P., Garrevoet, J., Bauters, S., Vekemans, B., Laforce, B., Van Ranst, E., Banerjee, D., Longo, A., Bras, W. & Vincze, L. (2014). Anal. Chem. 86, 8791-8797.]; Park et al., 2020[Park, J. Y., Singh, J. P., Lim, J. & Lee, S. (2020). J. Synchrotron Rad. 27, 545-550.]) (consisting of acquiring magnified 2D transmission image of the sample by a camera coupled to an X-ray scintillator) have also been developed. Hence, the combined µ-XRF and µ-XAS experiments result in a large amount of data to deal with, which makes the automatization of the data reduction and data interpretation highly recommended or even mandatory.

To satisfy such a need of automatization, the synchrotron community has developed several solutions, resulting in some of the most popular data analysis packages, like PyMca (Solé et al., 2007[Solé, V. A., Papillon, E., Cotte, M., Walter, P. & Susini, J. (2007). At. Spectrosc. 62, 63-68.]), GSECARS Mapviewer (Newville, 2013[Newville, M. (2013). J. Phys. Conf. Ser. 430, 012007.]), GeoPixe (Ryan et al., 2005[Ryan, C. G., Etschmann, B. E., Vogt, S., Maser, J., Harland, C. L., van Achterbergh, E. & Legnini, D. (2005). Nucl. Instrum. Methods Phys. Res. B, 231, 183-188.]) and more recently PyXAS (Ge & Lee, 2020[Ge, M. & Lee, W.-K. (2020). J. Synchrotron Rad. 27, 567-575.]). PyMca is a user-friendly program for X-ray fluorescence analysis, developed at the ESRF. The program allows interactive as well as batch processing of large data sets and it has X-ray imaging capability. GeoPixe uses the dynamic analysis method for real-time spectral deconvolution to project quantitative elemental images from list-mode data. GSECARS Mapviewer is one of the applications of Larch (Newville, 2013[Newville, M. (2013). J. Phys. Conf. Ser. 430, 012007.]), that allows users to read and display HDF5 files containing X-ray fluorescence maps as collected at APS beamline 13-ID-E. PyXAS is an alternative to GSECARS Mapviewer, reading both HDF5 and TIFF format stack images listed by energy to reconstruct the XANES spectra and analyze them in terms of the linear combination of well characterized standards. In all the cited codes, the spatial grid of the fluorescence map is exactly the same as for the XAS sampling.

To the best of our knowledge, none of these codes can easily deal with XAS and XRF data collected on two different sampled grids. Sampling XRF and XANES adopting two different grids allows an efficient use of the beam time: typically, XANES spectra, for which collection is time consuming, are collected only in specific selected points generating a less dense sampled grid with respect to the XRF one. This approach permits an accurate and fast characterization by XRF without renouncing to the energy resolution to obtain good quality XANES spectra. The former has been adopted at the CLÆSS beamline. In this paper we present MAP2XANES Jupyter notebook, an interactive code that combines the analysis of XRF imaging and XAS spectra not sharing the same sampling grid. The code is written using basic modules and functions from the Numpy (Harris et al., 2020[Harris, C. R., Millman, K. J., van der Walt, S. J., Gommers, R., Virtanen, P., Cournapeau, D., Wieser, E., Taylor, J., Berg, S., Smith, N. J., Kern, R., Picus, M., Hoyer, S., van Kerkwijk, M. H., Brett, M., Haldane, A., del Río, J. F., Wiebe, M., Peterson, P., Gérard-Marchant, P., Sheppard, K., Reddy, T., Weckesser, W., Abbasi, H., Gohlke, C. & Oliphant, T. E. (2020). Nature, 585, 357-362.]), Scipy (Virtanen et al., 2020[Virtanen, P., Gommers, R., Oliphant, T. E., Haberland, M., Reddy, T., Cournapeau, D., Burovski, E., Peterson, P., Weckesser, W., Bright, J., van der Walt, S. J., Brett, M., Wilson, J., Millman, K. J., Mayorov, N., Nelson, A. R. J., Jones, E., Kern, R., Larson, E., Carey, C. J., Polat, İ., Feng, Y., Moore, E. W., VanderPlas, J., Laxalde, D., Perktold, J., Cimrman, R., Henriksen, I., Quintero, E. A., Harris, C. R., Archibald, A. M., Ribeiro, A. H., Pedregosa, F., van Mulbregt, P. & SciPy 1.0 Contributors (2020). Nat. Methods, 17, 261-272.]), IPywidgets (Perez & Granger, 2007[Perez, F. & Granger, B. E. (2007). Comput. Sci. Eng. 9, 21-29.]), Pandas (McKinney, 2010[McKinney, W. (2010). Proceedings of the 9th Python in Science Conference (SciPy 2010), 28 June-3 July 2010, Austin, TX, USA, pp. 51-56.]) and Matplotlib (Hunter, 2007[Hunter, J. D. (2007). Comput. Sci. Eng. 9, 90-95.]) libraries. In a few clicks the notebook guides the user through the analysis of simultaneously acquired elemental maps and the interpretation of the absorption spectra collected along the map at the absorption edge of interest.

To show the running code and its potential, we have chosen as an application the study of a natural hausmannite (Mn2+Mn3+2O4) sample performed at CLÆSS. During the analysis, spatially resolved elemental distribution maps of the excited 3d metal atoms (Mn, Ti, V and Cr) were superimposed on the obtained Mn valence distribution maps. This innovative approach for the first time quickly and automatically accesses the geochemical heterogeneities of a natural hausmannite, a mineral belonging to spinel, a well known group of minerals with complex compositions and mixed valence states.

2. Installation and workflow

The software will be OpenSource, distributed under MIT licence, and freely downloadable from the GitHub site of ALBA Synchrotron. Fig. 1[link] summarizes the main features implemented in MAP2XANES. The following subsections describe each method used to implement these features.

[Figure 1]
Figure 1
MAP2XANES features. Differently from all the other steps, the self-absorption correction is optional and for this reason is marked with an asterisk (*).

2.1. µ-XRF data loading

The user loads several ASCII multicolumn files (one for each elemental map), after setting the columns corresponding to the motor positions that identify the sample position in the beam (typically the `X' and `Z' positions), the `monitor signal' (incoming flux) and the `sample signal' (sample transmitted flux or sample fluorescence signal). Moreover, since MAP2­XANES works with two independent spatial grids (the first one for XAS and a second one for XRF data), the program also requires a two-column file containing all the positions (`X' and `Z' values) from where the µ-XAS spectra have been collected. During the upload process it is also necessary to define in which mode the spectra have been collected, i.e. in `transmission' or in `fluorescence' mode.

2.2. Elemental map visualization

After loading the XRF data, it is possible to visualize the corresponding XRF maps as a `contour plot', where grey dots mark the positions that correspond to the acquired µ-XAS spectra. A GUI slider allows visualizing all the loaded maps.

2.3. Scattering matrix

A scattering matrix is a grid of scatter plots used to visualize bivariate relationships between combinations of variables. Each scatter plot in the matrix visualizes the relationship between a pair of variables, allowing many relationships to be explored in one chart. Loading more than one elemental map opens up the possibility to explore the correlation between elemental distributions. By using the Python Panda library, the dispersion matrix (Manly & Navarro, 2016[Manly, B. & Navarro, A. J. (2016). Multivariate Statistical Methods. New York: Chapman and Hall/CRC.]) is calculated. Quantitatively, the elemental distributions in the sample are correlated by the Pearson correlation coefficient ρ (Benesty et al., 2009[Benesty, J., Chen, J., Huang, Y. & Cohen, I. (2009). Springer Topics on Signal Processing, 2nd ed. Berlin, Heidelberg: Springer.]). A ρ value of 1 or −1 implies that a linear equation describes the relationship between the counts belonging to two fluorescence line. A ρ value equal to 0 implies that there is no linear correlation between the variables. The MAP2XANES Jupyter notebook allows the calculation of the scattering matrix between the fluorescence lines as well as between the different species (see Figs. 3 and 6).

2.4. µ-XAS data loading

To match the most common synchrotron data files, the notebook allows the loading of an ASCII multicolumn file, after setting the columns corresponding to the incoming energy, `monitor signal' (i.e. incoming flux), and `sample signal'. For the latter it is necessary to define in which mode the data have been collected: in `transmission mode' the loaded spectra will be calculates according to the Lambert–Beer law, while in `fluorescence mode' they will correspond to the ratio of the fluorescence over monitor signals. In the same way, the program also asks for loading the reference spectra (to be further used for the linear combination fitting). Depending on the measurement mode and the concentration of the sample, it is also possible to include a self-absorption correction of the XAS data, using the code FLUO (Haskel, 1999[Haskel, D. (1999). FLUO, https://www3.aps.anl.gov/haskel/fluo.html.]).

2.5. µ-XANES normalization

The measured XAS spectra are then processed according to the standard procedure (Bunker, 2011[Bunker, G. (2011). Introduction to XAFS: A Practical Guide to X-ray Absorption Fine Structure Spectroscopy. Cambridge University Press.]). For each spectrum, the raw data are normalized by subtracting and dividing the pre-edge and post-edge backgrounds as low-order polynomial smooth curves. The GUI text boxes and sliders allow choosing iteratively the most appropriate parameters for this operation, dynamically defining pre-edge and post-edge limiting values. Furthermore, a combobox allows switching between `raw spectra' and `normalized' spectra to visualize the effect of the chosen parameters in real time. Finally, an additional slider allows moving between all the loaded spectra, to double check the absence of irregularities or other generic problems.

2.6. µ-XANES linear combination fit

MAP2XANES has the capability of fitting a linear combination of standard XANES spectra (up to four references, to avoid mathematical instability) to a measured spectrum to determine its chemical speciation. The fittings are performed on the normalized XANES (both sample and references). Linear combination fits (LCFs) are then performed within the energy range specified by the user. The normalized sums of the square residuals are used by the software as a discrepancy measurement between the unknown data and the fit model. The user can initialize the LCF process by simply sliding the weights of the proposed coexisting phases between the values 0 and 1.

2.7. Overlap of elemental map and LCF

Once the elemental maps and the results of the LCF of the XANES spectra are calculated, the program converts these latter ones into a map and overlaps it with the elemental maps contour plots. The algorithm used for such purpose is interpolate.griddata() contained inside the the Scipy library. The data have been interpolated by the standard linear method for unstructured data. This permits the users to visually associate the chemical speciation of the sample with the distribution of a specific element. To better quantify such relationships the program calculates the corresponding scattering matrix.

3. Case study

In this paper, MAP2XANES is deployed to define the Mn species distribution on a natural sample of hausmannite (Mn2+Mn23+O4). The selected sample belongs to the mineral collection of the Natural Science Museum of Barcelona with reference MCNB-20415 and corresponds to a massive hausmannite specimen from the locality of Ilfeld, in the Harztor municipality in the region of Thuringia (Germany). A full characterization of the hausmannite source can be found elsewhere (Bernardini et al., 2019[Bernardini, S., Bellatreccia, F., Casanova-Municchia, A., Della Ventura, G. & Sodo, A. (2019). J. Raman Spectrosc. 50, 873-888.]; Hewett, 1972[Hewett, D. F. (1972). Econ. Geol. 67, 83-102.]).

The hausmannite has been chipped into an approximately 10 mm × 5 mm × 2 mm grain. µ-XRF maps and µ-XAS spectra were recorded at the CLÆSS beamline at ALBA synchrotron light source (Barcelona, Spain) (Simonelli et al., 2016[Simonelli, L., Marini, C., Olszewski, W., Ávila-Pérez, M., Ramanan, N., Guilera, G., Cuartero, V. & Klementiev, K. (2016). Cogent Phys. 3, 1231987.]). The synchrotron radiation emitted by a multipole wiggler was vertically collimated by a mirror and monochromated by a liquid-nitro­gen-cooled double-crystal Si(111) monochromator. The beam size at the sample position was collimated down to ∼100 µm × 100 µm, thanks to the focusing toroidal mirror and the partial beam cut-off of the sample slits (closed to optimize the fluorescence signal detection). Higher harmonics contributions to the desired energy were eliminated by properly selecting the two mirrors' coating and rejection angle.

Prior to the experiment, the energy of the beamline was calibrated by measuring an Mn foil. The measurements of the standards were carried out in transmission mode by counting incident and out-going photon fluxes with respect to the sample using gas-filled ionization chambers. The µ-XRF elemental maps were recorded by selecting the Kα fluorescence lines of Ti, V, Cr and Mn detected by a six-element silicon drift detector (from Quantum Detectors), and by scanning the sample position by keeping the incoming beam energy well above the Mn K-edge (8 keV). The µ-XAS spectra were measured by selecting the Mn Kα fluorescence lines and by scanning the incoming energy across the Mn K-edge. The XAS spectra were collected in continuous mode in the energy range 6430–7170 eV. XANES has been sampled with an energy step of 0.3 eV per point. The counting time for each energy point is 0.1 s.

The fluorescence signal was collected with the samples at 45° with respect to the incoming beam and the fluorescence detector. The µ-XRF maps were acquired within 0.1 s counting time per point and in a grid of 100 µm × 100 µm sized measurement spots. The resulting elemental map of hausmannite is shown in Fig. 2[link], normalized by incoming photon flux. With the exception of Cr, which seems to be mainly located at the top of the sample, the distribution of the other metals (V, Mn, Ti) looks relatively uniform.

[Figure 2]
Figure 2
Elemental maps of V, Ti, Cr and Mn normalized by the incoming photons flux. The diagonal of the scattering matrix displays the `Density plot' of each fluorescence counting signal. This allows to access to the distribution of the fluorescence intensity along the whole sample. All the elemental distributions (shown along the diagonal of the scattering matrix in Fig. 3[link]) are bimodal (two main features in the diagonal of the scattering matrix).

To better elucidate the possible correlations between the elemental distributions obtained on the sample, we used MAP2XANES to reconstruct the scattering matrix and calculate the Pearson correlation coefficient ρ. The ρ values are reported in the `out of diagonal element' of the scattering matrix (see Fig. 3[link]). The obtained ρ values show a strong positive inter-dependence between Mn and the remaining metals in hausmannite (ρ > 0.98).

[Figure 3]
Figure 3
Scattering matrix from V, Ti, Cr and the Mn fluorescence counts. Along the diagonal of the scattering matrix the density plots of the elemental intensity are represented.

The position of the 37 µ-XAS spectra collected at the Mn K-edge on the sample are indicated by the grey dots in Fig. 2[link]. After loading the spectra in MAP2XANES it was possible to automatically deglitch them by filling a glitch list. In addition, due to the high concentration of Mn, the data have been corrected for the self-absorption effect (responsible for dampening and distortion of the spectral features) (Tröger et al., 1992[Tröger, L., Arvanitis, D., Baberschke, K., Michaelis, H., Grimm, U. & Zschech, E. (1992). Phys. Rev. B, 46, 3283-3289.]). The self-absorption correction was estimated by considering a simplified stoichiometry for hausmannite (Mn2+Mn23+O4).

Then, the obtained XANES spectra have been normalized by controlling pre-edge range and post-edge range parameters ( pre_es, pre_ee, po_es, po_ee), which define two regions of the data: one before the edge and one after the edge. In the normalization, MAP2XANES regresses a line to the data in the pre-edge region and a quadratic polynomial to the data in the post-edge one. By using the slider `number' it is possible to check the effect of normalization over all the spectra loaded. All the normalization parameters used are highlighted in the MAP2XANES screenshot in Fig. 4[link](a).

[Figure 4]
Figure 4
(a) The normalization procedure in MAP2XANES: data are in blue, pre-edge and post edge in orange and green, respectively. (b) LCF screenshot: data are in blue dots, best fit curve and weighted components in orange, green (Mn+2), purple (Mn+3) and red (Mn+4). (c) Reduced χ2 as a function of spectral index.

Once normalized, the spectra were analysed in terms of LCF using previously measured standards. In the current version of MAP2XANES the maximum number of components is limited to four, mainly to avoid any possible instability in the fitting routine. We are actually considering in a near future realization of the code the possibility to include principal component analysis into the code, to deal with more complicated systems in which the set of standards available is incomplete or unknown. The LCF procedure is initialized by selecting a spectrum among the loaded data and plot on top of it the curve obtained by the sum of the weighted references by a coefficient between 0 and 1 chosen by the user (see the supporting information). For the present study we chose a combination of three standards in which Mn presents +2, +3 and +4 as electron valence states, namely MnCO3, Mn2O3 and MnO2. The basic principle of the code is to look for the minimum of the squared difference between the data and the linear combination of the reference spectra. An example of best fit curve obtained from LCF is shown in Fig. 4[link](b). Furthermore, to double-check the quality of the LCF, MAP2XANES allows the reduced χ2 to be displayed as a function of the spectrum index [see Fig. 4[link](c)]. The obtained Mn speciation data can then be re-organized by adding the spatial information and mapped by overlapping it on the sample's elemental map contour plot (Fig. 5[link]).

[Figure 5]
Figure 5
The (a) MnCO3, (b) Mn2O3 and (c) MnO2 fractions and their spatial distribution as obtained from LCF and superimposed on the Mn elemental distribution contour plot from hausmannite.

As evident from the maps, the predominant measured Mn valence states in hausmannite are Mn3+ (Mn2O3), followed by Mn4+ (MnO2), whose average fraction are 65% and 25%, respectively. The Mn2+ (MnCO3) represents the minor valence state with an average value below 10% (see Fig. 5[link]). In addition, the obtained data suggest the presence of chemical variations within the hausmannite sample in terms of the coexistence of two differentiated compositional domains.

To better assess the correlations between the obtained LCF results and the elemental distributions of the transition metals we used MAP2XANES to calculate the corresponding scattering matrix and the Pearson coefficients (see Fig. 6[link]). As evident from Fig. 5[link], the MnCO3 and Mn2O3 phases coexist in varying proportions depending on the domains as expected in the spinel hausmannite. Besides, the presence of MnO2 seems to decrease the amount of the Mn2O3 phase present in the sample. In addition, we observe that: (i) Mn3+ is positively correlated with Cr (0.28) and Mn (0.27); (ii) Mn2+ is correlated to Ti (0.32) but negatively correlated to V (−0.42), and (iii) Mn4+ is correlated with the presence of V (0.4).

[Figure 6]
Figure 6
The scattering matrix obtained from LCF results and the V, Ti, Mn, Cr fluorescence counts. Along the diagonal of the 3 × 3 submatrix the density plots of the three LCF components are shown.

Thus, by combining both the elemental and chemical maps with the obtained scattering matrix values we can conclude that the sample's top domain compositionally corresponds to an intermediate hausmannite and chromite spinel with higher contents Cr and trace metals and with a predominant Mn3+ valence state. The domain below is closer to a hausmannite spinel in composition but with an important presence of a more oxidized Mn4+ valence state possibly related to the presence of other Mn–oxide minerals or hydro­thermal Mn compounds (Fig. 6[link]). The obtained data and the subsequent treatment by MAP2XANES highlight the geochemical heterogeneity and complexity of the selected natural hausmannite spinel.

4. Conclusions

In this paper, we presented MAP2XANES, a Python code for automatized quantitative analysis of synchrotron µ-XRF and µ-XAS data. MAP2XANES is able to simultaneously complement the data obtained by using these two techniques to achieve a deeper understanding of complex and heterogeneous samples. The software is written on Jupyter Notebooks and utilizes the most popular modules of Python language (Numpy, Scipy, Pandas, iPywidgets and Matplotlib). The developed code is a collection of methods able to: (i) visualize elemental maps and calculate the scattering matrix, (ii) simultaneously normalize a large set of µ-XANES data, (iii) eventually correct them for self-absorption, (iv) perform LCF analysis, and (v) overlap the LCF results with a selected elemental distribution map. The code also provides access to the possibility of automatically explore the correlations between the distributions of elemental and chemical species. Therefore, MAP2XANES is a powerful tool for quick post-processing large data sets to determine the compositional and chemical species and resolve their spatial distribution in complex and heterogeneous samples.

Supporting information


Acknowledgements

The authors thank Dr G. Agostini for fruitful discussion and ALBA synchrotron for the beam time provided for this project.

References

First citationBenesty, J., Chen, J., Huang, Y. & Cohen, I. (2009). Springer Topics on Signal Processing, 2nd ed. Berlin, Heidelberg: Springer.  Google Scholar
First citationBernardini, S., Bellatreccia, F., Casanova-Municchia, A., Della Ventura, G. & Sodo, A. (2019). J. Raman Spectrosc. 50, 873–888.  CAS Google Scholar
First citationBunker, G. (2011). Introduction to XAFS: A Practical Guide to X-ray Absorption Fine Structure Spectroscopy. Cambridge University Press.  Google Scholar
First citationCapobianco, G., Sferragatta, A., Lanteri, L., Agresti, G., Bonifazi, G., Serranti, S. & Pelosi, C. (2020). J. Imaging, 6, 59.  Web of Science CrossRef Google Scholar
First citationCastillo-Michel, H. A., Larue, C., Pradas del Real, A., Cotte, M. & Sarret, G. (2017). Plant Physiol. Biochem. 110, 13–32.  Web of Science CAS PubMed Google Scholar
First citationDeer, W. A., Howie, R. A. & Zussman, J. (1966). An Introduction to the Rock Forming Minerals, p. 528. London: Longman.  Google Scholar
First citationDijk, I. van, Mouret, A., Cotte, M., Len Houedec, S., Oron, S., Reichart, G.-J., Reyes-Herrera, J., Filipsson, H. L. & Barras, C. (2019). Front. Earth Sci. 7, 281.  Google Scholar
First citationFarfan, G. A., Apprill, A., Webb, S. M. & Hansel, C. M. (2018). Anal. Chem. 90, 12559–12566.  Web of Science CrossRef CAS PubMed Google Scholar
First citationFayard, B., Pouyet, E., Berruyer, G., Bugnazet, D., Cornu, C., Cotte, M., Andrade, V. D., Chiaro, F. D., Hignette, O., Kieffer, J., Martin, T., Papillon, E., Salomé, M. & Sole, V. A. (2013). J. Phys. Conf. Ser. 425, 192001.  CrossRef Google Scholar
First citationFittschen, U. & Falkenberg, G. (2011). At. Spectrosc. 66, 567–580.  Web of Science CrossRef CAS Google Scholar
First citationFlude, S., Haschke, M. & Storey, M. (2017). Miner. Mag. 81, 923–948.  Web of Science CrossRef CAS Google Scholar
First citationGambardella, A., Cotte, M., de Nolf, W., Schnetz, K., Erdmann, R., van Elsas, R., Gonzalez, V., Wallert, A., Iedema, P. D., Eveno, M. & Keune, K. (2020). Sci. Adv. 6, eaay8782.  Web of Science CrossRef PubMed Google Scholar
First citationGaur, A. & Shrivastava, B. D. (2015). Ref. J. Chem. 5, 361–398.  CrossRef CAS Google Scholar
First citationGe, M. & Lee, W.-K. (2020). J. Synchrotron Rad. 27, 567–575.  Web of Science CrossRef IUCr Journals Google Scholar
First citationHarris, C. R., Millman, K. J., van der Walt, S. J., Gommers, R., Virtanen, P., Cournapeau, D., Wieser, E., Taylor, J., Berg, S., Smith, N. J., Kern, R., Picus, M., Hoyer, S., van Kerkwijk, M. H., Brett, M., Haldane, A., del Río, J. F., Wiebe, M., Peterson, P., Gérard-Marchant, P., Sheppard, K., Reddy, T., Weckesser, W., Abbasi, H., Gohlke, C. & Oliphant, T. E. (2020). Nature, 585, 357–362.  Web of Science CrossRef CAS PubMed Google Scholar
First citationHaschke, M., Scholz, W., Theis, U., Nicolosi, J., Scruggs, B. & Herczeg, L. (2002). J. Phys. IV, 12, 592.  Google Scholar
First citationHaskel, D. (1999). FLUO, https://www3.aps.anl.gov/haskel/fluo.htmlGoogle Scholar
First citationHewett, D. F. (1972). Econ. Geol. 67, 83–102.  CrossRef CAS Web of Science Google Scholar
First citationHunter, J. D. (2007). Comput. Sci. Eng. 9, 90–95.  Web of Science CrossRef Google Scholar
First citationJanssens, K., De Nolf, W., Van Der Snickt, G., Vincze, L., Vekemans, B., Terzano, R. & Brenker, F. E. (2010). TrAC Trends Anal. Chem. 29, 464–478.  Web of Science CrossRef CAS Google Scholar
First citationJanssens, K. H. A., Rindby, A. & Adams, F. C. V. (2000). Microscopic X-ray Fluorescence Analysis. Chichester: Wiley.  Google Scholar
First citationManly, B. & Navarro, A. J. (2016). Multivariate Statistical Methods. New York: Chapman and Hall/CRC.  Google Scholar
First citationMantler, M. & Schreiner, M. (2000). X-ray Spectrom. 29, 3–17.  CrossRef CAS Google Scholar
First citationMarcus, M. A., MacDowell, A. A., Celestre, R., Manceau, A., Miller, T., Padmore, H. A. & Sublett, R. E. (2004). J. Synchrotron Rad. 11, 239–247.  Web of Science CrossRef CAS IUCr Journals Google Scholar
First citationMarini, C., Rovira, A. M. D., Ramanan, N., Olszewski, W., Joseph, B. & Simonelli, L. (2019). Sci. Rep. 9, 18857.  Web of Science CrossRef PubMed Google Scholar
First citationMcKinney, W. (2010). Proceedings of the 9th Python in Science Conference (SciPy 2010), 28 June–3 July 2010, Austin, TX, USA, pp. 51–56.  Google Scholar
First citationMeirer, F., Liu, Y., Pouyet, E., Fayard, B., Cotte, M., Sanchez, C., Andrews, J. C., Mehta, A. & Sciau, P. J. (2013). J. Anal. At. Spectrom. 28, 1870.  Web of Science CrossRef Google Scholar
First citationMonico, L., Janssens, K., Alfeld, M., Cotte, M., Vanmeert, F., Ryan, C. G., Falkenberg, G., Howard, D. L., Brunetti, B. G. & Miliani, C. (2015). J. Anal. At. Spectrom. 30, 613–626.  Web of Science CrossRef CAS Google Scholar
First citationNewville, M. (2013). J. Phys. Conf. Ser. 430, 012007.  CrossRef Google Scholar
First citationPark, J. Y., Singh, J. P., Lim, J. & Lee, S. (2020). J. Synchrotron Rad. 27, 545–550.  Web of Science CrossRef CAS IUCr Journals Google Scholar
First citationPenner-Hahn, J. E. (1999). Coord. Chem. Rev. 190–192, 1101–1123.  CAS Google Scholar
First citationPereira, A. P. S., Silva, M. H. P., Lima Júnior, P., Paula, A. S. & Tommasini, F. J. (2017). Mater. Res. 20, 411–420.  Web of Science CrossRef Google Scholar
First citationPerez, F. & Granger, B. E. (2007). Comput. Sci. Eng. 9, 21–29.  Web of Science CrossRef CAS Google Scholar
First citationRoqué-Rosell, J., Pinto, A., Marini, C., Prieto Burgos, J., Groenen, J., Campeny, M. & Sciau, P. (2021). Ceram. Int. 47, 2715–2724.  Google Scholar
First citationRoqué-Rosell, J., Villanova-de-Benavent, C. & Proenza, J. A. (2017). Geochim. Cosmochim. Acta, 198, 48–69.  Google Scholar
First citationRyan, C. G., Etschmann, B. E., Vogt, S., Maser, J., Harland, C. L., van Achterbergh, E. & Legnini, D. (2005). Nucl. Instrum. Methods Phys. Res. B, 231, 183–188.  Web of Science CrossRef CAS Google Scholar
First citationSimonelli, L., Marini, C., Olszewski, W., Ávila-Pérez, M., Ramanan, N., Guilera, G., Cuartero, V. & Klementiev, K. (2016). Cogent Phys. 3, 1231987.  Web of Science CrossRef Google Scholar
First citationSolé, V. A., Papillon, E., Cotte, M., Walter, P. & Susini, J. (2007). At. Spectrosc. 62, 63–68.  Google Scholar
First citationSutton, S. R., Lanzirotti, A., Newville, M., Dyar, M. D. & Delaney, J. (2020). Chem. Geol. 531, 119305.  Web of Science CrossRef Google Scholar
First citationTack, P., Garrevoet, J., Bauters, S., Vekemans, B., Laforce, B., Van Ranst, E., Banerjee, D., Longo, A., Bras, W. & Vincze, L. (2014). Anal. Chem. 86, 8791–8797.  Web of Science CrossRef CAS PubMed Google Scholar
First citationTröger, L., Arvanitis, D., Baberschke, K., Michaelis, H., Grimm, U. & Zschech, E. (1992). Phys. Rev. B, 46, 3283–3289.  CrossRef Web of Science Google Scholar
First citationTsompopoulou, E. & Mergia, K. (2013). HNPS Adv. Nucl. Phys. 21, 145–147.  CrossRef Google Scholar
First citationVanhoof, C., Bacon, J. R., Fittschen, U. E. A. & Vincze, L. (2020). J. Anal. At. Spectrom. 35, 1704–1719.  Web of Science CrossRef CAS Google Scholar
First citationVirtanen, P., Gommers, R., Oliphant, T. E., Haberland, M., Reddy, T., Cournapeau, D., Burovski, E., Peterson, P., Weckesser, W., Bright, J., van der Walt, S. J., Brett, M., Wilson, J., Millman, K. J., Mayorov, N., Nelson, A. R. J., Jones, E., Kern, R., Larson, E., Carey, C. J., Polat, İ., Feng, Y., Moore, E. W., VanderPlas, J., Laxalde, D., Perktold, J., Cimrman, R., Henriksen, I., Quintero, E. A., Harris, C. R., Archibald, A. M., Ribeiro, A. H., Pedregosa, F., van Mulbregt, P. & SciPy 1.0 Contributors (2020). Nat. Methods, 17, 261–272.  Google Scholar
First citationXu, W., Du, L., Liu, S., Zhu, Y., Xiao, C. A. & Marcelli, A. (2018). Condens. Matter, 3, 29.  Web of Science CrossRef Google Scholar
First citationYoung, K. E., Evans, C. A. K., Hodges, V., Bleacher, J. E. & Graff, T. G. (2016). Appl. Geochem. 72, 77–87.  Web of Science CrossRef CAS Google Scholar

This article is published by the International Union of Crystallography. Prior permission is not required to reproduce short quotations, tables and figures from this article, provided the original authors and source are cited. For more information, click here.

Journal logoJOURNAL OF
SYNCHROTRON
RADIATION
ISSN: 1600-5775
Follow J. Synchrotron Rad.
Sign up for e-alerts
Follow J. Synchrotron Rad. on Twitter
Follow us on facebook
Sign up for RSS feeds