computer programs
DetOx: a program for determining factors of mixedoxidationstate species
^{a}Chemical Crystallography, Chemistry Research Laboratory, Mansfield Road, University of Oxford, Oxford OX1 3TA, UK, and ^{b}Diamond Light Source, Didcot, Oxfordshire, UK
^{*}Correspondence email: richard.cooper@chem.ox.ac.uk
Overlapping absorption edges will occur when an element is present in multiple oxidation states within a material. DetOx is a program for partitioning overlapping Xray absorption spectra into contributions from individual atomic species and computing the dependence of the factors on Xray energy. It is demonstrated how these results can be used in combination with Xray diffraction data to determine the of ions at specific sites in a mixedvalance material, GaCl_{2}.
Keywords: anomalous scattering; valence contrast; mixedoxidation state; absorptionfluorescence spectra.
1. Introduction
; Hendrickson et al., 1985; Hendrickson, 1991). To account for the phase change, the normal atomic (Thompson) scattering factor, f_{0}, is modified such that f = f_{0} + f ′ + if ′′. The absorption of Xrays at resonant energies (the absorption edge) can be characterized by measuring the absorption or fluorescence with respect to the incident photon energy. From this we are able to compute the real, f ′, and imaginary, f ′′, parts of the AS factors at energies on and around an absorption edge.
(AS) is an interaction that occurs when the energy of an incident Xray photon is close to an electronic resonance of a bound inner electron. The result is a change in phase of the diffracted Xray beam, which can be exploited to provide phasing information for techniques such as multiplewavelength anomalous diffraction (Hendrickson & Ogata, 19971.1. Theory versus experiment
Experiments to determine the et al., 1991). Fluorescenceabsorption experiments are routinely applied in macromolecular crystallography to find the absorptionedge positions of heavy atoms, e.g. Se, that have been substituted into the crystals (Terwilliger, 1994). Theoretical values for the real and imaginary parts of the factor can be computed using two equations. The first equation, the optical theorem (James, 1969), directly relates the absorptionfluorescence data to the imaginary, f ′′, part of the AS factor,
of an atom within a single crystal can be carried out given precise knowledge of the atomic scattering factors close to an (Wilkinsonwhere m_{e} is the mass of an electron, ∊_{0} is the permittivity of free space constant, E is the incident Xray energy, and μ_{a} is the atomic The real part of the AS factor is determined via a numerical integration of the Kramers–Kronig transformation,
These calculations, however, only apply to isolated atoms and, therefore, deviations from calculated values are observed in experimental data. These deviations are most noticeable in the vicinity of the ; Fig. 1). Calculation of the real and imaginary components of the AS from the fluorescence experiment is implemented in the program CHOOCH (Evans & Pettifer, 2001) for cases where there are no overlapping absorption edges.
(Xray absorption nearedge structure, XANES, and extended Xray absorption fine structure, EXAFS), caused by the chemical environment around the absorbing species interfering with ejected photoelectrons (Koningsberger & Prins, 19881.2. of mixedvalence materials
Since the position of the s electrons is also decreased, which in turn increases the Kshell absorption energy required to eject one of the core electrons. Measurements on a sample of GaCl_{3}, containing only Ga(III) and Cl atoms, give an at 10375 eV, cf. 10367 eV for the theoretical Ga(0) atom (Cromer & Lieberman, 1970, 1981; Cromer, 1983). The dependence upon absorptionedge position as a function of means that the fluorescence spectrum for a species containing two or more oxidation states of the same element is effectively a sum of the spectra from the individual atoms in their different oxidation states and atomic environments. The rapid variation of absorption with energy approaching the means that at certain energies the AS factors will be significantly different for each oxidation state.
is dependent upon electronic transitions within an atom, increasing the results in the moving to higher energy. As the number of valence electrons is decreased, the shielding of the nuclear charge from the core 12. DetOx
DetOx is a program, written using Python (Rossum, 1995), which deconvolutes the absorptionfluorescence spectrum of a mixedoxidation state compound into its component spectra for each atomic present in the sample. Input into DetOx is in the form of a plain text file containing two columns (space or tab delimited): Xray energy in electronvolts and corresponding intensitycorrected absorptionfluorescence values on an arbitrary scale. The program also requires input of the element under inspection and the number of expected oxidation states of the atom. There is an additional option to manually input absorption peak energies if the program is unable to detect them.
2.1. Normalization
Data are corrected for incident beam intensity before being normalized. This is performed by dividing the fluorescence signal at a given energy by the equivalent absorption reading from a diode placed in the beam, with the sample removed. Fluorescence data are input on an arbitrary scale, since there are many factors other than just the nature of the atomic scatterer that can contribute to the signal. These include the energy of the incident Xray beam, volume of the sample, the geometric orientation of the crystal on the diffractometer, the partial concentrations of different ). Therefore, the recorded fluorescence data must undergo a background correction and normalization. The input spectrum is normalized such that below the edge the signal tends to zero and above the edge the signal tends to unity, leaving only features caused by and XANES around the absorption edge.
heavyatoms in the sample and the distance of the sample from the detector. Background from elastically scattered Xrays and other sources also becomes an issue when making accurate measurements (Evans & Pettifer, 2001The normalization is achieved by fitting a straight line to input fluorescence data (F_{raw}) more than 50 eV below the theoretical edge (Φ_{below}) and a second to data more than 50 eV above the edge (Φ_{above}). These lines are extrapolated across the whole range of the data and then used to adjust the raw data to leave the normalized spectrum [N(E)],
In order for the program to normalize the data accurately, data should ideally be collected to a range ±200 eV from the theoretical Φ_{below} and Φ_{above}. Away from the (±200 eV), and XANES have a negligible effect on the fluorescence signal so it can be assumed that calculated theoretical values are an accurate approximation for the normalized spectrum (Evans & Pettifer, 2001).
to give reliable extrapolation of2.2. Determination of f ′′
Theoretical values of f ′′ over the energy range of the experimental data are obtained using the program MuCal (Bandyopadhyay & Segre, undated). The values above and below the edge can be described with Victoreen polynomials; however, over this narrow energy range linear functions ( and ) are sufficient to give an accurate fit. The experimental f ′′ spectrum is therefore calculated by
2.3. Deconvolution
As demonstrated by Wilkinson & Cheetham (1992), the GaCl_{2} spectrum is a sum of the fluorescence curves for the Ga(I) and Ga(III) species in the sample. Since it is not possible to determine exactly how the above the edge differ between the two oxidation states, we have made the assumption that the postabsorptionedge features do not have an effect on the position of the f ′ peak. We have tested this assumption by replacing the data points after the with theoretical values and determining the related f ′ values. As shown in Fig. 2, despite the postedge features being removed from the f ′′ spectrum, the position of the f ′ peak remains unchanged. Since we are only interested in the features of spectra before the absorptionedge peak, it is not critical to determine the exact contributions to the region from individual species, as this will not have a significant effect on the AS factors.
To overcome the problem of overlapping signals in the spectrum, a Fourier deconvolution is utilized. The measured spectrum, y(E), is defined as a convolution of the ideal signal, s(E), and a response function, r(E), plus a uniform noise function, n(E). If we assume that the signal itself is the sum of two identical underlying fluorescence curves, u(E) and u(E + ΔE), where one is offset by a shift of ΔE, then the signal, s(E), may be expressed as a convolution u(E) d(ΔE), where d(E) is the sum of two appropriately scaled δ functions separated by ΔE, m + . The peaks in the d(E) function are scaled such that the ratio of the areas under each, m:n, is proportional to the ratio of the oxidation states present in the sample. In the case of GaCl_{2}, this ratio is simply 1:1,
In order to determine AS coefficients for each species we must determine the shape of the function u(E). This may be achieved using a Fourier deconvolution. In the absence of noise, we could recover our unknown data signal by taking the reverse Fourier transform of . The optimal solution in the presence of noise, n(E), is found by applying a Wiener filter (Press et al., 2007) to this expression, the effect of which is to attenuate the influence of terms with a low signaltonoise ratio in the denominator.
In cases where only one ΔE subject to the conditions that the original signal is reproduced by application of (3) and no unexpected features are introduced to the extracted u(E). The output consists of two f ′′ curves, separated by a value of ΔE eV, that when added together reproduce the original input absorptionfluorescence signal. These curves are normalized to theoretical data away from the edge to give the imaginary AS factors for the different oxidation states as described in §2.
exists in the molecule, a single Gaussian can be used for the response function in the above equation. The effect in this case is simply to remove some broadening of the signal caused by Xray monochromator bandpass, detector precision and other random effects. Using an iterative process, we found that the optimum width for the response function, which sharpened the signal without introducing unexpected preedge features, was 0.16 eV. This value is expected to be instrumentspecific. For mixedoxidationstate cases, we employ a second iterative process to determine the optimum value of2.4. Determination of f ′
Firstly a Savitzky–Golay filter (Gorry, 1990) is applied to the deconvoluted curves in order to smooth the data. The f ′ values are then calculated by performing the Kramers–Kronig transformation, integrating between 0 and at each energy, (E_{0}), in the f ′′ spectrum. However, the denominator of the integration (E_{0}^{2} − E^{2}) contains a singularity, over which it is not possible to integrate. This can be overcome numerically after a Taylor expansion of the integral as described by Hoyt et al. (1984). The integration is performed using the Python Quadrature module, from the Numpy and SciPy opensource libraries (Jones et al., 2001), which computes a definite integral using fixedtolerance Gaussian quadrature. As implemented, the integration is performed between suggested limits of 0 eV and 50 times the theoretical edge energy (Hoyt et al., 1984), to ensure the program runs quickly. Owing to the assumption made in the deconvolution that both underlying signals are the same shape, the values of f ′ will be most reliable below the where there are no significant differences between the shapes of the two curves.
2.5. DetOx output
The default output from DetOx is a graph showing both f ′′ and f ′ calculated from the deconvoluted signals. The program will also tabulate the AS factors for all oxidation states present in the sample at given energies and output, a graph of the normalized spectrum, the effective f ′′ spectrum before the deconvolution and the data for the deconvoluted spectrum in plain text format.
3. Experimental
Fluorescenceabsorption data and Xray diffraction data were all collected on the SmallMolecule SingleCrystal Diffraction beamline, I19, at Diamond Light Source. Full diffraction datasets were collected in EH1 on a custombuilt Rigaku CrystalLogic diffractometer, using a Saturn724+ CCD detector at 150 K (Nowell et al., 2012). A silicon doublecrystal monochromator is used on the beamline for selecting a wavelength by changing its incident angle with the Xray beam.
Fluorescenceabsorption data were collected using a Vortex detector mounted next to the sample. As the monochromator angle and hence the wavelength is driven through a chosen range at set intervals, the Vortex detector records the
emitted by the sample. Initially, a broad scan (∼5 eV intervals) was recorded to locate the position of the A much finer scan was then recorded (∼0.25 eV intervals) across the (±40 eV) in order to see the exact edge position and nearedge features.The backgroundcorrected data were then input into DetOx. Using the program output, appropriate wavelengths were chosen for data collection so as to maximize the differences in f ′′ and f ′ between two oxidation states. DetOx provided the calculated AS factors at the chosen wavelengths. Once the structure has been solved, the relevant AS factors were input into CRYSTALS (Betteridge et al., 2003) to determine the of an element at a given site.
GaCl_{3}, containing just one Ga(III), was used as a test sample and results of the normalization and Kramers–Kronig transformation from DetOx were verified against those from CHOOCH (Evans & Pettifer, 2001; Fig. 3).
3.1. GaCl_{2}: a mixedoxidationstate compound
GaCl_{2} was chosen for this study since it has been extensively studied and the structure has been reported (Garton & Powell, 1957; Schmidbaur et al., 1987; Wilkinson et al., 1991). A similar experiment to exploit the anomalous signal in order to determine the at each Ga position within the structure using powder diffraction data has been previously reported by Wilkinson & Cheetham (1992).
Single crystals were obtained from Sigma Aldrich in a sealed vial under nitrogen. Crystals were immersed in dried oil under nitrogen and mounted directly in the cold stream to reduce exposure time to air and moisture.
The theoretical DetOx, a finer scan was performed between 10345 eV and 10415 eV in steps of 0.25 eV. Full Xray diffraction data collections were then recorded at 10314 eV (below the absorption edge) and 10368 eV [on the Ga(I) absorption edge]. Using CRYSTALS it was possible to determine the oxidation states of the Ga atoms in the structure. Firstly, each Ga site was occupied by two atomic species, Ga(I) and Ga(III), with AS factors calculated in DetOx (Table 1), and with occupancies summing to unity. The expectation would be that the occupancy of the atom with the Ga(I) AS factors refines to unity at the Ga(I) site and zero at the Ga(III) site and vice versa for the Ga atom with the Ga(III) AS factors.
of Ga is 10367 eV. Therefore, absorptionfluorescence data were collected between 10100 eV and 10700 eV in steps of 5 eV to locate the After an initial analysis of the output from

4. Results and discussion
The output from DetOx is shown in Fig. 4(a), and Fig. 4(b) shows the deconvoluted f ′′ superimposed onto the normalized fluorescence spectrum of GaCl_{2} before deconvolution. Table 1 shows the factors, calculated by DetOx.
Structures were solved for both datasets using SIR97 (Altomare et al., 1999) and all and analysis was undertaken using the CRYSTALS crystallographic package. The coordinates for atoms in the were consistent with previous singlecrystal studies by Schmidbaur et al. (1987). A filter of < 0.145 (based on examination of the Wilson plot) was added to remove the weak highangle data. The results from the occupancy are shown in Table 2.

The DetOx output revealed an optimum energy offset between the Ga(I) and Ga(III) absorption edges, consistent with that reported by Wilkinson & Cheetham (1992) from powder data, of 3.3 eV. The values in Table 2 show that the occupancies refine as expected; however, the reliability of these values must be taken into consideration. Since the errors in occupancy for the onedge dataset (±0.20) are much lower than those below the edge (±1.5), it is clear that the values from the belowedge analysis are less reliable. The reason for this is that the belowedge AS values are identical to within ±0.05 eV (much less than the electron density of an H atom), which results in a strong correlation between the Ga(I) and Ga(III) occupancies. However, on the Ga(I) where f ′′ varies rapidly with energy, the difference is much larger allowing the occupancies to be determined more reliably.
The accuracy of the f ′ data has been verified by the test spectrum shown in Fig. 3 on GaCl_{3}. Therefore, the main source of potential error arises in the deconvolution step. Fig. 4(b) shows that the deconvoluted curves align with the appropriate peaks in the original spectrum. Even so, the assumption that the curves have the same form up to the absorption peak (the section of the f ′′ spectrum we are interested in) is difficult to test. Nevertheless, the results presented in Table 2 support the accuracy of the calculated AS factors, and indicate that this assumption is appropriate for the function of the program.
5. Conclusion
DetOx can be used to discriminate between different oxidation states of the same element within a mixedoxidationstate compound using tunable synchrotron radiation. By analysing the output from DetOx, an appropriate wavelength can be selected in order to maximize the differences in f ′ and f ′′. Values of the AS factors at the selected wavelengths can then be determined and input into an appropriate program such as CRYSTALS. Occupancies can be refined at each site to determine the of an atom. Results from singlecrystal studies on GaCl_{2} are consistent with previous reports from powder data. DetOx will be published online and is currently available from the authors.
Acknowledgements
We acknowledge Diamond Light Source and The Department of Chemistry, University of Oxford, for funding KJS's studentship, Dr Gwyndaf Evans for helpful discussions about theoretical and practical aspects of the implementation, and Mark Irwin for assistance with sample preparation. We would also like to thank Diamond Light Source for the award of beam time (MT7768) to carry out the data collections, and the referees of this manuscript for their helpful comments and questions.
References
Altomare, A., Burla, M. C., Camalli, M., Cascarano, G. L., Giacovazzo, C., Guagliardi, A., Moliterni, A. G. G., Polidori, G. & Spagna, R. (1999). J. Appl. Cryst. 32, 115–119. Web of Science CrossRef CAS IUCr Journals Google Scholar
Bandyopadhyay, P. & Segre, C. U. (undated). Mucal on the web, http://www.csrri.iit.edu/mucal.html. Google Scholar
Betteridge, P. W., Carruthers, J. R., Cooper, R. I., Prout, K. & Watkin, D. J. (2003). J. Appl. Cryst. 36, 1487. Web of Science CrossRef IUCr Journals Google Scholar
Cromer, D. T. (1983). J. Appl. Cryst. 16, 437. CrossRef Web of Science IUCr Journals Google Scholar
Cromer, D. T. & Liberman, D. A. (1970). J. Chem. Phys. 53, 1891–1898. CrossRef CAS Web of Science Google Scholar
Cromer, D. T. & Liberman, D. A. (1981). Acta Cryst. A37, 267–268. CrossRef CAS IUCr Journals Web of Science Google Scholar
Evans, G. & Pettifer, R. (2001). J. Appl. Cryst. 34, 82–86. Web of Science CrossRef CAS IUCr Journals Google Scholar
Garton, G. & Powell, H. M. (1957). J. Inorg. Nucl. Chem. 4, 84–89. CrossRef CAS Web of Science Google Scholar
Gorry, P. A. (1990). Anal. Chem. 62, 570–573. CrossRef CAS Web of Science Google Scholar
Hendrickson, W. A. (1991). Science, 254, 51–58. CrossRef PubMed CAS Web of Science Google Scholar
Hendrickson, W. A. & Ogata, C. (1997). Methods Enzymol. 276, 494–523. CrossRef CAS Web of Science Google Scholar
Hendrickson, W. A., Smith, J. L. & Sheriff, S. (1985). Methods Enzymol. 115, 41–55. CrossRef CAS PubMed Google Scholar
Hoyt, J. J., de Fontaine, D. & Warburton, W. K. (1984). J. Appl. Cryst. 17, 344–351. CrossRef CAS Web of Science IUCr Journals Google Scholar
James, R. W. (1969). The Optical Principles of the Diffraction Xrays. London: G. Bell. Google Scholar
Jones, E., Oliphant, T., Peterson, P. et al. (2001). SciPy: open source scientific tools for Python, http://www.scipy.org/. Google Scholar
Koningsberger, D. C. & Prins, R. (1988). Xray Absorption: Principles, Applications, Techniques of EXAFS, SEXAFS, and XANES. New York: John Wiley. Google Scholar
Nowell, H., Barnett, S. A., Christensen, K. E., Teat, S. J. & Allan, D. R. (2012). J. Synchrotron Rad. 19, 435–441. Web of Science CrossRef CAS IUCr Journals Google Scholar
Press, W. H., Teukolsky, S. A., Vetterling, W. T. & Flannery, B. P. (2007). Numerical Recipes: The Art of Scientific Computing, 3rd ed. Cambridge University Press. Google Scholar
Rossum, G. van (1995). Python Tutorial. CWI Report CSR9526. Dutch Centrum Wiskunde & Informatica (CWI), Amsterdam, The Netherlands. Google Scholar
Schmidbaur, H., Nowak, R., Bublak, W., Burket, P., Huber, B. & Müller, G. (1987). Z. Naturforsch. Teil B, 42, 75–86. Google Scholar
Terwilliger, T. C. (1994). Acta Cryst. D50, 17–23. CrossRef CAS Web of Science IUCr Journals Google Scholar
Wilkinson, A. P. & Cheetham, A. K. (1992). J. Appl. Cryst. 25, 654–657. CrossRef CAS Web of Science IUCr Journals Google Scholar
Wilkinson, A. P., Cheetham, A. K. & Cox, D. E. (1991). Acta Cryst. B47, 155–161. CrossRef CAS Web of Science IUCr Journals Google Scholar
© 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.