Abstract. WinXAS is a new X-ray absorption spectroscopy (XAS) data analysis program. It runs under the operation system MS-Windows and offers several unique features. It has a user-friendly graphical environment and is capable of processing a variety of data formats. It contains a number of useful numerical algorithms beyond those used in standard XAS analysis and offers a simple interface to the ab-initio theoretical code FEFF. The availability of fast macros in WinXAS makes it particularly useful for on-line data examination at a synchrotron radiation facility during XAS experiments as well as analysis of multiple-scan data such as those from time-resolved experiments.

Introduction

Since the user community is growing rapidly
and beamtime at today’s synchrotron radiation facilities
becomes more and more precious, every researcher should seek to use
this time as efficient as
possible. In the case of X-ray absorption spectroscopy (XAS),
experimental stations as well as
theoretical calculation codes have been improved to a large extend over
the past years. Nevertheless,
the availability of use-friendly, graphical data analysis programs does
not seem to catch up with this
evolution.

WinXAS is a new graphical XAS data reduction program running on IBM
compatible
personal computers (PC) under the operation system MS-Windows. It is
aimed to satisfy the
requirements of a user-friendly analysis tool, capable of performing
all basic XAS data reduction
steps in order to help the researcher decide whether more advanced
codes need to be employed.
Moreover, its easy-to-use and partially automated data reduction
procedures (macros), make WinXAS
especially suited to be used on line at an early stage of a XAS
experiment. Thus, information about
the progress of an on-going experiment can be obtained and more often
than not, wasting an entire
block of beamtime can be avoided by such a tentative data analysis.
Additionally, a PC based analysis
program seems to be particularly adequate since users might want to
take their own computers with
them and not rely on analysis software that may or may not be available
at the beamline.
In addition to its numerical and XAS specific algorithms, WinXAS
contains unique features
for the analysis of data obtained from energy-dispersive XAS (DXAS)
experiments. Investigations
that result in a large number of consecutive spectra, such as
time-resolved experiments, can benefit
from WinXAS, too. Its macro capabilities allow to record single
reduction steps and to employ them
in a serial treatment to each spectra out of a large data set. Where
such an approach is feasible,
efficiency can be enhanced and calculation time can be decreased
substantially.

In the following, the variety of numerical procedures (XAS related as
well as others) and
graphical routines that comprise the basic modules of WinXAS are
described, together with some
general information on system requirements and data format.

WinXAS is running under the operation system
Microsoft Windows 95 or later on IBM
compatible personal computers. Using a Pentium processor and SVGA
monitor resolution is recommended. WinXAS is
embedded in the well known MS-Windows Graphical User Interface and
takes advantage of its
common device drivers and shared facilities. Owing to this general
features, the appearance of most
MS-Windows programs is similar with respect to their basic functions
and getting started with
WinXAS for XAS data reduction should be fairly simple even for novice
users. A two-button
pointing device, such as a PC mouse or a track ball, is used
extensively not only in order to select
single menu entries but also, for instance, to input values directly
from several dialog boxes and to
change function parameters interactively. Experienced users, however,
will appreciate the numerous
keyboard accelerators and short cuts in order to speed-up data
processing.

