Background Subtraction (Autobk / Spline / Athena / SixPACK) ?
Contents

Background Subtraction (Autobk / Spline / Athena / SixPACK) ?
 How does pre_edge() normalize XAFS data?
 How can I use tabulated values of mu(E) to normalize XAFS data?
 What are reasonable values for kmin, kmax, kweight, and rbkg in spline()?
 When is E0 changed by spline()?
 The background function 'swoops up' at the end points. What can be done about this?
 How do Ifeffit and Athena determine E0?
 How do I calibrate the energy of my data?
 Shelly Kelly's background removal procedure
 How do I add a new FAQ entry?
How does pre_edge() normalize XAFS data?
The pre_edge() command (and Athena, which uses this command) fits a line to the preedge region (over a region defined by the parameters pre1 and pre2, relative to E0), and a quadratic function to the postedge region of the data (over a region defined by the parameters norm1 and norm2, relative to E0). Both of these curves are then extended to E0, and the difference of these two curves at E0 gives the edge step.
When the spline() command is run, it updates the value of edge step by using the background function (not the original mu(E) data) for the postedge fit. Though this does not usually change the edge step by much, it is somewhat more stable.
How can I use tabulated values of mu(E) to normalize XAFS data?
The bkg_cl() command uses the data in the CromerLibermann tables to do preedge subtraction, normalization. and simple backgroundsubtraction of XAFS data.
read_data(file = ../data/cu.xmu, prefix = dat, type = xmu) bkg_cl(energy=dat.energy, xmu = dat.xmu, z=29) newplot (dat.energy, dat.norm) plot (dat.energy, dat.f2norm)
The array dat.f2norm will be the scaled set of values for the background function.
What are reasonable values for kmin, kmax, kweight, and rbkg in spline()?
For spline() and for Autobk, Matt's recommendations are:
kmin 
0 
kmax 
0 (which will use the full data range) 
kweight 
1 
dk 
0 
rbkg 
1. (or half nearneighbor distance) 
All of these numbers can be set as preferences in Athena. The Preferences dialog is under the Settings menu. Look in the bkg branch of the preferences tree.
When is E0 changed by spline()?
E0 is changed by spline() if one of the following conditions is met:
 E0 (that is, the variable e0) is not already set.
 E0 (that is, the variable e0) is out of range of the data sent to spline().
The keyword finde0 is given to spline()
A standard chi(k) is given to spline(), and finde0=false is not set, and e0 is not explicitly set.
Basically, this translates to:
E0 will be found if it is not already set, and it will be adjusted if a standard chi(k) is given.
Note that Athena never floats E0 and currently does not provide an option to do so.
The background function 'swoops up' at the end points. What can be done about this?
You can use clamps for the background removal. These add extra 'weight' to the difference between mu(E) and mu_0(E) at the endpoints (either lowk or highk or both). For example,
spline(energy= my.energy, xmu= my.xmu, rbkg=1.0,clamp2=1.0)
will add some extra weight to the fit from the highk endpoint.
spline(energy= my.energy, xmu= my.xmu, rbkg=1.0, clamp2=10.0)
will add more weight. You can effectively force chi(k) = 0 at k=kmax by setting clamp2 to 1000. Similarly,
spline(energy= my.energy, xmu= my.xmu, rbkg=1.0, clamp1=1.0)
will 'encourage' chi(k) toward 0 at k=kmin.
In Athena the control over the clamp values is somewhat less fine grained. Each clamp has six possibilities:
Athena Setting 
value of clamp 
none 
0 
slight 
3 
weak 
6 
medium 
12 
strong 
24 
rigid 
96 
The values can be configured in Athena. In preferences dialog (see the Settings menu), go to the Clamp branch to adjust the numerical values associated with slight ... rigid.
How do Ifeffit and Athena determine E0?
See Bruce's Post.
Various menus in Athena provide a number of options ofr setting E0. The default is to use the value that Ifeffits pre_edge() function finds. That is a value close to the first big peak in the first derivative. The other available options are to set it to the point at a fraction of the edge step (the fraction is configurable in the preferences dialog), to set it to the zero crossing of the second derivative (this starts from Ifeffit's default then finds the zero crossing nearest to that point), or to set it to the tabulated atomic value. The fraction option is a popular tool for measuring energy shifts in XANES spectra. The zerocrossing option easy to explain and reproduce, but may be flaky for noisy data.
How do I calibrate the energy of my data?
See Shelly's Post.
Shelly Kelly's background removal procedure
This procedure was suggested by Shelly (see also This Post).
I have found a procedure for removing the background that "almost" always works well. It goes something like this and uses different kweightings in the background removal process.
 Check out the curvature of the XANES region and how quickly the data goes from zero to 1, call this DExanes. There are in my small opinion two categories for each of these different parameters. Curvature of Xanes can be step like or it can have a large peak. DExanes can be small ~10eV for kedges of Cu or wide ~30eV for L3edge of U.
 Choosing Ezero for the first time: If you have a wide DExanes, then choose Ezero up near the top of the edge. If you have a small DExanes, then choose Ezero around the middle of the edge. Set kweight equal to one or zero (and no theory) and remove the background. This will emphasize the low kregion around the edge, but often get the background for the higher kregion not as well...especially for noisy data.
 Check out the shape of the background function, the chi(k) data and the FT. Make sure that rbkg=1.0 is a reasonable thing to do. Make sure that you look at the chik data with all three kweights. Often people say that there is no change in the chik data by changing the kwieght but they are looking at the chik*k3. The change will be greatest at low k, which you don't really see with chik*k3.
 If you have a large peak in the XANES region, Athena may need help getting the bkg to go through that peak. You have two options:
 increase rbkg so that the spline has more freedom to curve in this region.
 increase kmin of the spline range, essentially removing the large peak from the data
Fit the first shell of your data, use a well padded chik data range...don't include at least one full oscillation at the beginning. i.e. use kmin=3 or greater. Monitor the value for ezero. If it is greater than 10eV you need to start over. (I have some more details on how to create a theory to be used for bkg removal on my web site my web site from the 2004 NSLS EXAFS workshop presentation)
 Read the theory back into Athena. Now Athena knows what the low krange should look like, and you can increase the kweight of the background, use kw=2 or 3, to get the high krange part of the data correct as well.
 Fit the data again and use as much of the krange as possible.
How do I add a new FAQ entry?
Edit this section, use copy and paste! Use a format like this, using the same level of header (i.e. the same number of = signs) and keeping the link back to the contents at the top of the page:
== How do I add a new FAQ entry? == Edit this section, use copy and paste! [#contents Contents] 