Currently, the latest WinXAS version can be obtained from this site on
the world wide web:
(http://www.winxas.de). The program is distributed together with
an online assistant, a manual, and a graphical visualization program
for molecules and clusters
(RasMol v2.6 by R. Sayers, 1995).

Since every existing XAS beamline seems to
favor its own data format for experimental spectra,
hardly one data reduction program can be expected to serve in all
cases. Therefore, users are often
confronted with the unloved task to transform their data from one
format into another. For that
purpose, the file format of WinXAS has been chosen very simple and the
file-read procedure has
been kept as open and flexible as possible. Multiple column ASCII files
are automatically recognized
and the user is prompted to enter the corresponding column number for
photon energy as well as I0
and I1 in order to calculate the absorption spectrum. Therefore, a
separate conversion program may
turn out to be unnecessary in many cases. However, where such a program
is needed its encoding
should be feasible with a minimum of time and effort. WinXAS stores
data in a binary format as
default in order to save storage space and access time. Again, this
format has been kept very simple
and is well documented. In order to transfer data between applications,
spectra can be saved in a
two-column ASCII format.

Certainly one of the outstanding features of WinXAS is its user
friendly graphical interface.
Unlike other line oriented analysis programs, WinXAS offers a full
visualization of results and
intermediate steps during the data reduction. Up to four spectra can be
processed simultaneously,
each in its own graphic window, and plots from each window can be
superimposed and compared
at any time. Moreover, each of the four graphic window contains four
internal data arrays that are
used to hold and display intermediates and results. Thus, every data
reduction step can easily be
made undone and input and output of each analysis procedure are
available in the same window for
comparison. Furthermore, WinXAS plots can readily be exported to all
common word processors
for documentation using the MS-Windows Clipboard. Additionally,
graphics can be printed directly
from WinXAS employing any printer that is supported by MS-Windows.

The numerical library implemented in WinXAS
contains a selection of common and useful
algorithms in order to calculated, for instance, integration,
derivatives, root determination, Fourier
transformation, smoothing, least-squares refinement of a variety of
profile functions, and more. All
algorithms can be employed independent from an on-going XAS analysis at
every step of the
reduction procedure allowing the largest possible flexibility in the
data analysis. Each numerical
procedure is documented either in the WinXAS manual or the public
source it has been taken from
and details such as constraints, limitations, and accuracy can be
obtained from the cited literature
(Press et al., 1989; Engeln-Müllges & Uhlig, 1996). In
addition to these numerical algorithms,
WinXAS contains several procedures in order to conveniently manipulate
entire data sets as well as
single data points. Both abscissa and ordinate of a spectrum can be
shifted or multiplied by a
constant and sections from one spectrum can be copied to another one
(cut and paste; for instance, in
order to remove steps in the absorption spectrum). Single data points
can be changed or deleted just by using the mouse pointer, for example,
in order to remove so-called ‘glitches’ (in addition to the
more advanced procedures implemented into WinXAS for this purpose).

Besides experimental data, each of the WinXAS graphic windows contains
an explicit
numerical function. This function can be comprised out of a variety of
build-in profile functions
(Gaussian, Lorentzian, Voigt, trigonometrical functions, polynomials,
etc.). Not only can profile function and XAS spectrum be superimposed,
WinXAS also allows to add or multiply profile function and data as well
as to apply the profile function to the abscissa or ordinate of the
spectrum. In this way, difference files can be calculated and spectra
can be normalized. Most of the numerical algorithms can also be applied
to the profile function (i.e. integration, differentiation, roots
determination, etc.).

Besides basic mathematical combination, profile functions can be
refined to experimental
data using a standard least-squares algorithm. WinXAS employs the
Levenberg-Marquardt algorithm,
which is known to converge fast and stable for reasonable initial
parameters. Furthermore, WinXAS
offers several schemes in order to correlate or constrain function
parameters during the refinement
(i.e. fixed, equal to each other, basic math operations). In addition
to the refined function
parameters, the output of a least-squares refinement includes standard
deviations, correlation
matrices, and the graphical residual. Moreover, in case of a XAS
refinement, the Fourier transform
of the residual as well as the experimental spectrum and the
theoretical XAS function are displayed.

Not all scientific questions addressed by
today’s biologists, chemists, and physicists using XAS
require a full multiple scattering ab-initio approach. On the other
hand, basically every XAS data
analysis begins with a visualization of experimental data and basic
reduction steps such as energy
calibration, glitch removal, and background subtraction. During this
first analysis, results need to be
properly visualized in order to enable a comparison between different
experiments, samples, or
reaction conditions. Only on the basis of this tentative data
reduction, one can decide in favor of a
single scattering analysis using either experimental or theoretical
phases, or a full multiple scattering
treatment.

Since WinXAS does not consist of separate analysis modules, all
numerical procedures and
graphical features can be used at every stage of a XAS data analysis.
Therefore, WinXAS exceeds the
step-by-step approach of elder line-orientated data reduction programs.
Furthermore, data reduction
features such as smoothing, convolution, XANES profile fitting, linear
combination XANES fit
using experimental spectra or difference file technique (Vaarkamp et
al., 1993), extend the
implemented standard XAS capabilities. All algorithms can be employed
on an easy-to-use basis and
often the most suitable procedure can be chosen out of several
different routines. Moreover, already
performed reduction steps can easily be made undone and different
reduction procedures can be
applied to the same spectrum and the respective results can be compared
afterwards. Figure 1
displays the WinXAS user interface and four different examples for its
XAS data analysis capabilities.
WinXAS does not imply one particular way to analyze XAS spectra, but
offers the largest
possible flexibility. Nevertheless, certain recommendations for the
reduction of XAS spectra have
been implemented (Teo, 1986; Koningsberger & Prins, 1988). All
necessary steps for conventional
XAS data reduction can be carried out (background subtraction
(Victoreen, one or two polynomial),
E0 determination (1st and 2nd derivative, XANES profile function
fitting), atomic absorption m0
(cubic spline fitting, polynomial fit) , Fast Fourier Transform
(several windows, variable step width
in R space)). Furthermore, experimental phase shifts and backscattering
amplitudes obtained from
reference compounds, as well as theoretical phases and amplitudes can
be used in order to perform
single-scattering plane wave XAS refinements. Higher cumulants can be
added to the standard XAS
formula to account for a non-Gaussian distribution in the thermal
disorder. XAS refinements can be
carried out in k space and in R space.

During all these steps, a proper visualization of results and their
dependence on the various
parameters is provided. The atomic absorption (m0-fit) window, for
instance, not only displays the
spectrum and the refined cubic spline, but also the resulting c(k), the
first derivative of the cubic
spline and the Fourier transformed c(k). Therefore, the user has a
maximum of information at hand
on how changing the number of nodes for the spline, the weighting
scheme, or the section of the
spectrum affects the resulting c(k) and its Fourier transform.

As an additional feature, every data reductions step in WinXAS can be
recorded in a macro.
A complete XAS analysis, containing background correction, m0 fitting,
Fourier transform and XAS
refinement can basically be carried out by hitting one single button.
After recording, these macros
can be applied conveniently to a large number of spectra. Although one
certainly has to be careful
with this sort of automated analysis, it may be a fast and handy way
for many opportunities, for
instance, a preliminary data analysis at the beamline.

WinXAS contains a simple interface to the
ab-initio multiple scattering XAS code FEFF by J. Rehr
(Rehr et al., 1992). In the recent past, FEFF has proven to be a
reliable and user-friendly theoretical
XAS code. Nevertheless, owing to its independence on a particular
operating system, FEFF lacks
any graphical visualization of its input or output data. Although
powerful numerical tools in addition
to FEFF are available (Stern et al., 1995), they basically suffer from
the same conditions.
Since calculation speed on modern PCs became competitive to larger
systems, many users
may intend to run FEFF calculations on their desktop PC. For these
users, WinXAS is meant to fill
the gap of a suitable visualization program. Running FEFF on a PC
normally involves setting up the
proper input files in an editor, executing FEFF and afterwards changing
to a graphic program in
order to display the calculated XAS function. With WinXAS, these steps
can be carried out
conveniently in one program’s environment. After FEFF or ATOMS input
files have been set up in
a WinXAS edit window, the programs can be launched directly from WinXAS
and after the
calculation is completed, the resulting c(k) is loaded and displayed
instantaneously for further
analysis or comparison with experimental data.

Furthermore, FEFF generated theoretical phases and amplitudes can be
used in order to
perform a XAS analysis. WinXAS allows to choose all necessary paths
from the FEFF output file
„FILES.DAT“ which contains the names of all single output files that
belong to the scattering paths
included into the calculation. The selected FEFF phases and amplitudes
can be employed in a
multiple-shell XAS simulations or refinements in both k-space and
R-space. Moreover, single XAS
function parameters can be changed interactively prior to a refinement.
A corresponding dialog box
allows to change each XAS parameter stepwise, while after each step the
effect on the theoretical
c(k) is displayed immediately. This procedure is also very much suited
as an educational tool in order
to visualize the dependence of the overall shape of a XAS c(k) on the
various parameters.
Additionally, WinXAS supports RasMol, a simple but powerful molecular
structure viewing
program (Sayle, 1995). FEFF input files are converted into three-column
x,y,z-files that can be read
from RasMol and the molecule or cluster for which a theoretical XAS
function shall be calculated
can be displayed in colors, rotated, and printed. The combination of
WinXAS and RasMol does not
only make a convenient tool, it can also help novice users to
understand the concept of nearest
neighbor shells, of different coordination geometry and distortions,
and of linear multiple scattering
paths for which a particularly strong contribution to the clusters XAS
function can be expected.

The analysis of XAS data measured in an
energy-dispersive mode (Hagelstein et al., 1989) requires
some additional reduction steps compared to conventional XAS data
analysis. In contrast to a
standard double crystal monochromator, where the energy range is
scanned stepwise by changing
the Bragg angle of both crystals, the dispersive spectrometer applies a
bent monochromator crystal.
The absorption signal is then recorded on a position sensitive detector.

The major difference between conventional and energy-dispersive XAS
data reduction lies in
the energy calibration of the measured absorption spectra. In order to
calibrate dispersive XAS
spectra, a polynomial has to be calculated representing the
energy-position correlation on the
detector and converting the measured absorption spectra to photon
energy. With WinXAS, the
polynomial coefficients can be determined from a automated comparison
of the measured metal foil
with a calibrated metal foil spectrum obtained at a standard XAS
beamline. If DXAS data and the
reference metal foil spectrum are available in a comparable quality,
this procedure usually results in a
satisfactory energy calibration of the dispersive data. A more detailed
description on using WinXAS
for energy-dispersive XAS analysis can be found in (Ressler, 1995,
1997). Although WinXAS was
intentionally written for the DXAS beamline at Hasylab, Hamburg, its
functions are generalized
enough in order to be used at any other DXAS station. Experimental data
either can be used as
measured or can easily be converted into a binary WinXAS format.

The analysis of XAS data obtained from
time-resolved experiments can become a time consuming
and tedious task due to the large number of consecutive absorption
spectra. Standard XAS
beamlines equipped with fast scanning options (Quick-EXAFS) or
energy-dispersive XAS beamlines
provide time resolution in the sub-second range and the number of
spectra measured during one
single time-resolved experiment can amount to several hundred. Such
investigations demand data
reduction software prepared to cope with large data sets.

WinXAS offers several features in order to treat the large amount of
data obtained from
time-resolved experiments. Considering the number of spectra from a
single run, a data reduction of
each spectrum by hand appears to be highly inefficient. Since many
analysis steps have to be carried
out similarly for each spectrum, efficient data treatment requires a
possibility to apply a sequence of
analysis steps in a serial procedure. WinXAS can record single data
reduction steps into a macro and
use this macro in order to analyze each individual spectrum out of a
large data set. All numerical and
XAS algorithms contained in WinXAS can be used this way. Additionally,
several spectra can be
averaged in order to improve data quality. Moreover, a serial data
treatment can be performed at an
early stage of a time-resolved experiment investigation. Despite the
fact that WinXAS aims at time-
resolved XAS investigations, it can be employed in a variety of
experiments that produce a large
number of consecutive spectra or patterns that require a serial
treatment.

WinXAS is a new XAS data analysis program for
PCs running MS-Windows 95 or later. The most
important feature of WinXAS is its graphical user interface where all
functions and procedures can
be selected using either a pointing device or single keyboard function
keys. WinXAS allows up to
four data files to be processed at a time and results can be
superimposed and compared
conveniently. Furthermore, WinXAS represents an excellent educational
tool due to its immediate
graphical response on changes in, for instance, XAS fit parameters, k
weighting, number of nodes
for cubic spline fits, and much more. Thus, WinXAS can help to gain
insight into the interaction of
atomic distances, disorder parameters, or number of shells, and their
influence on the XAFS
function c(k).

WinXAS contains all necessary numerical algorithms and procedures for
standard XAS data
analysis. Moreover, many additional techniques that exceed standard
data reduction can be carried
out, such as difference file technique, experimental XANES linear
combination fits, XANES profile
fitting, use of FEFF theoretical phases and amplitudes for XAS
refinement. Nevertheless, WinXAS
is meant to complement rather than substitute more advanced XAS data
analysis programs and may
not be adequate in all cases (for instance, full multiple scattering
treatment using ab-initio theoretical
phases and amplitudes requires additional XAS analysis codes).

Certainly an advantage of WinXAS is, that it can be employed at a very
early stage of every
XAS experiments. In many cases beamtime can be used much more
efficiently if a preliminary data
analysis is carried out on-line. Owing to its open and flexible data
file structure, WinXAS can read a
variety of different multiple column files without previous conversion.

Besides its numerical and standard XAS features, WinXAS contains
several routines for the
analysis of energy dispersive XAS data. Furthermore, WinXAS macro can
be employed in a serial
treatment to a large number of consecutive spectra. These data may be
obtained from time-resolved
experiments at either energy dispersive or quick scanning XAS
beamlines. Such experiment like
standard XAS studies benefit from WinXAS in terms of speed, efficiency
and convenience.

Engeln-Müllges, G. & Uhlig, F. (1996)
Numerical Algorithms with C, Springer, Berlin
Hagelstein, M., Cunis, S., Frahm, R, Niemann, W. & Rabe, P (1989).
Physica B 158, 324
Koningsberger, D. C. & Prins, R. (1988) X-ray Absorption
Spectroscopy, Chemical Analysis 92,
Wiley, New York

Press, W. H., Flannery, B. P., Teukolsky, S. A. & Vetterling, W. T.
(1989). Numerical Recipes in C,
Cambridge University Press

Rehr, J. J., Albers, R. C. & Zabinsky, S.I. (1992). Phys. Rev.
Lett. 69, 3397

Ressler, T. (1995). Ph.D. Thesis, University of Hamburg, Germany

Ressler, T. (1997). J. Physique, in press

Sayle, R. (1995), RasMol v2.6-ucb is based on RasMol v2.6,
Copyright© 1995, 1996 Roger Sayle,
available at ‘http://mc2.cchem.berkeley.edu/Rasmol’ (Enhanced by the
MultiCHEM Facility, University of
California, Berkeley).

Stern, E.A., Newville, M., Ravel, B., Yacoby, Y. & Haskel, D.
(1995). Physica B 208&209, 117

Teo, B. K. (1986). EXAFS : Basic Principles and Data Analysis,
Springer, New York

Vaarkamp, M., Modica, F. S., Miller, J. T. & Koningsberger, D. C.
(1993). J. Catal. 144, 611

Vaarkamp, M., Dring, I., Oldman, R. J., Stern, E. A. &
Koningsberger, D. C. (1994). Phys. Rev. B
50, 7872

Figure 1. ‘Screen-shot’ of the WinXAS program
for XAS data analysis showing the user
interface as well as four graphic windows containing examples for
WinXAS analysis capabilities.

Window I: ‘Quick-XAS’ data analysis of an as-measured absorption
spectrum (A). The ‘Quick-XAS’
option represents an automated data reduction procedure. Experimental
spectra can be analysed on-
line by pressing one single button on the WinXAS interface. The
algorithm yields the normalised
and background corrected spectrum (B), the extracted XAS function c(k)
(C) and the Fourier
transformed c(k) (D).

Window II: Least-squares XANES fit. The experimental XANES (dotted) can
be simulated by a
linear combination of four reference compounds (a (0.1), b (0.21), c
(0.23), and d (0.46));

Window III: 3D plot of diffraction data from a time-resolved
experiment. In a subsequent analysis,
WinXAS’s macro capabilities can be used to determine peak shifts and
intensity variation with time;

Window IV: Two shell XAS refinement in R-space using FEFF theoretical
phases and amplitudes.
The plot shows FT magnitude and imaginary part for experimental
(dotted) and theoretical (solid)
curve as well as the magnitude for both single shells.