Вы находитесь на странице: 1из 157

ATHENA Users Guide

Bruce Ravel
bravel@bnl.gov http://cars9.uchicago.edu/~ravel/software/exafs/

Document version 1.5 for athena version 0.8.56 July 1, 2009

Just as Phaeacian men excel the world at sailing, driving their swift ships on the open seas, so the women excel at all the arts of weaving. That is Athenas gift to them beyond all others a genius for lovely work, and a ne mind too. Homer, The Odyssey, Book 7

athena is copyright c 20012008 Bruce Ravel This document is copyright c 20072008 Bruce Ravel.

This work is licensed under the Creative Commons Attribution-ShareAlike License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/ or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. You are free: to Share to copy, distribute, and transmit the work to Remix to adapt the work Under the following conditions: Attribution. You must attribute the work in the manner specied by the author or licensor (but not in any way that suggests that they endorse you or your use of the work). Share Alike. If you alter, transform, or build upon this work, you may distribute the resulting work only under the same, similar or a compatible license. Any of these conditions can be waived if you get permission from the author.

For any reuse or distribution, you must make clear to others the license terms of this work. Any of the above conditions can be waived if you get permission from the copyright holder. Nothing in this license impairs or restricts the authors moral rights.

Your fair dealing and other rights are in no way aected by the above. This is a human-readable summary of the Legal Code (the full license).

This work is licensed under the Creative Commons Attribution-ShareAlike License.

Contents
1 Forward 1.1 Layout and typesetting conventions . 1.2 Acknowledgements . . . . . . . . . . 1.3 Data citations . . . . . . . . . . . . . 1.4 Installing Athena on your computer 1.5 Building this document from source 7 7 8 9 9 10

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

2 Introduction to Athena 13 2.1 First Look at ATHENA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 2.2 Getting help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 3 Data import 3.1 Column selection dialog . . . . . . . . . . 3.1.1 Data types and energy units . . . 3.1.2 Multi-element detector data . . . . 3.2 Project selection dialog . . . . . . . . . . 3.3 Multiple data set import . . . . . . . . . . 3.4 Reference channel . . . . . . . . . . . . . . 3.5 Preprocessing data . . . . . . . . . . . . . 3.5.1 Rebinning quick scan data . . . . . 3.5.2 Other pre-processing chores . . . . 3.6 File type plugins . . . . . . . . . . . . . . 3.6.1 Overview of how plugins work . . . 3.6.2 Example plugin . . . . . . . . . . . 3.6.3 Namespace . . . . . . . . . . . . . 3.6.4 Required methods and variables . 3.6.5 Athenas plugin registry . . . . . . 3.6.6 Reformatting and data processing 3.6.7 System plugins and user plugins . 3.6.8 Miscellaneous advice on plugins . . 17 19 19 21 23 24 25 26 27 27 29 29 30 31 31 32 33 33 33 35 35 36 37 39 39 41 41 43

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

4 Normalization and the AUTOBK Algorithm 4.1 Normalization . . . . . . . . . . . . . . . . . . . . 4.1.1 The normalization algorithm . . . . . . . 4.1.2 The attening algorithm . . . . . . . . . . 4.1.3 Getting the post-edge right . . . . . . . . 4.1.4 Getting the pre-edge right . . . . . . . . . 4.1.5 Measuring and normalizing XANES data 4.2 Understanding Fourier transforms . . . . . . . . 4.3 The Autobk Algorithm and the Rbkg Parameter 5

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

CONTENTS 4.4 Spline 4.4.1 4.4.2 4.4.3 Spline clamps and k-weight in background removal . . . . . Spline clamps . . . . . . . . . . . . . . . . . . . . . . The eect of k-weight on background removal . . . . The interaction between spline clamps and k-weight range in background removal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 47 48 49 50 51 52 52 53 53 53 53 54 54 55 56 56 57 57 57 57 58 61 62 62 62 62 65 66 66 67 68 70 70 71 72 73 75 75 75 76 77 77 78 79

4.5

5 Plotting Your Data in ATHENA 5.1 Plotting space tabs . . . . . . . . . . . . . . . . . . 5.1.1 Plotting in energy . . . . . . . . . . . . . . 5.1.2 Plotting in k-space . . . . . . . . . . . . . . 5.1.3 Plotting in R-space . . . . . . . . . . . . . . 5.1.4 Plotting in q-space . . . . . . . . . . . . . . 5.2 Spectral resolution and k-range . . . . . . . . . . . 5.3 Stacked plots . . . . . . . . . . . . . . . . . . . . . 5.4 Indicators . . . . . . . . . . . . . . . . . . . . . . . 5.5 The point nder . . . . . . . . . . . . . . . . . . . 5.6 Group specic plot parameters . . . . . . . . . . . 5.7 Other plotting features . . . . . . . . . . . . . . . . 5.7.1 Zooming . . . . . . . . . . . . . . . . . . . . 5.7.2 Cursor . . . . . . . . . . . . . . . . . . . . . 5.7.3 Plotting I0 . . . . . . . . . . . . . . . . . . 5.7.4 Merged groups and the standard deviation 5.7.5 The collapse button . . . . . . . . . . . . . 6 Athenas User Interface 6.1 Using the group list . . . . . . . . . . . . . . . . 6.1.1 Copying groups . . . . . . . . . . . . . . . 6.1.2 Reorganizing the group list . . . . . . . . 6.1.3 Information about items in the group list 6.1.4 Using the mouse in the group list . . . . . 6.1.5 Detector groups and background groups . 6.2 Marking groups . . . . . . . . . . . . . . . . . . . 6.2.1 Using regular expressions to mark groups 6.3 Pluck buttons . . . . . . . . . . . . . . . . . . . . 6.4 Plot styles . . . . . . . . . . . . . . . . . . . . . . 6.5 Using dierent k-weights . . . . . . . . . . . . . . 6.6 Frozen groups . . . . . . . . . . . . . . . . . . . . 6.7 Palettes . . . . . . . . . . . . . . . . . . . . . . . 6.8 Setting user preferences . . . . . . . . . . . . . . 7 Setting parameters in Athena 7.1 Constraining parameters between data groups 7.1.1 Constraining individual parameters . . 7.1.2 Constraining groups of parameters . . 7.1.3 Constraining all parameters . . . . . . 7.2 Setting E0 . . . . . . . . . . . . . . . . . . . . 7.2.1 Other ways of setting e0 . . . . . . . . 7.3 Default parameter values . . . . . . . . . . . 6

. . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

This work is licensed under the Creative Commons Attribution-ShareAlike License.

CONTENTS 8 Data export 8.1 Column output les . 8.2 Project les . . . . . . 8.2.1 The project le 8.3 Parameter report les 81 81 85 86 87 89 90 90 93 93 94 96 98 100 101 101 103 103 105 107 107 108 108 110 113 113 114 115 116 117 117 117 119 120 122 123 127 127 134 134 135 135 138 138 139 140 142 142 143 7

. . . . . . . . format . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . and compatibility with older versions . . . . . . . . . . . . . . . . . . . . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

9 Data processing 9.1 Calibrating data groups . . . . . . . . . . . . . . 9.2 Aligning data groups . . . . . . . . . . . . . . . . 9.3 Dispersive XAS . . . . . . . . . . . . . . . . . . . 9.3.1 The dispersive data processing algorithm 9.3.2 Using the dispersive data correction . . . 9.4 Deglitching data . . . . . . . . . . . . . . . . . . 9.5 Truncating Data . . . . . . . . . . . . . . . . . . 9.6 Rebinning data groups . . . . . . . . . . . . . . . 9.7 Smoothing data . . . . . . . . . . . . . . . . . . . 9.8 Convoluting data groups . . . . . . . . . . . . . . 9.9 Deconvoluting data groups . . . . . . . . . . . . . 9.10 Self-absorption approximations . . . . . . . . . . 9.10.1 Correcting XANES data . . . . . . . . . . 9.10.2 Correcting EXAFS data . . . . . . . . . . 9.10.3 Information depth . . . . . . . . . . . . . 9.10.4 Algorithm references . . . . . . . . . . . . 9.11 Removing multi-electron excitations . . . . . . . 9.12 Merging data groups . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

10 Data analysis in Athena 10.1 Linear combination tting . . . . . . . . . . . . . . . . . . . . . . . . . 10.1.1 Fitting a single data group . . . . . . . . . . . . . . . . . . . . 10.1.2 Constraints and modications to the t . . . . . . . . . . . . . 10.1.3 Fitting, statistics, reports . . . . . . . . . . . . . . . . . . . . . 10.1.4 Constraining linear combination t parameters between groups 10.1.5 Batch processing . . . . . . . . . . . . . . . . . . . . . . . . . . 10.1.6 Combinatorial tting using many standards . . . . . . . . . . . 10.2 Peak tting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.3 Log-ratio/phase-dierence analysis . . . . . . . . . . . . . . . . . . . . 10.4 Principle component analysis . . . . . . . . . . . . . . . . . . . . . . . 10.5 Dierence spectra . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 Worked examples 11.1 Basic data processing . . . . . . . . . . . . . . . . . . 11.2 A hard background removal problem . . . . . . . . . . 11.2.1 Getting started . . . . . . . . . . . . . . . . . . 11.2.2 Examine the theory . . . . . . . . . . . . . . . 11.2.3 A simple t to the rst coordination shell . . . 11.2.4 Using the t as a background removal standard 11.2.5 Understanding . . . . . . . . . . . . . . . . . . 11.3 Linear combination analysis . . . . . . . . . . . . . . . 11.3.1 Examining the data . . . . . . . . . . . . . . . 11.3.2 Improving the t . . . . . . . . . . . . . . . . . 11.3.3 Understanding the t . . . . . . . . . . . . . . 11.3.4 Combinatorial analysis . . . . . . . . . . . . . .
This work is licensed under the Creative Commons Attribution-ShareAlike License.

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

CONTENTS 11.3.5 Analyzing the data series . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145 12 Hephaestus 12.1 Description . . . . . . . . . . . . . 12.2 Periodic Table of Absorption Data 12.3 Absorption Lengths of Compounds 12.4 Periodic Table of Chemical Data . 12.5 Absorption of Ion Chambers . . . . 12.6 Emission Line Transitions . . . . . 12.7 Edge and Line Finders . . . . . . . 12.8 Complex Scattering Factors for the 12.9 Initialization le . . . . . . . . . . 12.10Keyboard shortcuts . . . . . . . . . 12.11Bugs and Missing Features . . . . 12.12Credits . . . . . . . . . . . . . . . . 147 147 148 148 150 150 152 152 153 153 154 154 155

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Elements . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

This work is licensed under the Creative Commons Attribution-ShareAlike License.

Chapter 1

Forward
The best way to learn how to use athena is to use athena. Poke at the buttons, poke at the menus, try things just to see what happens. And above all, remember the physical and mathematical meanings of your data and of the data analysis techniques and think about how actions in athena relate to those meanings. athena is a powerful and versatile program capable of supporting almost all of your common (and not-so-common) XAS data processing chores. It is not, however, a particularly intuitive program. I doubt that any XAS program could be intuitive. On top of that, athena has accumulated lots of features over the years. Many of these features are necessary for high-quality data processing, others are bells and whistles intended to make data processing more convenient or more fun. This document attempts to be a comprehensive overview of all of athenas features. There are lots of words, but also lots of pictures. Feel free to jump around and to focus on the parts most directly relevant to your immediate needs. I hope you nd this document and the program helpful.

1.1

Layout and typesetting conventions

Here is a summary of fonts, colors, and symbols used to denote dierent kinds of text. Note that some of these may appear the same in certain presentation media. Filenames look C:like\this. The names of parameters for data processing look like this . Emphasized text looks like this. Bold text looks like this. Links to web sites look like this. Internal links look like this (Sec. 1.1). Keyboard shortcuts look like this: Ctrl - q . This example means to hit the q key while holding the Control (or Ctrl) key. Program names from the ifeffit family look like this: athena. References to athenas preferences are written like this: Bkg fraction. To modify this preferences, open the bkg section of the preferences dialog (Sec. 6.8 on page 73) and then click on fraction.

Points that require special attention are written inside of attention-grabbing boxes.
9

1.2. ACKNOWLEDGEMENTS

This symbol indicates a section describing one of athenas features that I consider especially powerful and central to the eective use of the program. This symbol indicates a section with dicult information that newcomers to athena might pass over on their rst reading of this document. The html version of this document makes use of HTML 4.1 character entities (mostly Greek symbols) and will not display correctly in very old browsers. POD the native documentation for Perl and the format used internally in athena is not able to display graphics. Everywhere that a graphics le is displayed in the other document formats, a bit of text showing the name of the image le and the caption of the gure is displayed in the POD. Here is what it looks like when one of the pod documents is displayed by a pod viewer:
(Image file: athena_main.png) The parts of the ATHENA.

In most cases, this will convey sucient information given that you will have athena open in front of you. If you need to see the picture, you can seek out the image le by name or look at the corresponding part of the html or PDF versions of the document.

1.2

Acknowledgements

I have to thank Matt Newville, of course. Without ifeffit there wouldnt be an athena. One afternoon over coee, Julie Cross and Shelly Kelly lit the spark that eventually lead to this document. Some content of this document was inspired by an upcoming XAS review article by Shelly Kelly and Dean Hesterberg, which I have had the pleasure of editing (and, apparently, swiping from). I have a huge debt of gratitude to all the folks on the ifeffit mailing list. Without the incredible support and wonderful feedback that Ive received in the last six years athena would be a shadow of what it is today. The following great software tools were used to create this document: The Template Toolkit, a really fun, really powerful templating system that was used to create this entire document The Perl programming language and Syntax::Highlight::Perl from the CPAN repository The Emacs and XEmacs text editors along with tt-mode and the simply wonderful Emacs Code Browser The GIMP image editor with frequent use of the Xach eect shadowing plugin Various tools from the KDE desktop, including KColorChooser and KSnapshot All screenshots were made of athena or the PGPLOT window on my KDE desktop, mostly using some version of the Orangio theme for deKorator. The screenshots of spreadsheets made from a report le (Sec. 8.7 on page 88) and an LCF t report (Sec. 11.22 on page 145) are displayed in OpenOce. The images of the Tholos temple on the front page and the Klimt painting Pallas Athena in the navigation box of the html document are from http://www.artchive.com. The image used as the athena program icon is from Heracles and Athena. Tondo of an Attic red-gure kylix, 480-470 BC, from Vulci from the Staatliche Antikensammlungen in Munich, Germany. The image is in the public domain and was found on Wikimedia Commons. The image used as the hephaestus program icon is from Reubens Vulcan forging Jupiters thunderbolts from the Museo Del Prado, Madrid Spain. This image is also in the public domain and also from Wikimedia Commons. 10
This work is licensed under the Creative Commons Attribution-ShareAlike License.

CHAPTER 1. FORWARD

1.3

Data citations

The copper foil data shown here and there are the data that Matt Newville, Yanjun Zhang, and I measured one day back in 1992 that has, inscrutably, become the copper foil data shown and referenced in a large fraction of the XAS theory literature. The platinum catalyst data shown in the dierence spectrum section (Sec. 10.5 on page 123) and MoO3 data shown in the worked examples section (Sec. 11.2 on page 134) were donated by Simon Bare. The MoO3 worked example (Sec. 11.2 on page 134) was based on a tutorial written by Shelly Kelly. The gold edge data shown in many places throughout this document are taken from measurements published as M. Lengke, et al., Environ. Sci. Tech., 40:20, (2006) p. 6304-6309. The gold oxide data shown in the smoothing section (Sec. 9.7 on page 101) were donated by Norbert Weiher. The iron foil data shown in the convolution section (Sec. 9.8 on page 101) and elsewhere were measured by me while I was commissioning NSLS beamline X11B in 2004. The sulphate data shown in the self-absorption section (Sec. 9.10 on page 103) were donated by Zhang Ghong and come with Daniel Haskels Fluo program. The copper data shown in the same section (Sec. 9.10 on page 103) come with Corwin Booths RSXAP program. The data in the dispersive XAS section (Sec. 9.3 on page 93) were provided by Giuliana Aquilanti, beamline scientist at ESRFs ID-24. Data on a hydrated uranyl phosphate that appear in several places are the U LIII standard used by my former research group. Spectra from this standard have appeared in many publications from that group. The U3 O8 sample shown in the the deglitching section (Sec. 9.4 on page 96) are from the groups standards library. Tin edge data which appear in several places are from C. Impellitteri, O. Evans, B. Ravel, J. Environ. Monit., 4, (2007) p. 358-365. Data on PbTiO3 , BaTiO3 , and EuTiO3 are taken from my own PhD thesis.

1.4

Installing Athena on your computer

Linux, BSD, and other unixes It is not especially hard to build athena from source code. The procedure is explained in detail on this web page: http://cars9.uchicago.edu/iwiki/BruceRavel/EvolvingSoftware. Debian and debian-based Linux Add the repositories listed on this page: http://wiki.mr.aps.anl.gov/ObtainingSoftware. This can be done either by editing /etc/apt/sources.list directly or by adding repositories using the system package manager (e.g. Adept on ubuntu). Once these are included as repositories, the horae package, which contains athena, can be installed. Windows An MSI installer package is available at http://cars9.uchicago.edu/iwiki/Downloads. Installation is very simple. Just double click on the installer and follow the instructions. If you are installing onto a machine for which you do not have administrator privileges, you should choose a part of the disk that belongs to you when asked about the installation location. For those with ActiveState Perl installed on their windows machines, the horae source code can be installed using the Perl Package Manager. In the Perl Package Manager, select Preferences from the Edit menu, then click on the repositories tab. Add http://cars9.uchicago.edu/ ravel/ppm/ as a new repository. The horae package should now show up as an installable package.
This work is licensed under the Creative Commons Attribution-ShareAlike License.

11

1.5. BUILDING THIS DOCUMENT FROM SOURCE Macintosh An installer package is available at http://cars9.uchicago.edu/iwiki/Downloads. Installation is very simple. Just double click on the installer and follow the instructions.

1.5

Building this document from source

Obtaining the document source The source les and all images les for this document can be downloaded by SVN. To grab the source, you will need an SVN client on your computer. This command checks a copy of the source out and downloads it onto your computer:
svn co http://cars9.uchicago.edu/svn/aug/

This document is written using The Template Toolkit. It requires the perl interpreter and a fairly complete installation of version 2 of The Template Toolkit to build. If TT2 is not available as a package for your system (it is available as a pre-compiled package for many versions of Linux; a ppm le for ActivePerl on Windows exists; a Fink package for OSX exists) it can be downloaded from its website and installed by hand or downloaded using perls CPAN utility. You will also need to install the Image::Size, and SynA tax::Highlight::Perl modules. Compiling the L TEX version of the document will require a fairly complete A L TEX installation as I make use of many styles, including amsmath, amsfonts, oatt, fancybox, fancyhdr, keystroke, varioref, and hyperref. (teTeX compiles the document without any problem. The texlive package may complain about not being able to generate two postscript font sets. Those two warning can be safely ignored by simply hitting when pdatex pauses to complain. As far as I can tell, ignoring this problem has no impact on the document. I have no experience building the PDF document on any system other than linux.) Once TT2 and the other modules are installed, building the document should be quite simple. TT2s ttree program is used to recurse the through the directory structure containing the templates. The bin/build, bin/tex, and bin/pod scripts are wrappers around ttree. They invokes a number of important command line options and pass any further command line options to ttree. TT2 was chosen for this project because it is an excellent templating tool. A templating tool was chosen because the strong separation of format and content was attractive to me. The template source is used to generate html and PDF versions of the document as well as the pod format used by athenas internal document viewer. Contributions to the document are extremely welcome. The very best sort of contribution would be to directly edit the source templates and commit your changes to the SVN repository. The second best sort would be a patch le against the templates in the repository. If TT2 is more than you want to deal with, but you have corrections to suggest, Id cheerfully accept almost any other format for the contribution. (Although I have to discourage using an html editing tool like FrontPage to edit the html directly. Tools like that tend to insert lots of additional html tags into the text, making it more dicult for me to incorporate your changes into the source.) Building the html document After downloading and unpacking the source for this document, you must congure it to build correctly on your computer. This is simple:
./configure

To build the entire document as html


./bin/build -a

12

This work is licensed under the Creative Commons Attribution-ShareAlike License.

CHAPTER 1. FORWARD Individual pages can be built by specifying them on the command line:
./bin/build bkg/norm.tt forward.tt

Building the LaTeX document A The L TEX document is built by


./bin/tex -a cd tex/ pdflatex athena.ltx pdflatex athena.ltx

You need to run pdflatex two or three times to get all of the section numbering and cross referencing correct. The varioref package, used to handle cross-referencing, is sometimes a little fragile. If you see the following error message: simply hit return. The message should disappear when you recompile the document.
! Package varioref Error: vref at page boundary 142-143 (may loop).

A version of the PDF document suitable for printing on a grayscale (i.e. without color) printer can be made using this sequence of commands:
cd images/ ./images/convert_to_gray cd ../ ./bin/texbw -a cd texbw/ pdflatex athena.ltx pdflatex athena.ltx

This rst bit converts all of the images used in the document to grayscale using ImageMagick. The A texbw version of the document is nearly identical to the normal L TEX document, except that the style le and several templates are changed to remove all color from the document. Compiling the version in the texbw/ directory results in a PDF le that is suitable for a non-color printer. This output target was created for the 2008 APS summer school. The cost saving of printing the athena document in black-and-white rather than color for each of the students was quite signicant. Building the pod document The pod document, athenas internal document format, is built by
./bin/pod -a

Individual pages can be built by specifying them on the command line:


./bin/pod bkg/norm.tt forward.tt

Using the document with Athena The pod and html document les can be used by athena, but they must be installed in the correct location. To do this, run the install script that comes with the document package. This will use an athena module to determine the correct location, then copy over all relevant les. Once installed athena will display the html document in either a web browser or a pod viewer depending on the values of the Doc prefer and Doc browser preferences.

This work is licensed under the Creative Commons Attribution-ShareAlike License.

13

1.5. BUILDING THIS DOCUMENT FROM SOURCE

14

This work is licensed under the Creative Commons Attribution-ShareAlike License.

Chapter 2

Introduction to Athena
athena is an interactive graphical utility for processing EXAFS data. It handles most of the common data handling chores of interest at the beamline or for preparing your data to begin analysis. athena is a graphical front end to Matt Newvilles ifeffit library written entirely in the Perl programming language and using the PGPLOT graphical library for data display. It is being developed on Linux and tested on Windows XP, but should work on any unix-like, Windows, or Mac operating system. athena is designed to provide high quality analysis with a highly usable interface. It allows very ne grained control over the processing and plotting of individual data sets while still enabling the processing and plotting of large quantities of data. Among athenas many, many features, you will nd: Convert raw data to (E ) File import plugins for reading arbitrary data les Process and plot multiple data les simultaneously Merge data in energy, k-, R-, or back-transform k-space Energy calibration Align data scans with or without a reference channel Deglitch (E ) data Self-absorption corrections for uorescence spectra Compute dierence spectra Fit linear combinations of standards to XANES or EXAFS data Fit peak functions to XANES data Log-ratio/phase-dierence analysis Background removal using the AUTOBK algorithm Normalization of XANES data to the Cromer-Liberman calculations Forward and backward Fourier transforms Save data as (E ), normalized (E ), (k ), (R), or back-transformed (k ) Save project les, allowing you to return to your analysis later ... and much, much more!

2.1

First Look at ATHENA

When athena rst starts, something like Figure 2.1 on the next page appears on your computer screen. The athena window is divided into several parts. We will discuss each of these parts and give each a name. 15

2.2. GETTING HELP

Figure 2.1: The parts of the athena.

At the top of the window is a menu bar. This works much like the menu bar in any program. Much of the functionality in athena is accessed through those menus. The largest part is the main window, highlighted in the picture above with a red border. The red border does not happen in the real program its there simply to clarify this discussion. The main window is divided into six parts. The top box identies the le name of the current project le (Sec. 8.2 on page 85). Below that, are various parameters identifying the current data group. The next three boxes are used to dene the parameters associated with normalization and background removal, forward Fourier transforms, and reverse Fourier transforms. At the bottom of the main window are a couple of parameters associated with plotting. At the bottom of the screen is the echo area. This very important space is used by athena to communicate with you, the user. This space is used to display informational messages while athena is working on your data, error messages when it runs into trouble, and other kinds of messages. When athena starts, it displays a hint from its built-in list of hints. A new hint can be seen at any time by pressing Ctrl - h . The large blank area on the right is the group list area (Sec. 6.1 on page 62). As data are imported into athena, they will be listed in this space. Access to the data already imported is made by clicking in this space. Above the group list area are the mark buttons (Sec. 6.2 on page 66) The blank space next to the mark buttons is the modied project indicator. This indicator shows when your project has been modied and needs to be saved. Below the group list area are the plot buttons. Below that are the buttons used to set the k-weighting for use when plotting in k-space or when making a forward Fourier transform. Below that are various other plotting controls (Sec. 6.2 on page 66) in the plotting options section. After importing several data les, each is made into a data group and listed in the group list. The label and the check button next to it are the main controls for interacting with data in athena.

2.2

Getting help

16

This work is licensed under the Creative Commons Attribution-ShareAlike License.

CHAPTER 2. INTRODUCTION TO ATHENA

Figure 2.2: athena, after importing some data.

There is quite a bit of help built right into athena. Typing Ctrl - m or selecting Document from the Help menu will display athenas document in a web browser or in the built-in document viewer. The Document sections submenu allows you to jump directly to a particular topic. Also, many parts of the program have a button which will take you directly to the part of the document that describes that part of the program. You can select the format in which the documentation is displayed by setting the Doc prefer preference. Because it has all the images, the html document is probably the better choice. Users on Windows and the Mac will have the html document displayed in whatever browser is the system default. For Linux, BSD, and other unix users, athena attempts to nd a suitable browser. You can explicitly set the browser from a list of common (and not so common) options by setting the Doc browser preference. This list includes every GUI browser option that Bruce was aware at the time this paragraph was written, including several options from the Mozilla ecosystem. Another feature that you can use to explore dierent parts of the program are the demo les. Demo les are normal project les (Sec. 8.2 on page 85) that get installed when you install this software on your computer. Each demo le demonstrates a particular feature of the program. When you select Import a demo project from the Help menu, a le selection dialog opens to the location of the demo projects. When you select one, its project journal (Sec. 6.7 on page 72) is opened after its data is displayed. The journal explains how to use the data to learn about the topic covered by that demo.

This work is licensed under the Creative Commons Attribution-ShareAlike License.

17

2.2. GETTING HELP

18

This work is licensed under the Creative Commons Attribution-ShareAlike License.

Chapter 3

Data import
athena is very versatile in how she reads in data les. Pretty much any data in the form of columns of numbers can be successfully read. With a few exceptions, athena relies upon ifeffits read data() command to handle the details of data import. ifeffit is clever about recognizing which part of a le is columns of numbers and which part is not. In the following, Ill explain how the read data() command interprets les, explain the limits on its and athenas abilities to interpret a data le, and discuss the kinds of manipulations of data that can and cannot be performed by athena as data are imported. athena expects data of one of a few types. Column data in which the columns represent such things as the energy grid and the scalars measured during the experiment are the most common sort of data that most people use import into athena. athenas column selection dialog is used to convert the raw scalars into (E ) data. Other common kinds of data les that might be read into athena are les that contain (E ) or chi(k) data in columns or the output les from Fe, xmu.dat and chi.dat. Here is an example of a data le that will make athena as happy as can be. There are some header lines, followed by a line of dashes, followed by a line of column labels, followed by lines containing columns of data.
# # # # # X15B project: MT 9/23/04 original file: STD1.001 unpacked from original data as a sequence of 4-byte floats ----------------------------------------------------------energy I0 narrow wide 2400.0020 60183.3008 38.5000 83.0000 2401.5088 60241.0508 41.5000 82.0000 2403.0078 60347.5508 40.0000 83.7500 2404.5039 60531.0508 42.2500 78.2500 ... etc ...

In this example of a perfectly formatted le, the header lines, the line of dashes, and the column labels line are all preceded by a hash (#) mark. ifeffit is thus able to recognize these as header lines. Since ifeffit recognizes them as such, athena will store them in the project along with the data. Because there is a line of dashes and because it is followed immediately by column labels, athena is able to use these labels in the column selection dialog. A few other common US keyboard symbols, such as also be understood as marking header lines. The numbers in the columns can be integers, oats (such as 1.234, -1.234, .1234 or -.1234), or exponentials (such as 1.23e45 or -1.23E-45). Anything interpretable as a number in the C programming language will be interpretable in this context. The columns of numbers go to the end of the le. There is no text following the data. When data is recorded as described above, it will be fully utilized by athena. The headers will be recorded, the column labels will be used, the data will be interpreted. athena can, however, accommodate signicant deviation from the format described above. 19

If the header lines are not marked by a # or some other recognizable marking character, ifeffit will not be able to recognize headers or column labels. As long as no text follows the data, the columns will still be understood as columns of data and the data can be imported by Athena. If the line of dashes is missing, again the headers and column labels will not be recognized, but the columns of data will be. If no headers are in the le, the columns of data will still be understood as data. athena expects that the data are recorded as a function of energy and that one of the columns contains energy values. The assumption is that the rst column is the energy column, but that can be changed in the column selection dialog. athena works in eV. If data are recorded in keV, there is a menu in the column selection dialog that must be set accordingly. Here are some operations that can be performed as data is imported. 1. Data can be imported as a function of pixel position on an area or linear detector. 2. Data from a multi-element detector can be summed on the y. 3. Data from a multi-element detector can be imported such that each detector channel is imported into its own data group. 4. Data can be negated, i.e. multiplied by -1. 5. A reference channel can be read from the the same le. 6. Data can be preprocessed. That is, data can be truncated, deglitched, aligned to a standard, and have its parameters constrained to a standard Here are some operations that can be handled using the Plugin architecture (Sec. 3.6 on page 29). 1. Conversion from wavelength to energy. 2. Conversion from encoder reading or motor steps to energy. 3. Conversion of data in a binary format 4. Dead-time corrections using columns from the data le. 5. Any math expression more complicated than sums of columns in the numerator and denominator, e.g. plugins allow you to multiply the If column by 7 and divide by the sine of the I0 column, if thats what you want. If some of the criteria for the data le format are not met, for example if there is text following the data columns or if you need to perform one of the operations not yet supported, you will need to process you data before trying to import into athena. There are examples of data les that athena will process before sending o to ifeffit for import. An example is the data le format from beamline X10C at NSLS. Files from that beamline cannot be imported as written by ifeffits read data() command. athena will recognize such a le and process it as needed before importing it. This can be done with other beamlines. You should contact Bruce if you are the beamline scientist or a frequent user of some beamline which writes data in a way that read data() cannot import. As a nal comment, I would encourage beamline scientists and the authors of data acquisition software to consider their users when designing data le formats. While I certainly will not say that beamlines should be required to accommodate athena or even that beamline sta have any obligation to recommend athena to their users, the truth is that athena is becoming an increasingly common tool in the EXAFS community. The format that best serves athena is actually a ne format that can be imported by a very wide variety of EXAFS software, plotting software, spreadsheets, and other programs. Its a good format and your users would be well served by your adopting it. 20
This work is licensed under the Creative Commons Attribution-ShareAlike License.

CHAPTER 3. DATA IMPORT

3.1

Column selection dialog


Ctrl

To import a data le, select Open le from the File menu or type opens. On my Linux computer, it looks like Figure 3.1

- o . A le selection dialog

Figure 3.1: The le selection dialog on a Linux computer.

It looks somewhat dierent on Windows, but behaves the same. It allows you to navigate your disk to nd the le you want to import. Once you nd that le, click on it then click on the Open button. Once you have selected a le to import the column selection dialog, shown in Figure 3.2 on the following page, appears. On the right side of this dialog, the contents of the data le are displayed. This allows you to examine the le to help you gure out which columns should be imported to turn into the (E ) data. On the left are various control for specifying which columns contain the energy values and which contain the signals from the various detectors. Typically, the signals from the detectors are saved to disk as columns of numbers. These columns need to be combined depending on the nature of the experiment. For a transmission experiment, the incident channel is divided by transmission channel and the natural log is taken at each point. For uorescence data, the uorescence channel is divided by the incidence channel. Electron yield data is like uorescence data the yield channel is divided by the incident channel. The controls in the tabs at the bottom left are the discussed in later sections. In the example shown, the incident channel is, for some reason, called mcs3. Since this is transmission data, I have checked the mcs3 button for the numerator. The transmission channel is called mcs4 and its button is checked for the denominator. As you check the buttons, a couple of helpful things happen. The rst is that equation for how the columns combine to form (E ) is displayed in the box below the column selection buttons. Also as you check buttons, the data are plotted. If you have selected the correct columns and chosen the numerator and denominator correctly, the plot will look like XAS data. If the plot is upside-down, then you need to switch the numerator and denominator. If the plot doesnt look like XAS at all, you need to try some of the other channels. I chose this example because the columns are labeled somewhat confusingly. Often the columns will be labeled in the le more obviously with names like I0 or It. In this case, we either need to know what the columns mean or patiently click through the buttons to gure it out. As a last resort, you may need to ask the beamline scientist!

3.1.1

Data types and energy units

This work is licensed under the Creative Commons Attribution-ShareAlike License.

21

3.1.1 Data types and energy units

Figure 3.2: The column selection dialog.

Occasionally, athena needs a bit more information to correctly interpret your data correctly. The data types menu is shown in Figure 3.3. The default is for data to be imported as (E ).

Figure 3.3: Data types in the column selection dialog. The other choices are: norm(E) : (E ) data that have already been normalized in some other way. These data will not be normalized by athena xanes(E) : (E ) data measured over a limited data range and for which you do not need to look at the (k ) chi(k) : (k ) data, that is data that have already been background subtracted from (E ) detector : data that are not (E ) but which you may want to plot in energy xmu.dat : the xmu.dat le from feff 22
This work is licensed under the Creative Commons Attribution-ShareAlike License.

CHAPTER 3. DATA IMPORT chi.dat : the chi.dat le from feff If you make a mistake and import your data as the wrong data type, you can change between any of the energy-valued ((E ), normalized (E ), XANES, or detector) record types at any time by selecting Change record type from the Group menu and selecting the correct choice from the popup dialog, Figure 3.4. This dialog cannot, however, be used to change (k ) data to an energy-value type or vice-versa, nor to change one of the feff types to a non- feff type.

Figure 3.4: Changing the data type after the data are imported.

athena uses electron volts as its energy unit. It uses a simple heuristic to gure out if an input le is in eV or keV. In case athena gets it wrong, you can specify the energy unit with the Energy units menu. Dispersive XAS (Sec. 9.3 on page 93), i.e. data which is a function of pixel index, requires special treatment.

3.1.2

Multi-element detector data

athenas column selection dialog has some special features for dealing with multi-element detectors. You can select all the channels of the MED as elements of the numerator, as shown in Figure 3.5.

Figure 3.5: Importing multi-element data in the column selection dialog.

Importing the data will then add up the channels on the y and put a group containing the summation of the channels in the group list. You have the option of clicking the button that says Save each channel as a group, as in Figure 3.7 on the next page.
This work is licensed under the Creative Commons Attribution-ShareAlike License.

23

3.1.2 Multi-element detector data

Figure 3.6: After adding columns of multi-element data on the y in athena.

Figure 3.7: Importing multi-element data in the column selection dialog and saving each channel as a group.

24

This work is licensed under the Creative Commons Attribution-ShareAlike License.

CHAPTER 3. DATA IMPORT Then, instead of adding the channels to make one group, each channel will be imported as an individual group and given its own entry in the group list. This is handy for examining the channels and discarding any that are not of usable quality.

Figure 3.8: After importing the channels of multi-element data as individual groups.

3.2

Project selection dialog

Project les (Sec. 8.2 on page 85) are athenas mechanism for saving the state of an analysis project. The project selection dialog, shown in Figure 3.9, provides a way of selectively importing part or all of the contents of the project le.

Figure 3.9: The project selection dialog.

This work is licensed under the Creative Commons Attribution-ShareAlike License.

25

3.3. MULTIPLE DATA SET IMPORT Project les, like any other les are imported using the le selection dialog (Sec. 3.1 on page 19). athena will recognize a project le and present the project selection dialog. The contents of the project le are listed on the left side of the dialog. The contents of the journal (Sec. 6.7 on page 72) are listed in the box at the top right. When you click on one of the data groups in the list on the left, it gets plotted and its title lines are inserted into the box at the lower right. Using these parts of the dialog, you can examine the contents of your project le before importing them into athena. By selecting some of the projects from the list, you can import a subset of the project le. The group listing uses extended selection: Click on an item in the list to select one group Control-click (i.e. hold down the control key while clicking) on an item in the list to add it to the selection Shift-click to on a group to select all groups between it and the previously selected group. Click and drag to select all groups that you drag over. Additionally the buttons labeled All, and None can be used to select all groups or to clear the selection. The Invert button will invert the selection of each group. Once you have selected the groups you want to import, click the Import button. If no groups are selected then all the groups will be imported. athena checks for project les that have become damaged. When it recognizes a damaged le, it will extract what information is salvageable and insert those groups in the group list. It will then issue an error message with a brief hint about the problem. That error message is inserted into the titles box in scary red text.

3.3

Multiple data set import

You can import multiple data sets in the same manner that was explained in the last section. Select Open le from the File menu or type Ctrl - o . When the le selection dialog opens, you can select more than one data le by clicking on le names while holding down the Ctrl key. On my Linux computer, it looks like Figure 3.10.

Figure 3.10: Importing multiple data sets with the le selection dialog.

Note that three les are highlighted in the le listing and that those three les are listed below in the File name box. Another way of selecting multiple les is to click on a le in the listing then click on 26
This work is licensed under the Creative Commons Attribution-ShareAlike License.

CHAPTER 3. DATA IMPORT another le while holding down the Shift key. When you do this, all les between the two you clicked on will be selected. When you click the OK button, all of the selected les will be imported. If all of the les are of the same type, athena will import them all with only one interaction of the column selection dialog. Thus, if you select several les that were measured one after the other, they will all be imported using the same column selections as well as the same parameters for the reference channel, rebinning, and preprocessing (all of which will be described in the following sections). If, however, a le is found that appears to be of a dierent format, the column selection dialog will reappear as needed. athena considers two les to be the same if they have the same number of columns and those columns have the same labels. Each le imported in this way will be listed in the group list, shown in Figure 3.11

Figure 3.11: athena after importing multiple data sets. When you import multiple project les, the project selection dialog (Sec. 3.2 on page 23) will appear for the rst one in the list. If you import the entire contents of the project le, then the entire contents of all remaining project les will also be imported. If, however, you import only a subset, the project selection dialog will appear for the next project le. As soon as you import an entire project, all subsequent projects will be imported without having to interact with the dialog.

3.4

Reference channel

The column selection dialog oers several other features related to data import. In this section we will see how to import a reference channel. It is common to place a third ionization chamber in line after the transmission chamber and to place good transmission standard between the two. The point of measuring the standard is that it is measured in parallel with your real sample. This standard can then be used to align the actual data using the data alignment dialog (Sec. 9.2 on page 90). The standard often is a zero-valent foil, but the most important thing is that it is an excellent standard which will yield consistently high-quality data. The other most important thing is that you always use
This work is licensed under the Creative Commons Attribution-ShareAlike License.

27

3.5. PREPROCESSING DATA the same sample as your reference standard for ever experiment you make at a particular edge. To this end, it is wise to make a library of standards and carry them with you to the synchrotron. By using the same standard for every experiment at an edge, you can align any data, even data measured years apart at dierent synchrotrons.

Figure 3.12: Importing a reference channel with the column selection dialog.

The reference channel selection works almost the same as column selection for the data except that you dont need to specify the energy column again the same column is used. When a reference channel after the transmission channel is used, you should use the transmission channel as the numerator and the reference channel as the denominator. Another common solution to measuring a reference channel is measure elastically scattered radiation through the standard with a PIN diode. In that case, I0 is the numerator and the diode is the denominator. You can plot the reference channel to make sure that you have selected the correct channels with the Plot reference button. If your reference standard is of an element with a nearby edge energy, uncheck the button labeled Same element. If you use some other kind of reference measurement that is not a transmission measurement, you can uncheck the Natural log button. When you click the OK button, the data are imported and inserted into the group list. The reference channel is placed in the group list below its data. The reference channel is just like any other group, with one distinction. The data and its reference channel are tied together in the sense that the values for their eshift parameters will always be the same. This relationship is shown visually by the change in color of the text in the box for eshift , as seen in in Figure 3.13 on the facing page. When you change the value of eshift for the reference, the value of eshift for the data changes as well. (And vice versa!) This feature of reference channels is put to good use in data alignment (Sec. 9.2 on page 90). Occasionally, it is useful to tie two data groups together in this way. This can be done by marking the two groups you want to tie together as data and reference, then selecting Tie reference channel from the Values menu.

3.5

Preprocessing data

28

This work is licensed under the Creative Commons Attribution-ShareAlike License.

CHAPTER 3. DATA IMPORT

Figure 3.13: Data imported with a reference channel in athena.

There are a number of other operations that athena can perform on your data as it is imported. These are found in the other tabs on the bottom left of the column selection dialog. Note that all of the pre-processing chores discussed here can also be performed on data after it has been imported. See the data processing chapter (Sec. 9 on page 89). for more details.

3.5.1

Rebinning quick scan data

Some beamlines oer the option of collecting data as a quick scan. In that scanning mode, the monochromator is slewed continuous from the beginning of the scan to the end. The detectors are read continuously and integrations of the detector signals are stored in intervals. The length of these intervals and the slewing speed of the monochromator determine the energy width of each measurement bin. Typically these measurement parameters are chosen to provide adequate resolution through the edge typically a third or a half of an electron volt. This results in data that are vastly over-sampled in the EXAFS region. To improve the statistics in the EXAFS region and to make the data arrays smaller, it is useful to rebin the data. This process uses a boxcar averaging to place the evenly spaced quick scan data onto a typical EXAFS grid. That grid is usually something like 10 eV in the pre-edge, 0.5 eV through the edge, and 0.05 A1 in the EXAFS region. In Figure 3.14 on the next page, I have imported some data on a uranyl compound measured in quick scan mode: At this stage, athena has not examined the data closely enough to have guessed what edge you are measuring, so you must specify the element symbol of the absorbing atom. The remaining numeric parameters dene the grid onto which these data will be rebinned. The rst two numbers dene the boundaries of the edge region in energy, the third denes the size of the grid in the pre-edge, the fourth denes the size of the grid through the edge, and the last denes the grid in wavenumber in the EXAFS region. athena will remember the values of these parameters between data sets. However, the default is to turn o rebinning for each new data set. Therefor you must click to the rebinning tab for every data set
This work is licensed under the Creative Commons Attribution-ShareAlike License.

29

3.5.2 Other pre-processing chores

Figure 3.14: Rebinning data on the y as it is imported using the column selection dialog.

you import, and click on the Perform rebinning button. When you import multiple data sets, though, rebinning will be performed on each one without intervention according to the normal rules of multiple data set import.

3.5.2

Other pre-processing chores

This tab provides controls for a number of other things that can be done with your data as it is imported. The rst three marking, truncating, and deglitching can be performed even on the rst data set imported. The other two require that a standard be specied. The menu at the top of the tab contains every item form the group list. The one specied in that menu is the standard.

Figure 3.15: Pre-processing data as it is imported using the le selection dialog.

30

This work is licensed under the Creative Commons Attribution-ShareAlike License.

CHAPTER 3. DATA IMPORT Here are descriptions of each of the pre-processing chores, seen in in Figure 3.15: Mark each data set If this is selected, each data set will be marked (Sec. 6.2 on page 66) as it is imported. Note that the reference spectrum is not marked. Also note that, unlike the other four pre-processing options, this one is always deselected when new data is imported. Truncate each data set If this is selected, the data before or after the specied value will be removed from the data (Sec. 9.5 on page 98). Note that only the data in athenas memory is truncated, the data le is not altered. Deglitch each data set If this is selected, the data are deglitched using the batch deglitching algorithm (Sec. 9.4 on page 96). Note that only the data in athenas memory is truncated, the data le is not altered. Align to the standard If this is selected, the data are aligned to the specied standard using the auto-alignment algorithm (Sec. 9.2 on page 90). If both the data and standard have reference channels, those are used in the auto-alignment. Set parameters to the standard If this is selected, all parameters (except for eshift ) will be set to the values of the standard (Sec. 7.1 on page 75). The pre-processing tab is one of athenas genuine power features. With a bit of forethought, most of your data processing can be performed automatically. I typically import one data le and carefully calibrate it and set its various parameters. Having done that, the remaining data gets well processed simply by reading it in. This kind of time saver is of particular value at the beam line.

3.6

File type plugins

athena uses ifeffits read data() function to import data. This means that athenas notion of what is an acceptable data format is completely identical to ifeffits notion. The contrapositive is also true if ifeffit can read a data le, so can athena. In practice, this works great. ifeffit is able to read the data les generated by many of the worlds XAS beamlines. And so, consequently, is athena. Sadly, there are many beamlines that use a format that confounds ifeffit and athena. There are three reasonable ways that I could deal with deal data from those beamline: 1. Refuse to deal with them and require the user to transform the data into a form that ifeffit can handle. 2. Hard-wire code into athena to deal with each new data format as I become aware of it. 3. Create a plugin architecture that allows athena to be extended to deal well with new data formats without having to change the underlying code. For a long time, athena relied on a combination of 1 and 2 from that list. Eventually I decided to adopt number 3. This page documents the plugin architecture so that athenas users can begin writing their own le type plugins.

3.6.1

Overview of how plugins work

In simple language, a perl module is a short le containing special perl code placed in a special location. athena uses the code contained in that le to recognize and pre-process data les so that they can be imported properly using ifeffit.
This work is licensed under the Creative Commons Attribution-ShareAlike License.

31

3.6.2 Example plugin In somewhat more technical language plugin is just a perl module placed on your computer in a place where it can be found. This le is used when athena starts and its methods are available when data is imported. When a plugin is available for use, it is invoked every time a le is imported into athena using the Open le function. The new le is checked using one of the plugins methods to ascertain if the le is of the sort serviced by the plugin. If the le is recognized, another method in the plugin transforms the original data le into a form that is readable by ifeffit. This transformation is done in a way that leaves the original data le unchanged. If the transformation is successful, the user is presented with athenas column selection dialog and can import data in the normal manner. Ideally, a plugin is written in a way that makes the import of the data into athena a completely transparent process for the user.

3.6.2

Example plugin

Here is a complete example of a functional plugin taken from the horae distribution. This plugin allows athena to import les from NSLS beamline X10C. As you can see, the plugin is quite short. The following sections of this page will explain this example in detail.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49

package Ifeffit::Plugins::Filetype::Athena::X10C; use vars qw(@ISA @EXPORT @EXPORT_OK); use Exporter; use File::Basename; use File::Copy; @ISA = qw(Exporter AutoLoader); @EXPORT_OK = qw(); ## define the required variables use vars qw($is_binary $description); $is_binary = 0; $description = "Read files from NSLS beamline X10C."; ## this method recognizes a file from NSLS X10C sub is { shift; my $data = shift; open D, $data or die "could not open $data as data (X10C)\n"; my $first = <D>; close D, return 0 unless (uc($first) =~ /^EXAFS/); my $lines = 0; while (<D>) { close D, return 1 if (uc($first) =~ /^\s+DATA START/); ++$lines; }; close D; return 0; }; ## this method transforms a file from NSLS X10C sub fix { shift; my ($data, $stash_dir, $top, $r_hash) = @_; my ($nme, $pth, $suffix) = fileparse($data); my $new = File::Spec->catfile($stash_dir, $nme); ($new = File::Spec->catfile($stash_dir, "toss")) if (length($new) > 127); open D, $data or die "could not open $data as data (fix in X10C)\n"; open N, ">".$new or die "could not write to $new (fix in X10C)\n"; my $header = 1; my $null = chr(0).+; while (<D>) { $_ =~ s/$null//g; # clean up nulls print N "# " . $_ if $header; # comment headers ($header = 0), next if (uc($_) =~ /^\s+DATA START/); next if ($header); $_ =~ s/([eE][-+]\d{1,2})-/$1 -/g; # clean up 5th column print N $_;

32

This work is licensed under the Creative Commons Attribution-ShareAlike License.

CHAPTER 3. DATA IMPORT


50 51 52 53 54 55 56 57 }; close N; close D; return $new; }; 1; __END__

3.6.3

Namespace

The module must be in a particular namespace. The namespace is dened by the package function on line 2 of the example. The convention for the namespace used by the plugin is slightly unwieldy, but was chosen for a good reason. The package must be in the Ifeffit::Plugins::Filetype::Athena namespace and should have a name that is descriptive of what format it is made for. in the case of the example, the plugin is intended to transform X10C les, so the full namespace of the module is Ifeffit::Plugins::Filetype::Athena::X10C. Lines 4-9 include requisite boilerplate which will allow this module to work properly with athena and call some modules that are almost always useful. The reason I chose such an unwieldy namespace is to allow for the possibility of moving much functionality in both athena and artemis into the form of plugins. With this choice, I will have considerable exibility without having to rewrite any existing code.

3.6.4

Required methods and variables

The plugin must supply two public variables and two public methods. (I put public in quotes because, of course, perl modules constructed like our plugins do not provide true encapsulation of variables and methods. The sense in which I mean public is that athena requires certain variables and methods in the namespace of the plugin. Without them, the plugin will fail noisily.) required variables Lines 12-14 dene the two required variables in a way that allows them to be accessed outside the scope of this module. $is binary A boolean that tells athena whether the input le format is text or binary. athena handles binary les slightly dierently in the column selection dialog. $description A short text string describing the purpose of this plugin. This string will be displayed in the plugin registry take a look at the amount of space available there, and make your string shorter than that. the is method Lines 17-30 show the is method. This method is called by athena to try to recognize an input data le as being of a particular format. In the case of this example, the X10C le is recognized by some of the text in the rst few lines of the les. When the le is recognized, this method returns a true value. If the test fails, it returns 0. When athena sees the true return value, it applies the x method to transform the data le. It is quite important that the is method be fast. It is possible that a data le will have to be tested against a large number of plugins. If the is method is slow, le import will be slow.
This work is licensed under the Creative Commons Attribution-ShareAlike License.

33

3.6.5 Athenas plugin registry the x method Lines 33-54 show the fix method. This method is called when the is method returns true. In some manner it makes a copy of the original data le and transforms that copy into a form that can be read by ifeffit. This method needs to follow a number of strict rules, however within those rules there is a lot of exibility about how the transformation is accomplished and the scope of what that transformation does to the data. This method takes four scalars as inputs. $data This is a string containing the fully resolved name of the input data le. $stash dir This is a string with the location where athena will look for the transformed copy of the data. $top This is a reference to athenas main window. This allows you to create a GUI input dialog to collect information interactively from the user. See the Encoder plugin for an example of how this is used. $r hash This is a reference to a hash that can contain information about how the data are transformed. This hash persists between invocations of the x method, thus allowing you to reuse parameters about the transformation. Again, see the Encoder plugin for an example of how this is used. The return value of this method is the fully resolved le name of the transformed le which must be located in the directory indicated in the $stash dir input scalar. The basic work ow of the x method is to open the original data le, perform some kind of operation on the data, and write the transformed data to the $stash dir. This can be done almost any way. Some plugins use ifeffit commands (via the Ifeffit module) to operate on the data. Other plugins use pure perl to parse and transform the le. In the example given on this page, the rst thing the fix method does is to create a le name in the stash directory for the transformed le. Lines 36 and 37 tell athena to give the stash le the same name as the original le (that is the function of the fileparse command) but in the stash directory (the catle method builds a fully resolved lename in a platform transparent manner). Line 38 checks the length of the fully resolved lename to avoid running into one of ifeffits internal limitations. Three things are done to transform an X10C le. The header is stripped of null characters, the header is commented out by putting # characters in the rst column, and a formatting problem in some les involving a lack of white space between columns is resolved. Each line of the original le is read, operated on, and written to the transformed le in the stash directory. The while loop starting at line 43 reads through the le line-by-line and performs the operations. Lines 51 and 52 close the original and new le handles. The lter should always close the le handles. This is not such a huge issue under unix, but Windows places a lock on any open le handle. If you fail to close one, for as long as athena is running no other process will be able to do anything with that le. At line 53, the method returns with the fully resolved name of the transformed le. At no point was the original le altered. When athena exits, it will clean up the stash directory, thus avoiding a pile up of unnecessary data les. The work ow in this example is a simple stream from one le to another. Other lters (Lambda.pm is an example) in the horae distribution use ifeffit to perform the transformation. X15B.pm uses perls pack function to transform a binary le. Encoder.pm generates a simple GUI dialog to get data necessary for the transformation from the user. As you can see, the architecture of these plugins is quite exible, allowing you to solve the transformation problem in whatever manner best suits the situation.

3.6.5

Athenas plugin registry

34

This work is licensed under the Creative Commons Attribution-ShareAlike License.

CHAPTER 3. DATA IMPORT Because there might be a large number of le type plugins, it is possible for the user to turn the checks for the le types on and o. In the Settings menu, you will nd the Plugin Registry. This is a simple list of all plugins found in the system and user directories. The check buttons enable and disable the plugins. The value of the variable is displayed in the list (so be sure to choose a suitable and suitably short value for that variable).

Figure 3.16: athenas plugin registry.

Note that the order in which the plugins are displayed in Figure 3.16 on the facing page is the same order in which les are checked against the plugins. User plugins are checked before system plugins. After that the plugins are ordered alphabetically. If you want your system plugins to be checked against the data rst, choose a name that comes early in the alphabetical sense.

3.6.6

Reformatting and data processing

When I originally conceived the concept of the le type plugins, the scope was for the problem of importing data in a format not recognized by ifeffit. The plugins can also be used for some data processing. For instance, you might do deadtime corrections using the ICR and OCR columns of an MED le using a plugin. In that case, the x method would perform the deadtime correction as the data is streamed between the original le and the stash directory. Another example of pre-processing is the lter I wrote for MED les from APS Sector 10. We try to run in a mode where dead time is negligible. However, the large number of columns tends to use way to much of ifeffits memory, thus slowing athena way down. A good solution to that problem was to use a plugin to strip all the unused columns, leaving only the ROI columns in le in the stash directory. Note that the Sector 10 plugin is an example of using a plugin to alter a le that athena could already read, but in a way that adds value to the users interaction with athena.
This work is licensed under the Creative Commons Attribution-ShareAlike License.

35

3.6.7 System plugins and user plugins

3.6.7

System plugins and user plugins

athena looks in two dierent places for these plugins. One place is in athenas installation location where it nds the plugins that come with the horae distribution. The other is in the users space (on Windows plugins are located in C:\Program File\Ifeffit\horae\Ifeffit\Plugins\Filetype\Athena\, on unix $HOME/.horae/Ifeffit/Plugins/Filetype/Athena/). In both places, it reads the contents of the plugin directory and attempts to import the les which end in .pm.

3.6.8

Miscellaneous advice on plugins

1. Cut-n-paste is an excellent way to get started on a new plugin. Make a copy of a plugin for a le that is similar to your own le and use that as the basis for your new plugin. 2. X15B.pm is an example of a plugin for a binary format. 3. Encoder.pm is an example of a plugin that uses both GUI elements and the persistent hash. 4. Lambda.pm is an example of using ifeffit to perform the transformation. (Simply use Ifeffit qw(ifeffit); near line 5, then make use of the ifeffit function in the x method.) 5. You can use any module that you need, thus you have all of CPAN available to you when designing your plugin. If you need to do any seriously heavy lifting, check out the Math::Pari module or the Perl Data Language 6. Although a well-tested, robust plugin should be your goal, one of the nice features of the plugin architecture is that a good-enough plugin is easy to write and can quickly get you over a hurdle.

36

This work is licensed under the Creative Commons Attribution-ShareAlike License.

Chapter 4

Normalization and the AUTOBK Algorithm


The primary function of athena is to import and process XAS data. In the broadest sense, this can be broken up into three parts: Import raw data and convert it to (E ). Normalize the data so that the measurement is independent of the details of the sample or the detector setup. Determine the background function and subtract it from the data to make (k ). Of course, there are many other details, such as calibration, alignment, and deglitching. Those will be discussed in detail in later sections of the document. In this section, we will cover the details of the normalization algorithm and the AUTOBK background removal algorithm. Special attention will be payed to the most important background removal parameters. For many measured (E ) spectra, athena will do a good job of normalizing data and removing the background using its default parameters. In other situations noisy data, data with large white lines, data which terminate in the appearance of another edge user intervention is required. for those situations it is important that you understand well how the various parameters in the background removal section of the main window aect the data.

4.1

Normalization

Normalization is the process of regularizing your data with respect to variations in sample preparation, sample thickness, absorber concentration, detector and amplier settings, and any other aspects of the measurement. Normalized data can be directly compared, regardless of the details of the experiment. Normalization of your data is essential for comparison to theory. The scale of the (E ) and (k ) spectra computed by feff is chosen for comparison to normalized data. The relationship between (E ) and (k ) is: (E ) = 0 (E ) (1 + (E )) which means that (E ) = ((E ) 0 (E ))/0 (E ) 37 (4.2) (4.1)

4.1.1 The normalization algorithm The approximation of 0 (E ) in an experimental spectrum is a topic that will be discussed shortly (Sec. 4.12 on page 45). This equation is not, in fact, the equation that is commonly used to extract (k ) from the measured spectrum. The reason that equation is problematic is the factor of 0 (E ) in the denominator. In practice, one cannot trust the 0 (E ) to be suciently well behaved that it can be used as a multiplicative factor. An example is shown in Figure 4.1.

Figure 4.1: Au foil data which crosses the zero axis.

In the case of the gold spectrum, the detector setting were such that the spectrum crosses the zero-axis. Dividing these spectra by 0 (E ) would be a disaster as the division would invert the phase of the extracted (k ) data at the point of the zero-crossing. To address this problem, we typically avoid functional normalization and instead perform an edge step normalization. The formula is (E ) = ((E ) 0 (E ))/0 (E0 ) (4.3)

The dierence is the term in the denominator. 0 (E0 ) is the value of the background function evaluated at the edge energy. This addresses the problem of a poorly behaved 0 (E ) function, but introduces another issue. Because the true 0 (E ) function should have some energy dependence, normalizing by 0 (E0 ) introduces an attenuation into (k ) that is roughly linear in energy. An attenuation that is linear in energy is quadratic in wavenumber. Consequently, the edge step normalization introduces an articial 2 term to the (k ) data that adds to whatever thermal and static 2 may exist in the data. This articial 2 term is typically quite small and represents a much less severe problem than a misbehaving functional normalization.

4.1.1

The normalization algorithm

The normalization of a spectrum is controlled by the value of the e0 , pre-edge range , and normalization range parameters. These parameters are highlighted in Figure 4.2 on the next page. The pre-edge range and normalization range parameters dene two regions of the data one before the edge and one after the edge. A line is regressed to the data in the pre-edge range and a polynomial is regressed to the data in the normalization range . By default, a three-term (quadratic) polynomial is used as the post-edge line, but its order can be controlled using the normalization order parameter. Note that all of the data in the pre-edge range and in the normalization range are 38
This work is licensed under the Creative Commons Attribution-ShareAlike License.

CHAPTER 4. NORMALIZATION AND THE AUTOBK ALGORITHM

Figure 4.2: Selecting the normalization parameters in athena.

used in the regressions, thus the regressions are relatively insensitive to the exact value of boundaries of those data ranges. The criteria for good pre- and post-edge lines are a bit subjective. It is very easy to see that the parameters are well chosen for these copper foil data. Both lines on the left side of Figure 4.3 on the following page obviously pass through the middle of the data in their respective ranges. Data can be plotted with the pre-edge and normalization lines using controls in the energy plot tabs (Sec. 5.1.1 on page 52). It is a very good idea to visually inspect the pre-edge and normalization lines for at least some of your data to verify that your choice of normalization parameters is reasonable. When plotting the pre- and post-edge lines, the positions of the pre-edge range , and normalization range parameters are shown by the little orange markers. (The upper bound of the normalization range is o screen in the plot above of the copper foil.) The normalization constant, 0 (E0 ) is evaluated by extrapolating the pre- and post-edge lines to e0 and subtracting the e0-crossing of the pre-edge line from the e0-crossing of the post-edge line. This dierence is the value of the edge step parameter. The pre-edge line is extrapolated to all energies in the measurement range of the data and subtracted from (E ). This has the eect of putting the pre-edge portion of the data on the y=0 axis. The pre-edge subtracted data are then divided by 0 (E0 ). The result is shown on the right side of Figure 4.3 on the following page.

4.1.2

The attening algorithm

For display of XANES data and certain kinds of analysis of (E ) spectra, athena provides an additional bit of sugar. By default, the attened spectrum is plotted in energy rather than the normalized spectrum. In Figure 4.4 on the next page, attened data are shown along with a copy of the data that has the attening turned o. To display the attened data, the dierence in slope and quadrature between the pre- and post-edge
This work is licensed under the Creative Commons Attribution-ShareAlike License.

39

4.1.2 The attening algorithm

Figure 4.3: (Left) Cu foil (E ) with pre and post lines. (Right) Normalized (E ) data for a copper foil.

Figure 4.4: Comparing normalized (red) and attened (blue) data using a Cu foil.

40

This work is licensed under the Creative Commons Attribution-ShareAlike License.

CHAPTER 4. NORMALIZATION AND THE AUTOBK ALGORITHM lines is subtracted from the data, but only after e0 . This has the eect of pushing the oscillatory part of the data up to the y=1 line. The attened (E ) data thus go from 0 to 1. Note that this is for display and has no impact whatsoever on the extraction of (k ) from the (E ) spectrum. This is a nice way of displaying XANES data as it removes many dierences in the shape of the post-edge region from the data. Computing dierence spectra (Sec. 10.5 on page 123) or self absorption corrections (Sec. 9.10 on page 103), performing linear combination tting (Sec. 10.1 on page 113) or peak tting (Sec. 10.2 on page 119), and many other chores often benet from using attened data rather than simply normalized data. This idea was swiped from SixPACK.

4.1.3

Getting the post-edge right

It is important to always take care selecting the post-edge range. Mistakes made in selecting the normalization range parameters can have a profound impact on the extracted (k ) data. in Figure 4.5 is an extreme case of a poor choice of normalization range parameters. In this case, the upper bound was chosen to be on the high energy side of a subsequent edge in the spectrum. The resulting edge step is very wrong and the attened data are highly distorted.

Figure 4.5: (Left) The post-edge line is chosen very poorly for this BaTiO3 spectrum. The upper end of the normalization range is on the other side of the Ba LIII edge. (Right) The poor choice of normalization range for BaTiO3 results in very poorly normalized data.

The previous example is obviously an extreme case, but it illustrates the need to examine the normalization parameters as you process your data. In many cases, subtle mistakes in the choice of normalization parameters can have an impact on how the XANES data are interpreted and in how the (k ) data are normalized. In Figure 4.6 on the next page, the dierent choice for the lower bound of the normalization range (42 eV in one case, 75 eV in the other) has an impact on the attening of these uranium edge data data, which in turn can have in impact in the evaluation of average valence in the system. The small dierence in the edge step will also slightly attenuate (k ).

4.1.4

Getting the pre-edge right

This work is licensed under the Creative Commons Attribution-ShareAlike License.

41

4.1.5 Measuring and normalizing XANES data

Figure 4.6: (Left) Example of a subtle eect in how the post-edge line is chosen in a hydrated uranyl species. (Right) Comparing the attened XANES data for dierent choices of post-edge line in a hydrated uranyl species.

The choice of the pre-edge range parameters is similarly important and also requires visual inspection. A poor choice can result in an incorrect value of the edge step and in distortions to the attened data. In Figure 4.7 on the following page, we see the presence of a small yttrium K-edge at 17038 eV which distorts the pre-edge for a uranium LIII -edge spectrum at 17166 eV as shown in in Figure 4.7 on the next page. In this case the pre-edge range should be chosen to be entirely above the yttrium K-edge energy.

Figure 4.7: A sediment sample with both uranium and yttrium.

4.1.5

Measuring and normalizing XANES data

If time and the demands of the experiment permit, it is always a good idea to measure signicant amounts of the pre- and post-edge regions. About 150 volts in the pre-edge and at least 300 volts in the post-edge is a good rule of thumb. With shorter regions, it may be dicult to nd normalization boundaries 42
This work is licensed under the Creative Commons Attribution-ShareAlike License.

CHAPTER 4. NORMALIZATION AND THE AUTOBK ALGORITHM that provide good normalization lines. Without a good normalization, XANES measurement quantitatively with other measurements. Reducing the normalization order (found among the additional on page 61)) might help in the case of limited post-edge range. When step scan, it is often a good idea to add several widely spaced steps to normalization range without adding excessive time to scan. it can be dicult to compare a background parameters (Sec. 6.1 measuring XANES spectra in a the end of a scan to extend the

4.2

Understanding Fourier transforms

athena and ifeffit determine the background function using a denition based in Fourier theory. In short, the background is that part of the (E ) data containing low frequency Fourier components, while the data consists of the remaining, higher-frequency Fourier components. The autobk algorithm, then, is a Fourier-based technique. It varies the parameters of a piece-wise spline such that, when that spline is subtracted from the (E ) data, what is left has its low frequency Fourier components optimized. As we will see shortly, the default behavior of athena is to simply minimize the low frequency components. Before discussing how athena denes low and high frequency in the context of background removal, we can look at a simple illustration of why background removal is necessary and why it can be dicult. To understand the background removal algorithm, we need to understand a couple of things about the Fourier transform athena has a teaching tool which uses simple sine waves to demonstrate some of the most important features of the Fourier transform operation. In the Help menu, you will nd an entry labeled Explain Fourier transforms. When you select that, the main window will be replaced with the teaching tool in Figure 4.8 on the next page

Figure 4.8: The Fourier transform teaching tool.

The point of a Fourier transform is to distinguish the frequency components of a signal. The left side of Figure 4.9 on the following page shows a simple example of a mixed frequency signal along with its
This work is licensed under the Creative Commons Attribution-ShareAlike License.

43

4.2. UNDERSTANDING FOURIER TRANSFORMS components. The right side shows that the two frequency signal Fourier transforms to a spectrum with two peaks, one for each component frequency.

Figure 4.9: (Left) When you click the button labeled Plot waves in k, this is what gets plotted. This shows two waves of phase 2 and 3 (i.e. the sine waves repeat after 2 or 3 on the scale of the x-axis). The third trace shows the sum of those two sine waves. In the summed data, the two signals are intermixed in a way that confuses the fact that there are two sine ways involved. (Right) When you Fourier transform the sum of the two sine waves, this gets plotted. That there are two peaks in the Fourier transform indicates that there were two sine waves involved in the sum. That the peaks are at 2 and 3 on the x-axis, indicate the frequencies of the sine waves in the sum. Try changing the values of the sine waves or adding a third sine wave of a dierent frequency and replotting the sum and its Fourier transform. The Fourier transform, then, is a tool that isolate dierent frequencies in a signal. So, can we use a Fourier transform to distinguish the sine wave from the step-like function? The left side of Figure 4.10 on page 43 shows an articial XAS signal, consisting of a step-like function (actually an error function) multiplied by 1 plus a sine function, much like Eq. (4.1). The right side shows the Fourier transform of this XAS-like function. As you can see, the Fourier transform of the entire spectrum is dominated by the signal near 0 on the x-axis. The signal from the sine wave is a little bump barely recognizable above the ripple from the step-like function. Apparently we need to do something a bit more clever than simply Fourier transforming the (E ) data if we want to examine the oscillatory chi function without excessive interference from the step-like part of the (E ) spectrum. The solution is to somehow determine the shape of the step-like part of the (E ) spectrum and subtract it from the data. Ideally, this will remove all the stu near 0 on the x-axis, leaving peaks associated with the oscillatory part of the signal. The AUTOBK algorithm is based on the principles discussed in this section. Using a cuto frequency, it varies a piece-wise spline and subtracts that spline from the data. When the Fourier components below that cuto frequency are minimized, the spline is subtracted one last time from the data. The dierence between the data and the spline are normalized, converted from energy to photoelectron wavenumber and called (k ). In the next section, we will discuss how to choose that cuto frequency in athena and how to choose it sensibly. The Fourier transform teaching tool, has some other features not discussed above. It lets you explore the eect of the extent of the data range on the Fourier transform, play with dierent windowing function, see how close together in frequency sine waves can be and still be distinguished in a Fourier transform, and explore the dierent parts of the complex Fourier transform. These are all important topics that will be 44
This work is licensed under the Creative Commons Attribution-ShareAlike License.

CHAPTER 4. NORMALIZATION AND THE AUTOBK ALGORITHM

Figure 4.10: (Left) This gure is of (poorly) simulated (E ) spectrum. It was made by clicking on the button that says Plot edge step. In fact, this is a slightly broadened error function multiplied by one plus a sine wave of frequency 2. As such, it is an idealization of real XAS data. (Right) Clicking on the button labeled Plot FT of edge step results in this plot.

touched upon in later sections.

4.3

The Autobk Algorithm and the Rbkg Parameter

The frequency cuto between the background and the data discussed in the previous section is determined by the rbkg parameter. This is the second parameter displayed in the background removal section of the main window. When data are imported into athena, rbkg is set to its default value (Sec. 7.3 on page 79), normally 1. athena comes with a number of example data les. On a windows, these example les can be found in the folder. C:\Program Files\Ifeffit\examples\athena. On other systems, you can nd the examples in the source code package that you downloaded to install athena on your system. Among these example les is one called fe.300, which contains a spectrum from an iron foil measured at 300 K. Import this by selecting Open le from the File menu or by pressing Ctrl - o . Navigate to the location of your example les and select fe.300. The column selection dialog (Sec. 3.1 on page 19) then appears. For now, just click OK. The data is imported and rbkg is set to its default value of 1. The data and the background function found using the default parameter values can be found by pressing the E button. This is shown in Figure 4.11 on the following page on the left. The background function is subtracted from the data and normalized, resulting in a (k ) function. Press the k button to see (k ), shown in the right panel in Figure 4.11 on the next page. When you press the R button, the Fourier transform is plotted, as in the bottom panel in Figure 4.11 on the following page. So rbkg is the value below which the AUTOBK algorithm removes Fourier components. As you can see, below 1 the (R) function is essentially 0, but above 1 the spectrum is non-zero. Now lets examine the eect of choosing dierent values for rbkg . First, make a copy of the data so we can directly compare dierent values. Do that by selecting Copy group from the Group menu or by pressing Ctrl - y . athena now looks like Figure 4.12.
This work is licensed under the Creative Commons Attribution-ShareAlike License.

45

4.3. THE AUTOBK ALGORITHM AND THE RBKG PARAMETER

Figure 4.11: (Right) The fe.300 data and its default background function. (Left) The fe.300 (k ) data with its default background function. (Bottom) The fe.300 (R) data with its default background function.

46

This work is licensed under the Creative Commons Attribution-ShareAlike License.

CHAPTER 4. NORMALIZATION AND THE AUTOBK ALGORITHM

Figure 4.12: athena with the original fe.300 data and a copy of that data.

Click on the group Copy of fe.300 to display its parameters in the main window. Change rbkg to 0.2. Now we want to directly compare these two ways of removing the background. The way of plotting multiple items in the groups list involves the row of purple plotting buttons and the little check buttons next to the items in the group list. Click on the little check buttons next to fe.300 and Copy of fe.300, as shown in the screenshot above. Now plot these two items by clicking the R button. It should look something like Figure 4.13 on the following page. I suspect the blue spectrum is something like what you expect EXAFS data to look like, while the red one seems somehow worse. In fact, it is easy to understand why the red one looks the way it does. The rbkg parameter species the R value below which the data is removed from the (E ) spectrum. That is exactly what has happened in the red spectrum below 0.2 the signal is very small and the rst big peak is, in fact, above 0.2. Those two, plotted as (k ), are shown in Figure 4.13 on the next page on the right. The blue spectrum oscillates around the zero axis, as one would expect. The red one has an obvious, long-wavelength oscillation. It is that oscillation that gives rise to the low-R peak in the (R) spectrum. The background function, computed using 0.2 as the value of rbkg and plotted in energy, is shown in Figure 4.13 on the following page in the bottom panel. Using an rbkg value of 0.2 yields a background function that is not able to follow the actual shape of the data. What happens if the value of rbkg is set to a very large value? The (R) data for the values 1 and 2.5 are shown in Figure 4.14 on page 47. Using a very large value of rbkg results in signicant change to the rst peak in (R). We can see why by looking at the background function in energy in Figure 4.14 on page 47. With such a large value of rbkg , the background function has enough freedom to oscillate with frequencies that resemble the data. This results in a reduction of intensity under the rst peak. The spline used to compute the background function has a limited amount of freedom to oscillate. The number of spline knots is determined by the Nyquist criterion. This number is proportional to the extent of the data in k-space multiplied by rbkg . These knots are spaced evenly in wavenumber. Thus the spline
This work is licensed under the Creative Commons Attribution-ShareAlike License.

47

4.3. THE AUTOBK ALGORITHM AND THE RBKG PARAMETER

Figure 4.13: (Left) Comparing (R) for the data and its copy with rbkg values of 1 and 0.2. (Right) Comparing (k ) for the data and its copy with rbkg values of 1 and 0.2. (Bottom) (E ) and the background for the copy with an rbkg value 0.2.

48

This work is licensed under the Creative Commons Attribution-ShareAlike License.

CHAPTER 4. NORMALIZATION AND THE AUTOBK ALGORITHM

Figure 4.14: (Right) Comparing (R) for the data and its copy with rbkg values of 1 and 2.5. (Left) (E ) and the background for the copy with an rbkg value 2.5.

function can only have frequency components below rbkg . So where does that leave us? We want to make rbkg as big as possible so that the low-R peaks are as well suppressed as possible. On the other hand, too large of a value will result in damage to the data. The trick is to nd a balance. A good rule of thumb is that rbkg should be about half the distance to the nearest neighbor. But that is only a rule of thumb. Real data can be really dicult. Noisy data, data with strong white lines, data truncated by the appearance of another edge all of these require careful consideration. While rbkg is the primary background removal parameter, several others should be investigated to yield a good background removal. Several of these are the subjects of the following sections.

4.4

Spline clamps and k-weight in background removal

4.4.1

Spline clamps

One of the shortcomings of the use of piece-wise splines to approximate the background function is that the ends of spline are somewhat ill-dened by virtue of not having more data preceding or following. At times, this can result in the end of the spline splaying up or down, away from the (E ) data. This results in signicant distortion to (k ) data. ifeffit provides a tool called spline clamps. These work by adding an additional term to the 2 metric used to t the spline to the (E ) data. The dierence between the spline and the data is computed for the rst and last ve data points. This sum of dierences computed in energy is multiplied by a userchosen scaling factor and added to the 2 computed from the R-range below rbkg . This has the eect of clamping the spline to the ends of the data range. In other words, we use the prior knowledge that 0 (E ) is a smooth function through the oscillatory structure of (E ) to put a restraint on the t used to determine 0 (E ). The user-selected multiplicative coecient (Sec. 6.1 on page 61) takes one of six predened values: none, slight, weak, medium, strong, or rigid. These have values of 0, 3, 6, 12, 24, and 96, respectively and serve to set the strength of the clamp in the evaluation of 2 .
This work is licensed under the Creative Commons Attribution-ShareAlike License.

49

4.4.2 The eect of k-weight on background removal

Figure 4.15: (Left) EuTiO3 Ti K-edge data with the background subtracted using a high-end spline clamp of none. Note that the end of the spline deviates signicantly from the end of the data. (Right) Comparing the eects of dierent values of the high-end spline clamp on the EuTiO3 data. The data using the rigid clamp show the most physically reasonable behavior at the end of the data range.

The default value of the clamp is none at the low end of the energy range and strong at the high end. Clamps tend not to help at the low energy end of the data. Since the (E ) data is changing so quickly near the edge, biasing the spline to follow the data closely rarely helps improve the quality of the (k ) data. A strong clamp at the high energy frequently improves the behavior of the spline near the end of the data. The behavior of the clamping mechanism can be congured using the preference dialog (Sec. 6.8 on page 73). The Bkg nclamp preference changes the number of points at the end of the data range included in the calculation of the eect of the clamp. The Bkg clamp1 and Bkg clamp2 parameters set the strengths of the two clamps. The strengths of the clamps can be ne tuned by changing the numeric values. The parameter Clamp weak sets the the weak clamp, and so on.

4.4.2

The eect of k-weight on background removal

The background removal section has its own k-weight parameter which is distinct from the k-weight used for plotting and Fourier transforms (Sec. 6.5 on page 70). The background removal k-weight is the value used to evaluate the Fourier transform performed to determine the background spline. By varying the value of this k-weight , you can emphasize the lower or upper end of the data in the determination of the background. For clean data with oscillatory structure at high energy that is small but observable, you may nd that a larger value of the background removal k-weight produces a better (k ) spectrum. In fact, setting this parameter to 2 or 3 can have a similar impact on the data as the highest value of the spline clamp shown in the image above. However, in data which are quite noisy, amplifying the noise by a large value of k-weight can have a dramatic eect leading to a very poor evaluation of 0 (E ). Indeed, the 0 (E ) evaluated from noisy data with a large value of k-weight will sometimes oscillated wildly, as shown in Figure 4.16 on the facing page.

4.4.3

The interaction between spline clamps and k-weight

50

This work is licensed under the Creative Commons Attribution-ShareAlike License.

CHAPTER 4. NORMALIZATION AND THE AUTOBK ALGORITHM

Figure 4.16: Noisy data with 0 (E ) computed using k-weight of 3. With a k-weight of 1, the data are still noisy (of course!) but the background function properly follows the data.

The spline clamp and k-weight parameters sometimes interact strongly. The criterion that 0 (E ) follow closely to the end of the data that is imposed by the spline clamp can have a surprising eect on noisy, heavily k-weighted data. This is what happened in the data shown in the previous section. Reducing the strength of the spline clamp can sometimes help.

Figure 4.17: The same noisy data as in the last gure, also with a background k-weight of 3. However, this time the high-end spline clamp was set to none.

Sometimes your data are well served by a low k-weight and a strong spline clamp. Other times, a large k-weight and a weak clamp work better. Still other times, a strong k-weight and a strong clamp work best. How do you know what to do? There are no hard and fast rules, although you will develop an intuition for how dierent data will respond to dierent parameter values. Dont be shy about trying dierent combinations.
This work is licensed under the Creative Commons Attribution-ShareAlike License.

51

4.5. SPLINE RANGE IN BACKGROUND REMOVAL

4.5

Spline range in background removal

Two parameters that can have a big eect on the quality of the background removal are the limits of the spline range. By default, the spline used to approximate the background function is computed between 0.5 A1 and the end of the data range. (Those defaults can be set with the Bkg spl1 and Bkg spl2 preferences.) In the main menu, there are entry boxes for the values of the spline range in k and in energy. You can edit those interchangeably, when one pair is changed, the other pair is updated. The same is true if you use the pluck buttons (Sec. 6.3 on page 68) to set their values. There are good reasons to try changing the lower or upper bounds of the spline range. In the case of data with a large, sharp white line, the autobk algorithm might have a hard time following that swiftly changing part of (E ). The background removal might be improved by starting the spline range at a higher value. A good way to test the eect of spline range is to make a copy (Sec. 4.12 on page 45) of the data group, change the lower spline boundary to a large value for the copy, and plot both groups as (k ) or (R) using the k button or the R button. Changing the upper bound of the spline range is often helpful in data where the signal becomes very small at high k such that the level of greatly exceeds the (k ) data when k-weighted or if the shape of the background function is unstable due to sample inhomogeneity or some other measurement problem. Figure 4.18 shows an example of a change in the upper bound of the spline range.

Figure 4.18: Gold foil data showing the eect of changing the upper end of the spline range.

The obvious eect of changing the spline range is that (k ) is 0 outside the spline range, as seen on the high-k end of the plot. Changing one end of the spline range can also have an eect on the opposite end of the spectrum. This can be seen on the low-k end of the spectrum in the plot. When you are working on data for which a good background removal is dicult, changing the spline range is one of the tricks you can pull out of your tool bag.

52

This work is licensed under the Creative Commons Attribution-ShareAlike License.

Chapter 5

Plotting Your Data in ATHENA


Two of the main design goals of athena are to make basic data processing, i.e. background removal and Fourier transforms, as transparent as possible and to make processing of large amounts of data as seamless as processing a single data group. To this end, there are no buttons or other kinds of controls that explicitly tell athena to perform the basic processing chores. Instead, there are the plot buttons. When you click one of the plot buttons, the data processing which is required will be performed before the plot is made. For example, if you press the R button, the background will be removed from the current group and the (k ) will be Fourier transformed to (R). Once all that is nished, the plot in R-space will be made. As you change the values of the parameters in the main window, athena keeps track of what has been changed and which data processing steps need to be redone. If you change the krange parameters, then press the R button again, the Fourier transform will be updated, but athena will recognize that the background removal is still up-to-date.

Plotting the current group


The row of red buttons are used to plot the current group. The current group is the one highlighted in the group list and the one whose parameter values are displayed in the main window. The controls used to determine how the plots are displayed are described in the next section (Sec. 5.1 on the following page). 1. Clicking the E button brings the background removal up to date and plots the (E ) data. 2. Clicking the k button brings the background removal up to date and plots the (k ) data. 3. Clicking the R button brings the background removal and Fourier transform up to date and plots the (R) data. 4. Clicking the q button brings the background removal, Fourier transform, and backwards transform up to date and plots the (q ) data. 5. Clicking the kq button brings the background removal, Fourier transform, and backwards transform up to date and plots the (k ) data along with the real part of the (q ) data.

Plotting many groups


The row of purple buttons are used to plot the set of marked groups. The marked groups are the ones with their purple button checked in the group list. More details about the marking groups are found elsewhere in this document (Sec. 6.2 on page 66). The controls used to determine how the plots are displayed are described in the next section (Sec. 5.1 on the following page). 53

5.1. PLOTTING SPACE TABS 1. Clicking the E button brings the background removal up to date for all marked groups and plots their (E ) data. 2. Clicking the k button brings the background removal up to date for all marked groups and plots their (k ) data. 3. Clicking the R button brings the background removal and Fourier transform up to date for all marked groups and plots their (R) data. 4. Clicking the q button brings the background removal, Fourier transform, and backwards transform up to date for all marked groups and plots their (q ) data.

5.1

Plotting space tabs

5.1.1

Plotting in energy

The appearance of the plots made in E-, k-, R-, or q-space are controlled by the contents of the plot options tabs in the lower right hand corner of athena. This is highlighted in Figure 5.1. In energy, you have the option of plotting (E ) normalized or not and derivative or not. The red buttons on the left control how the current group is plotted. The purple buttons on the right control how marked groups are plotted. For the current group, you also have the option of plotting the background function, the pre-edge line, or the post-edge polynomial. As discussed in the normalization section (Sec. 4.1 on page 35), it is very helpful to examine the pre- and post-edge lines to verify that data normalization is done correctly.

Figure 5.1: The plot options section with the energy tab showing.

The two text entry boxes at the bottom of the tab are used to determine the extent of the data range plotted on the x-axis. Both those these numbers are relative to e0 . The Plot emin and Plot 54
This work is licensed under the Creative Commons Attribution-ShareAlike License.

CHAPTER 5. PLOTTING YOUR DATA IN ATHENA emax preferences can be used to set the default plot range. See also the plot styles section (Sec. 6.4 on page 70).

5.1.2

Plotting in k-space

The plot of (k ) is mostly determined by the value of the plotting k-weight buttons (Sec. 6.5 on page 70). The only option on the k-space tab is to make the plot as k-weighted (E ) rather than (k ). For the (E ) plot, the k-axis is translated to absolute energy using the value of e0 . If the window button is checked, the windowing function used to make the forward Fourier transform will be plotted along with the plot for the current group. The two text entry boxes at the bottom of the tab are used to determine the extent of the data range plotted on the x-axis. Although either number can be a negative value, there is no data below k=0. The Plot kmin and Plot kmax preferences can be used to set the default plot range. See also the plot styles section (Sec. 6.4 on page 70). Figure 5.2: The k tab.

5.1.3

Plotting in R-space

The plot of (R) is determined in part by the value of the plotting k-weight buttons (Sec. 6.5 on page 70). The options in the tab tell athena which part of the complex (R) to plot. For the current group, the parts are inclusive. Each selected part is plot. For the current group, you also have the option of plotting the envelope, which is the magnitude plotted in the same color as the negative magnitude. Selecting the envelope deselects the magnitude and vice versa. For marked groups, the parts are plotted exclusively and the envelope is not available. The two text entry boxes at the bottom of the tab are used to determine the extent of the data range plotted on the x-axis, behave much like the same boxes on the k tab, and have similar preferences. Figure 5.3: The R tab.

5.1.4

Plotting in q-space

The letter q is used to denote wavenumber of the ltered (k ) function and to avoid confusion with unltered k-space. The units of q are inverse Angstroms, just as for k. The plot of (q ) is determined in part by the value of the plotting k-weight buttons (Sec. 6.5 on page 70). The options in the tab tell athena which part of the complex (q ) to plot. For the current group, the parts are inclusive. Each selected part is plot. For the current group, you also have the option of plotting the envelope, which is the magnitude plotted in the same color as the negative magnitude. Selecting the envelope deselects the magnitude and vice versa. For marked groups, the parts are plotted exclusively and the envelope is not available. If the window button is checked, the windowing function used to make the forward Fourier transform will be plotted along with the plot for the current group. The two text entry boxes at the bottom of the tab are used to determine the extent of the data range plotted on the x-axis, behave much like the same boxes Figure 5.4: The q tab. on the k tab, and have similar preferences.
This work is licensed under the Creative Commons Attribution-ShareAlike License.

55

5.2. SPECTRAL RESOLUTION AND K-RANGE

5.2

Spectral resolution and k-range

. These closely spaced The rst and second coordination shells in iron metal are at 2.49 and 2.87 A shells overlap considerably when the Fourier transform of the (k ) data are plotted. Consequently, the iron foil data can be used to demonstrate the relationship between the Fourier transform k-range and spectral resolution. We see the iron foil data plotted in Figure 5.5 using three dierent values for kmax . The data are three identical copies of the 60K iron foil data and have had the background function removed in the same way. For the smallest value of kmax , 10 A1 , the second shell appears only as a shoulder at about 2.5 A. The shoulder becomes more pronounced when kmax is increased to 16 A1 . Only when kmax is set to 22 A1 , the entire measured data range, is the second coordination visible as a resolved peak.

Figure 5.5: Iron foil data, plotted with three dierent k-ranges.

5.3

Stacked plots

When marked group plots are made using the purple plot buttons, the default behavior is to overplot the various data groups. At times, it might be preferable to place an oset between the plots. This is done in general by setting the y-axis offset parameter. Stacking plots in a systematic manner is done using the stack tab. Stacking is done by setting the y-axis offset parameters of the marked groups sequentially. This tab contains two text entry boxes. The rst is used to set the y-axis offset parameter of the rst marked group. Subsequent marked groups have their y-axis offset parameters incremented by the amount of the second text entry box. Clicking the Set y-oset values button sets these values for each marked group.

5.4

Indicators

Indicators are vertical lines used to draw attention to specic points in plots of your data. This can be useful for comparing specic features in dierent data sets or for seeing how a particular feature propagates 56
This work is licensed under the Creative Commons Attribution-ShareAlike License.

CHAPTER 5. PLOTTING YOUR DATA IN ATHENA

Figure 5.6: (Left) The plot stacking tab. (Right) An example of a stacked plot. Note that the stacking increment is negative so that that order of the colors is the same in the legend as in the plot.

from energy to k to q. Points to mark by indicators are chosen using the pluck buttons (Sec. 6.3 on page 68) in the indicators tab. Click on the pluck button then on a spot in the plot. That value will be inserted into the adjacent text entry box. When the Display indicators button is selected, the indicator lines will be plotted (if possible) in each subsequent plot. Points selected in energy, k, or q are plotted in any of those spaces. Points selected in R can only be plotted in R. Points outside the plot range are ignored.

Figure 5.7: (Left) The indicator tab. (Right) An example of a plot with indicators. Note that plots made in E, k, or q will plot indicators selected in any of those three spaces.

The following preferences can be set to customize the appearance of the indicators. 1. Plot nindicators : the maximum number of indicators that can be set 2. Plot indicatorcolor : the color of the indicator line 3. Plot indicatorline : the line type of the indicator
This work is licensed under the Creative Commons Attribution-ShareAlike License.

57

5.5. THE POINT FINDER

5.5

The point nder

The point nder is a tool for knowing the corresponding coordinate for a point on a plot. Use the the pluck buttons (Sec. 6.3 on page 68) to select a the x- or y-value of a point on the plot. Clicking the nd Y or nd X button locates the corresponding coordinate on the most recent plot and replots the data with a marker showing that point. One good use of this tool is to compare the corresponding coordinate for a given value between data groups. Clicking on another group in the group list and making a plot will not change the value found by the pluck button. Clicking the nd button will nd the corresponding coordinate for the new data group.

Figure 5.8: (Left) The point nder tab. (Right) An example of a plot with the point nder. The following preferences can be set to customize the appearance of the point nder. 1. Plot pointnder : the shape of the point nder marker 2. Plot pointndersize : the size of the point nder marker 3. Plot pointndercolor : the color of the point nder marker

5.6

Group specic plot parameters

At the bottom of the main window are a pair of parameters which aect how that group is plotted. The plot multiplier parameter is a multiplicative factor for the group when it gets plotted. The y-axis offset is a number added to the group when it is plotted so that it is oset in the vertical direction. Both of these are parameters that are set for each group individually. Detector groups (Sec. 6.1.5 on page 66) use their plot multiplier parameters to plot them on the same vertical scale as their corresponding (E ) data. The stacked plots tab (Sec. 5.3 on page 54) is used to set the y-axis offset parameter for many groups. Like most other parameters in the main window, context menus (Sec. 7.1 on page 75) accessed by right clicking on the labels can be used to constrain these parameters across data groups.

5.7

Other plotting features

58

This work is licensed under the Creative Commons Attribution-ShareAlike License.

CHAPTER 5. PLOTTING YOUR DATA IN ATHENA

Figure 5.9: The plot parameters group in the main window.

5.7.1

Zooming

You can zoom in on any part of plot by selecting Zoom from the Plot menu or by typing Ctrl - = . You will be prompted in the echo area to click on two points in the plot. Those two points are the corners of a box surrounding the part of the plot you want to zoom in to. You can zoom repeatedly. Selecting Unzoom from the Plot menu or typing Ctrl - - will restore the original plot. Incremental unzooming is not implemented.

5.7.2

Cursor

You can grab coordinate values from any point in a plot by selecting Cursor from the Plot menu or by typing Ctrl - . . Text will appear in the echo area prompting you to click on a point in the plot. After you do so, the coordinate values will be displayed in the echo area.

5.7.3

Plotting I0

The Plot menu has several options for plotting I0. I0 can be plotted along with (E ) as shown below. Alternately, I0 can be plotted alone for the current group or for each marked group. The I0 channel is among the data saved in a project le (Sec. 8.2 on page 85).

5.7.4

Merged groups and the standard deviation

This work is licensed under the Creative Commons Attribution-ShareAlike License.

59

5.7.5 The collapse button

Figure 5.10: A plot of (E ) metallic tin along with the signal from the I0 channel.

When data are merged, the standard deviation spectrum is also computed and saved in project les (Sec. 8.2 on page 85). The merged data can be plotted along with its standard deviation as shown in the merge section (Sec. 9.28 on page 111) by selecting the Plot merge+std.dev. option from the Plot menu.

5.7.5

The collapse button

The group list is only tall enough to display about 11 groups without needing the vertical scroll bar. Any more, and some will be hidden from view by the scrollbar, as in Figure 5.11 on the next page. Clicking the collapse button, which is the button with the downward pointing arrow next to the plot option label, the plot options tab is hidden, giving more vertical space to the group list, as in Figure 5.12 on the facing page. When the plot options are hidden, the collapse button is replaced by an upward pointing arrow. Clicking it will restore the plot options tabs and shorten the group list.

60

This work is licensed under the Creative Commons Attribution-ShareAlike License.

CHAPTER 5. PLOTTING YOUR DATA IN ATHENA

Figure 5.11: athena with a large number of data groups.

Figure 5.12: The group list occupies more space at the expense of the plot options tabs.

This work is licensed under the Creative Commons Attribution-ShareAlike License.

61

5.7.5 The collapse button

62

This work is licensed under the Creative Commons Attribution-ShareAlike License.

Chapter 6

Athenas User Interface


athena can be used successfully by using relatively few of its capabilities. For instance, its fairly obvious that you can import data by opening a le using the File menu, change a parameter value by editing the number in one of the little boxes in the main window, or plot data by clicking one of the buttons labeled with the letters E, k, R, or q. There is, however, a lot more to athena at the level of its user interface. Part of making the leap from beginner to expert is learning about the various user interface features. One aspect of athenas user interface that requires special explanation is the Show additional parameters button at the top of the background removal parameters section of the main window. Clicking it, changes the display of the background removal parameters, replacing the main parameters with a set of additional parameters which can be used to ne tune normalization and background removal.

Figure 6.1: athenas main window with the additional background parameters showing. The main parameters can be restored by clicking the Show main parameters button. The additional parameters are all described elsewhere in this document. 63

6.1. USING THE GROUP LIST

6.1

Using the group list

The group list is the primary mechanism for accessing and interacting with your data. As data les are imported in athena, each gets an entry in the group list. Data generated during the course of using athena, such as copied or merged groups, also get placed in the group list. Each group list entry consists of two parts, the label and the check button. The label contains text identifying the group. The default is for the label to be the same as the le name. Clicking with the left mouse button on a label makes that group the current group. The current groups label is highlighted with a light red color and its parameters are displayed in the main window. The current group is the one that gets plotted when the red plotting buttons are pressed. The check button is used to mark the group. Marking, explained in detail in the next section (Sec. 6.2 on page 66), is one of the fundamental user interface features in athena. Any feature of athena that involves more than one group uses the mark buttons.

6.1.1

Copying groups

You can copy a group by hitting Ctrl - y or by selecting Copy group from the Group menu. This makes an identical copy of the current group and places it at the end of the groups list. All parameters are identical and the data arrays in ifeffit are all copied only the ifeffit group name in dierent. Copying is very useful for examining how changes in parameter values propagate through the data processing. You can make one or more copies, change particular data values, and overplot the results. The process of comparing parameter values can be automated. In the Group menu, youll nd an option for Copy series. This opens the dialog shown in Figure 6.2 on the facing page. You can select the parameter to increment from the drop-down menu. The next three entry boxes are for setting the grid of parameter values. When you click Make copies, the copies are made, the parameter values are incremented, the new groups are inserted into the group list, and they are renamed with useful labels. Finally a plot is made showing the dierences between the copies with dierent parameter values.

6.1.2

Reorganizing the group list

When a le is imported into athena, the name of the le is used as the label in the group list. Thats ne, but you can change the label by selecting Rename group from the Group menu, typing Ctrl - l , or double clicking on an item in the group list. This replaces the echo area with a dialog for entering the new label for the group, shown in Figure 6.3 on the next page. Hitting or clicking the OK button renames the group, shown in Figure 6.4 on page 64. We have already seen (Sec. 4.3 on page 43) how groups can be copied. Making one or more copies is an excellent tool for exploring the eects of the various parameters in the main window. There are several other useful tools for modifying the contents of the group list. You can reorder the items in the groups list using Alt - k or Alt - j to move the current group up or down in the list. Hitting Ctrl - k or Ctrl - j changes the current group to the one above or below. Items can be removed from the list. The current group or the marked groups can be removed from the project by selecting Remove group or Remove marked groups from the Group menu. You can remove all the groups from the list by selecting Close project from the File or Group menu or by hitting Ctrl w .

6.1.3

Information about items in the group list

Hitting Ctrl - b displays several pieces of information about the current group. The dialog that pops up to display that information is shown in Figure 6.5 on page 64. 64
This work is licensed under the Creative Commons Attribution-ShareAlike License.

CHAPTER 6. ATHENAS USER INTERFACE

Figure 6.2: The series copying dialog. In this example, a series of four copies with e0 values incremented by 5 eV.

Figure 6.3: Renaming a group list entry.

This work is licensed under the Creative Commons Attribution-ShareAlike License.

65

6.1.3 Information about items in the group list

Figure 6.4: After renaming a group list entry.

Figure 6.5: The dialog containing information about the data group.

66

This work is licensed under the Creative Commons Attribution-ShareAlike License.

CHAPTER 6. ATHENAS USER INTERFACE Hitting Ctrl - B displays that information for all the marked groups. If you mistakenly import a data group as the wrong record type, you can change it by selecting Change record type from the Group menu. You can only change between the various record types in energy, though. If you import a (k ) le as (E ), you will have to remove the group and re-import it.

Figure 6.6: The dialog for changing the record type of a group.

6.1.4

Using the mouse in the group list

You can turn on automated replotting when you select a new group by clicking on it in the group list, by selecting one of the items from the Group replot submenu at the bottom of the Plot menu, shown in Figure 6.7. With one of the options from that submenu selected, groups will be replotted when you click on them.

Figure 6.7: Setting up group replotting from a submenu under the Plot menu.

If you right click on any item in the group list, a context menu is posted, as shown in Figure 6.8 on the following page. The top two items in that context menu are for plotting. They work just like the red and purple plot buttons. The second two items are the same as the Group and Values menu. As mentioned above, double clicking on a group list item will rename it.
This work is licensed under the Creative Commons Attribution-ShareAlike License.

67

6.1.5 Detector groups and background groups

Figure 6.8: Clicking the right mouse button on a group list entry pops up this context menu.

6.1.5

Detector groups and background groups

Detector groups are group list entries that can only be plotted in energy. They are made from the numerator and denominator arrays that were used to make the data in the data group. When you choose Make detector groups from the Group menu, those two groups are added to the group list. Their plot multiplier parameters are set such they plot nicely with (E ) from their original data group. Detector groups can only be made in the session during which the original data was imported. Insucient information is saved to project les to be able to properly reconstruct the detector groups. You can plot the I0 array (Sec. 5.7.3 on page 57) without making a detector group at any time from the Plot menu. Background groups are group list entries that can be plotted in any space. A background group is created from the background function for a group when you choose Make background group from the Group menu. Creating a background group using a small rbkg parameter is one way to examine the atomic ne structure, or AXAFS, if you believe in such things.

6.2

Marking groups

As data are imported in athena, they are listed in the Data groups list. Each entry in list includes the name of the data set, the text of which acts something like a hyperlink in that clicking on that text will insert the analysis parameters for that group into the main window. Each entry also has a little purple check button which is used for marking the group. Much of athenas functionality revolves around marked groups. For example, the marked groups are the ones plotted when a purple plotting button is pressed, merging is done on the set of marked groups and, many of the data processing and data analysis chores use the marked groups. athena oers a number of simple tools for marking or unmarking groups. These are found in the Mark menu, as shown below, and also have keyboard bindings. Ctrl - a marks all groups, Ctrl - u unmarks 68
This work is licensed under the Creative Commons Attribution-ShareAlike License.

CHAPTER 6. ATHENAS USER INTERFACE all groups, and Ctrl - i inverts the markings such that the marked groups become unmarked and the unmarked ones become marked. The three buttons above the group list also serve to make all, mark none, and invert the marks.

Figure 6.9: The group marking options are found in the Mark menu. Making all groups, removing all marks, or inverting all marks can be done using the mark buttons at the top of the group list.

6.2.1

Using regular expressions to mark groups

There is one more tool which is considerably more powerful and exible. In the Mark menu, this last marking tool it is called Mark regex and it is bound to Ctrl - r . So, what does regex mean? Regex is short for regular expression, which is a somewhat formal way of saying pattern matching. When you mark regex, you will be prompted for a string in the echo area at the bottom of the athena window. This prompt is exactly like the one used to rename groups (Sec. 6.1.2 on page 62). This string is compared to the names of all the groups in the Data groups list. Those which match the string become marked and those which fail to match become unmarked. Let me give you some examples. In a project le containing various vanadium standards, the Data groups list includes These represent the various oxidation states of vanadium. The last item is an unknown sample which can be interpreted as a linear combination of the other ve samples. There are two scans of each sample, as indicated by the .1 and .2. To make plots of arbitrary combinations of spectra, you can click the appropriate mark buttons on and o. Using regular expression marking is quicker and easier. Ill start with a couple simple examples. If you want to mark only the vanadium foil spectra, hit Ctrl - r and then enter foil. To mark the V2O3 and V2O5, but none of the others, hit Ctrl - r and enter V2. In fact, you get to use the entire power of perls regular expression language (see the regular expression documentation at CPAN for all the details). This means you can use metacharacters symbols which represent conceptual aspects of strings. Here are a few examples:
This work is licensed under the Creative Commons Attribution-ShareAlike License.

69

6.3. PLUCK BUTTONS

Figure 6.10: A project with several vanadium standards imported.

To mark only the V2O3 and VO2 data: O[23]. That tells athena to mark the groups whose names have the letter O followed by either 2 or 3. To mark only the rst scans of each sample: 1$. The $ metacharacter represents the end of a word, thus this regular expression matches all groups whose name ends in the number 1. To mark only the foil and unknown data: foil|unknown. The | metacharacter means or, so this regular expression matches the groups with foil or unknown in the name. Actually this regular expression could have been much shorter, both [fu] and f|u would have worked in this case. Regular expressions are a large and fascinating topic of study, but beyond the scope of this document. Check out the link above read Wikipedias excellent article on regular expressions for more information. Mastering Regular Expressions by Jerey Freidl is a superb book on the subject. Any regular expression that works in perl will work for marking groups in athena (but if you know what (?{ code }) means and do something ill-advised with it, youll get no sympathy from me!). If you enter an invalid regular expression, athena will tell you. Regular expression marking is a wonderful tool, especially for projects containing very many data sets.

6.3

Pluck buttons

Almost every text entry box that takes an energy or wavenumber value as its parameter has a little button next to it which is decorated with a small blue X, one of which is highlighted in Figure 6.11 on the next page. These are the pluck buttons and their purpose is to grab a value directly from the plot. When you click one of these buttons, a message in the echo area prompts you to select a point from the plot, demonstrated in Figure 6.12 on the facing page. When you click on the plot, the x-axis value of the point you clicked on gets inserted in the associated entry box. 70
This work is licensed under the Creative Commons Attribution-ShareAlike License.

CHAPTER 6. ATHENAS USER INTERFACE Along with the pluck buttons in the main window, several data processing and data analysis dialogs use pluck buttons, as do the indicator (Sec. 5.4 on page 54) and point nder (Sec. 5.5 on page 55) plot options tabs.

Figure 6.11: Using the pluck button for the upper edge of the normalization range.

6.4

Plot styles

Plot styles are a mechanism for storing the contents of the plot options tabs. For example, you can save plotting parameters good for viewing XANES data and another set for viewing the full EXAFS spectrum. You can save any number of sets of parameters. When you save a set of parameters, you are prompted for a name. After that you can select a parameter set by name. These parameter sets are saved to disk, thus persist between sessions. All of the plot styles functionality is available by right clicking on the label that says Plotting options, which posts the context menu shown in Figure 6.13.

6.5

Using dierent k-weights

It is common practice in EXAFS to multiply (k ) by dierent k-weights. That is, the (k ) array is multiplied point-by-point by k-array. For k1 weighted data, (k ) at k=5 is multiplied by 5 and (k ) at k=10 is multiplied by 10. Similarly, for k2 weighted data, (k ) at k=5 is multiplied by 25 and (k ) at k=10 is multiplied by 100. This has the eect of amplifying the spectrum at the high-k end. Since the oscillations attenuate quickly after the edge, k-weighting is a way of making the high-k oscillations visible in a plot. A common approach to choosing a k-weight is to make the size of the oscillation roughly constant over the range of the data. Weighting data in that manner makes all parts of the data rage contribute equivalently. When Fourier transformed, the (R) spectrum is then dominated by the oscillatory structure of (k ). The
This work is licensed under the Creative Commons Attribution-ShareAlike License.

71

6.5. USING DIFFERENT K-WEIGHTS

Figure 6.12: (Left) After clicking on the pluck button, athena waits for you to click on the plot, which shows (E ) for BaTiO3 . Only the x-axis value of the click on the plot is used by the pluck button. (Right) After clicking on the point shown in Figure 6.12, the value of 243.684 is inserted as the value of the upper edge of the normalization range. This is clearly a better value for that parameter.

Figure 6.13: Clicking the right mouse button on the Plot options label pops up the plot styles menu.

72

This work is licensed under the Creative Commons Attribution-ShareAlike License.

CHAPTER 6. ATHENAS USER INTERFACE Fourier transform of an under-weighted spectrum may be dominated by a low-R peak representing the attenuation of the (k ) spectrum. k-weighting is also used to change the emphasis of dierent contributions to the measured (k ) spectrum. Low Z elements such as O and C have scattering amplitudes that peak and low-k and become quite small at high-k. Heavier elements, such as the transition metals, have small scattering amplitudes at low-k but continue to have large scattering amplitude at very high values of k. Very heavy elements, such as Pb or Sn, have minima in their scattering amplitudes around 5 to 7 A1 . (See page 21 of Matt Newvilles Fundamentals of X-ray Absorption Fine Structure.) By weighting (k ) with dierent k-weightings, the low and high portions of the (k ) spectrum can be dierently emphasized in a Fourier transform. Hopefully, doing so can help you better understand your data. The k-weighting is controlled by the bank of buttons labeled 0, 1, 2, 3, and kw, and located just beneath the purple plot buttons. This is highlighted in Figure 6.14 The buttons selected determines the k-weighting used in a plot of (k ) data or in a Fourier transform.

Figure 6.14: athenas controls for setting the amount of k-weighting in a plot or Fourier transform. The k-weight button labeled kw is used in conjunction with the arbitrary k-weight parameter. When the kw button is selected, the (k ) data are weighted by the value of the arbitrary k-weight . This can be used in a number of ways. The simplest is if you simply want a non-integer weight. If you want to overplot two dierent data groups each with a dierent k-weight, that can be done by setting the arbitrary k-weight appropriately.

6.6

Frozen groups

There is a feature that athena shares with almost any other computer program not just analysis programs, but any program. Soon after starting to use athena, you will do something silly and regrettable. Often this is as simple as changing a parameter to some bad value and forgetting what the good value was. To help mitigate this sort of problem, athena allows you to freeze data groups.
This work is licensed under the Creative Commons Attribution-ShareAlike License.

73

6.7. PALETTES A frozen group is one for which you cannot change its parameter values. When a group is frozen, the entry boxes associated with parameters become deactivated, which means that it is impossible to type in them. Furthermore, any global action such as constraining parameters or using the alignment dialog, will have no eect on the frozen group. The idea behind frozen groups is that, after working for a while to nd parameter values that you like, you can freeze the group to avoid inadvertently altering its parameters. The various group freezing functions can be found in the Values menu, as shown in Figure 6.15.

Figure 6.15: The frozen groups submenu is found under the Values menu. Several visual cues indicate that a group is frozen, including the green highlighting the group list and the use of italic text in the main menu.

The Freeze groups submenu oers a number of ways of selecting which groups to freeze. The frozen state of the current group can be toggled by typing Ctrl - f and all groups can be frozen or unfrozen by typing Ctrl - F or Ctrl - U . You can also freeze or unfreeze all marked groups. Finally, you can mark or unmark all groups using regular expressions. This works in the same manner using regular expressions to mark groups (Sec. 6.2.1 on page 67). There are various visual changes when a group is frozen. The highlight color in the group list changes from light red to light green. The text in the group list becomes italic. The labels for each section of parameters in the main window becomes italic. Finally, the label in the main window that normally says Current group is changed to Frozen group. When a group is frozen, direct edits of parameter values are disallowed. Frozen groups are skipped for algorithmic edits, such as parameter constraints or alignment. You can, however, still remove a frozen group from the project. Unfreezing a group is a simple as hitting Ctrl - f again.

6.7

Palettes

athenas palettes are a space where a variety of kinds of textual information are stored or displayed. They are mostly things that do not need to be displayed front and center, they are displayed when summoned 74
This work is licensed under the Creative Commons Attribution-ShareAlike License.

CHAPTER 6. ATHENAS USER INTERFACE from the Edit menu or by a keyboard shortcut.

Figure 6.16: The palettes window with the journal palette showing. This particular journal entry is taken from the alignment and merging demo le.

Ifet This is the space where you can interact directly with ifeffit. This palette contains a buer which displays every command sent to ifeffit as well as its response. At the bottom of the palette is a command line where any ifeffit command can be typed and entered. When focus is on the command line, the up and down arrow keys scroll through the history of commands typed at this command line. The ifeffit buer is very helpful for those wanting to learn how to use ifeffit directly. Typing Ctrl - 1 displays this palette. Titles This palette is used to display the title lines associated with the current data group. Any title lines interpreted as such in the original data le will be displayed here. You can also add your own comments. The contents of this palette will be written to the header of any output column data le. The titles are also stored with the data group in a project le. Typing Ctrl - 2 displays this palette. Data This palette is used to display the actual data le from which a data group was read. This can only be done during the session in which the data was initially imported into athena. A project le does not retain enough information to make use of this palette. This palette is the one and only way that athena can be used to modify a data le. You can edit your data le in this palette and save it back to disk. Use this capability with caution or, preferably, not at all. Typing Ctrl - 3 displays this palette. Echo This palette contains a buer which displays a history of messages displayed in the echo area. Typing Ctrl - 4 displays this palette. Macro This palette contains a tool for capturing ifeffit command and writing them to an output le. The concept is that you can capture commands for a particular operation and use the output le to create an ifeffit macro for use outside of athena. Typing Ctrl - 5 displays this palette. Journal This palette is one of athenas most important tools. It is a blank space in which you can write anything you want. The contents of this space are included when a project le is saved and imported into this space when a project le is imported. Thus, this serves as a journal for your data analysis. You can use this space to comment on your data and on the choices you make while working with your data. This enhances the value of the project le as a collaborative tool. Just as the project le is an excellent way to share data with a colleague, you can use the journal to exchange information or have a conversation with your colleague. Typing Ctrl - 6 displays this palette.
This work is licensed under the Creative Commons Attribution-ShareAlike License.

75

6.8. SETTING USER PREFERENCES

6.8

Setting user preferences

athena allows you to set an enormous number of preferences. Many dozens of things that could conceivably be congured can, in fact, be congured using this dialog. In any situation where is was not obvious to me that there was a best, most proper value for a parameter, I chose a default and made an entry for it in the preference dialog. The preference dialog is shown in Figure 6.17.

Figure 6.17: athenas preferences dialog. I am not going to explain this dialog in great detail. I am trusting that if you are suciently motivated to congure the behavior of athena to be something other than what comes out of the box, you will also be suciently motivated to follow your nose through the use of this dialog. The preference parameters are divided into related groups. For example, there are groups for background removal parameters, alignment parameters, colors, and so on. To view a group of preferences, click on the little cross sign next to the groups name in the list on the left side of the dialog. This will open a branch containing all the parameters in tat group. Click on one of them and it will be displayed in the controls on the left. Click on the default button to restore athenas default value or use the control below the default button to set a new value. That control will vary depending on the type of parameter. A text or numeric parameter will oer an entry box. A color parameter will oer a button which pops up a color selection dialog. A list parameter will oer a menu with the choices. And so on. The text area below these controls displays an explanation of the function served by that preference. Underneath that are buttons for setting or saving the parameters. The data about the preferences is contained in the athena.config which can be found in the disk space where athena is installed on your computer. This les is used to construct the preferences dialog. It is also the master le used when building athena from source to create the system-wide initialization le as well as a the part of athenas source code which sets the internal defaults for the parameters. It should never be necessary to work with the athena.config le. I just mention this for the benet of the interested reader. 76
This work is licensed under the Creative Commons Attribution-ShareAlike License.

Chapter 7

Setting parameters in Athena


The interface for setting parameter values in the main window is quite straight forward. For most parameters, you simply type values into the appropriate text entry box. For others, you select a value from a menu. Thats all ne and dandy, but imagine the situation where you have several dozen data groups imported into athena and you decide that you need to change the value of the rbkg parameter for every group. It would be extremely tedious to manually change the parameter value for each data group one by one. Fortunately there is a better way. In this chapter, we will see the various tools athena provides for constraining parameter values across data groups. We will also look in detail at how the e0 parameter is determined and how parameter defaults are set.

7.1

Constraining parameters between data groups

In athena, a constraint is the setting of a parameter to be the same for two or more data groups. (That word is used in a dierent context in artemis.) athena gives you a high level of control over the values of the parameters used to process your data. This control is very ne-grained in the sense that every group can have its own values for any parameters, thus allowing you to customize the data processing for each individual data group. Often, however, your data groups are suciently similar that it is expedient to use identical values for some or all parameters. Were you forced to click through the data groups setting each parameter value for each group individually, then athena would be very tedious to use. Fortunately, there are a number of tools dedicated to the problem of constraining parameter values.

7.1.1

Constraining individual parameters

The rst such tool is used to constrain individual parameters. As the cursor of your mouse passes over any of the labels for the menus or text entry boxes in the main window, you will see that the text of the label ashes a color change. This color change indicates that mouse clicks will have an eect. If you click the left mouse button, a hint about the purpose of that parameter is written to the echo area. A right mouse click posts a context menu, as shown in Figure 7.1 on the following page. The rst two items in this context menu are used to set the values of this parameter for other groups to its value for the current group. The current group is, of course, the one whose values are currently displayed in the main window and the one which is highlighted in the group list. This parameter value can be applied to all groups or to the set of marked groups. The set of marked groups are the ones with their little purple buttons in the group list checked. So here we see again one of the many uses of the mark buttons. 77

7.1.2 Constraining groups of parameters

Figure 7.1: Posting a context menu for an individual parameter.

The third option is to set the value of this parameter to the standard. This requires some explanation. In this context, the standard is set by marking one and only one group in the group list. Choosing to set a parameter value to the standard, then, applies the parameter value from the single marked group to the current group. Any group can be the standard setting a standard is as simple as clicking a mark button. If more than one group is marked, an explanatory error message is written to the echo area. The last two options involve default parameter values. The parameter can be reset to its default value. This is handy if you have changed a parameter and found yourself in a place where the data processing is obviously wrong. By resetting the parameter to its default, you can return to a sensible place. The nal option is to establish the current parameter value as the session default. The use of session defaults is explained in a later section (Sec. 7.3 on page 79). Several of the parameter context menus have a few more entries in their context menus: The importance context menu has entries for resetting the importance of all groups or marked groups to 1. The e0 context menu has several options for changing the value of e0 and a button for toggling the tying of energy and k parameters to the e0 value. All of the options will be explained in the next section (Sec. 7.2 on the facing page). The Fourier transform k-range context menu has an option for setting the upper bound to ifeffit suggestion, which is based on the level of noise in the data.

7.1.2

Constraining groups of parameters

In the main window, the parameters are grouped into sets of related parameters. All of the parameters associated with background removal are in one box, all the Fourier transform parameters are in another box, and so on. The labels at the top of each box are sensitive to mouse clicks much like the entry box labels. 78
This work is licensed under the Creative Commons Attribution-ShareAlike License.

CHAPTER 7. SETTING PARAMETERS IN ATHENA

Figure 7.2: Posting a context menu for a group of parameters.

A left click posts a helpful message in the echo area, while a right click posts a context menu, as shown in Figure 7.2. The various options behave much the same as in the individual parameter context menus, except that all of the parameters in the box are eected. This, then, gives you a way of constraining all background removal parameters or all Fourier transform parameters between groups. It also provides a way of restoring default values for a set of parameters or assigning a set as session defaults (Sec. 7.3 on page 79). The Project and Current group boxes do not have context menus as constraining most of those parameters between groups would not be sensible.

7.1.3

Constraining all parameters

The functionality which allows you to constrain parameter values between groups operates at three levels. We have seen the nest level of granularity, allowing individual parameters to be constrained. We have also seen how sets of parameters can be constrained. It is also possible to perform the same constraining operations on all parameters at once. These all-parameter operations are found in the Values menu, as shown in Figure 7.1 on the preceding page. Again, these operations work identically to the explanation above, except that every parameter is eected, with the exceptions of file and eshift , which would not be sensible to constrain.

7.2

Setting E0

The e0 is central to many of the chores that athena performs. Understanding how e0 is used and how it is set is essential to understanding how athena operates and essential to using athena well. By default, athena has ifeffit determine e0 and uses the value that ifeffit nds. ifeffits algorithm is to nd the rst peak of the rst derivative of (E ). To avoid settling on a spot in a noisy
This work is licensed under the Creative Commons Attribution-ShareAlike License.

79

7.2.1 Other ways of setting e0

Figure 7.3: The Values menu, which contains the options for constraining all parameters at once.

pre-edge, ifeffit makes a series of checks to verify that its guess for e0 comes after several points in the derivative of (E ) that are increasing in energy and is followed by several points that are decreasing. The details of this implementation are such that ifeffit often chooses a point that is slightly to the high energy side of peak that a person would choose, but it typically is a very good guess. The actual value of e0 is used for many things. It is compared to a table of edge energies to determine the value of the Z and edge parameters. It is the energy reference for the values of the normalization, pre-edge, and spline range parameters. And it is the edge energy in the autobk algorithm. The calibration (Sec. 9.1 on page 90) and alignment (Sec. 9.2 on page 90) dialogs can be used to rene the values for e0 . You can also edit its value directly by typing in its entry box. The right-click context menu for e0 and the Values menu have several options for other ways of setting e0 . There are a few situations where the default algorithm will fail. Very noisy data can result in a spurious identication of e0 . Materials which have two inections in the edge, such as zero-valent zirconium, might have the wrong inection chosen. Materials with huge edge peaks, such as K2 CrO4 , will have a point in the leading edge of the peak chosen rather than a point in the main edge.

7.2.1

Other ways of setting e0

Aside from the default method described above, athena oers a few other algorithms for setting e0 . Tabulated atomic value The tabulated value of the edge energy of the zero-valent element will be used. To determine the element, a transitory value for e0 will be found using ifeffit. Once Z and edge are found, e0 is set to the tabulated value. Fraction of edge step In this algorithm, a transitory value for E0 will be found using ifeffit. The data are normalized and the point on the edge which has a height equal to a specied fraction of the edge step is chosen as 80
This work is licensed under the Creative Commons Attribution-ShareAlike License.

CHAPTER 7. SETTING PARAMETERS IN ATHENA e0 . This normalization is iterated up to 5 times to settle on a stable value. The value of the fraction is set by the Bkg fraction preference, which is 0.5 by default. Zero crossing Again, a transitory value for E0 will be found using ifeffit. The second derivative of (E ) is computed and athena searches in both directions in energy for the nearest zero-crossing of the second derivative, which is then used for e0 . Peak of L edge white line A transitory value for E0 will be found using ifeffit. The peak of the white line is then found as the zero crossing of the rst derivative of (E ) after the initial value of E0 and is used as e0 . Since all of these additional algorithms rely on ifeffits initial guess of e0 , each is subject to the same caveats given for the default algorithm. The Bkg e0 parameter can be set to one of these four options, setting the default algorithm for determining e0 . When the Bkg ledgepeak parameter is set to an element symbol, athena will set e0 to the peak of the white line by default for any LIII or LII edge data from an absorber above that element. Setting this preference to 0 tells athena to use the algorithm set by Bkg e0 to determine e0 as data re imported. Submenus under the Values menu (Sec. 7.3 on the facing page) can be used to set E0 using one of these algorithms for the current group, all groups, or the set of marked groups.

7.3

Default parameter values

When data is imported in athena, all parameters are set to their default values. For most data, these defaults are reasonable in the sense that using them will result in a decent rst stab at background removal and Fourier transform. The sequence of choices athena makes in setting those defaults is somewhat complicated and highly congurable. By understanding how the defaults are chosen, you can tune athena to do a good job processing your more of your data without your intervention. The choices of default values for each parameter is made by walking through a hierarchy of decisions, each subsequent level overriding the previous level. The rst decision is made by consulting the program preferences (Sec. 6.8 on page 73). The program preferences are read from two initialization les when athena starts. The rst initialization le is a system-wide le that always contains athenas fresh-outof-the-box parameter defaults. The second initialization le is your own personal collection of preferences. These personal preferences are typically set using the preferences dialog, which is found in Settings menu. The values found among the personal preferences will always override the system-wide set. Many of the parameter defaults which can be set in the preferences dialog have the option of being set to relative values rather than absolute values. For example, the Fft kmax parameter can be set to a value such as 12. It can also be set to a value like -1, which tells athena to select the value 1 wavenumber from the end of the data as the value for Fft kmax . All of the range parameters can be set to values which are relative to the extent of the actual measured data. These options are explained in the parameter description on the preferences dialog. The preferences can be overridden by setting session defaults. The session defaults can be set for individual parameters in the right-click context menu for each parameter (Sec. 7.1.1 on page 75), for each group of parameters (Sec. 7.1.2 on page 76), or for all parameters in the Values menu. The session default is taken from the value for the current group and is then used as the default parameter value for each subsequent data group as it is imported. These values do not persist between athena session. Once you close athena, the set of session defaults is lost. The concept behind session defaults is to provide a mechanism for handling data that is not well handled by the preferences. For example, on the beamline computer I typically have athenas preferences tuned to work well for the uranium LIII data my group usually collects. When working on other edges, I will often set session defaults once I get a feeling for what parameter values work well for those data.
This work is licensed under the Creative Commons Attribution-ShareAlike License.

81

7.3. DEFAULT PARAMETER VALUES Overriding the session defaults is the data preprocessing mechanism (Sec. 3.5 on page 26). When data preprocessing is performed and the option to set parameter values to the preprocessing standard is selected, those values will override all session defaults and preferences.

82

This work is licensed under the Creative Commons Attribution-ShareAlike License.

Chapter 8

Data export
Although athena handles all of your XAS data processing chores, there are many other things you may want to do with you data, such as preparing beautiful plots for publication or importing data into artemis. This chapter explains the various kinds of output les available in athena. There are three main types of export les, each of which is explained on the following pages: Column data les useful for importing into other plotting programs Project les which capture the entire state of your current work in athena. These can be re-imported into athena, imported into artemis, or emailed to your collaborator in another time zone. Report les summarizing parameter values for all the data groups in your project. These report les can be imported into spreadsheet or a database program.

8.1

Column output les

After doing a lot of analysis, you will eventually need to make beautiful pictures for publication. As a glance at any of the screenshots in this document will attest, the graphical output of athena is adequate but far from beautiful. Fortunately, athena can export your data in a variety of ways and in a format that can be imported easily into almost any other program, such as a spreadsheet or a graphics package such as Origin or Kaleidegraph. The current data set the one marked in red in the group list and the one whose parameters are displayed in the main window can be saved in a number of ways. The various choices are listed under the File menu, as seen in Figure 8.1 on the next page. Note that (k ) data can be saved with various k-weightings using the entries in the submenu. The columns in the (E ) output le are: 1. 2. 3. 4. 5. 6. 7. energy (E ) background derivative of (E ) I0 pre-edge line post-edge line The columns in the norm(E) output le are: 1. energy 83

8.1. COLUMN OUTPUT FILES

Figure 8.1: Exporting a column data le for a group.

2. 3. 4. 5.

normalized (E ) normalized background derivative of normalized (E ) I0 The columns in any of the (k ) output les are:

1. k 2. k-weighted (k ) 3. Fourier transform window The (R) output le contains both parts of the complex Fourier transform, as well as the magnitude and phase. That is, of course, redundant, but its also convenient. The columns are: 1. 2. 3. 4. 5. 6. R real part of (R) imaginary part of (R) magnitude of (R) phase of (R) back transform window

For the sake of clarity, we use the letter q to represent Fourier ltered wavenumber. The (q ) output le also contains both parts of the complex back transform, as well as the magnitude and phase. 1. q 2. real part of (q ) 3. imaginary part of (q ) 84
This work is licensed under the Creative Commons Attribution-ShareAlike License.

CHAPTER 8. DATA EXPORT 4. magnitude of (q ) 5. phase of (q )

The derivative output le has been discontinued as of version 0.8.056. The (E ) and normalized (E ) les now have columns containing the derivative and derivative of the normalized spectrum, respectively. In certain situations, it is much more convenient to write column data les containing data from many groups. This is done with the help of the mark buttons. The data from each of the marked groups can be saved in a variety of forms using the saved marked groups submenu, as shown in Figure 8.2.

Figure 8.2: Exporting column data les for the set of marked groups.

The output le will contain the x-axis value (i.e. energy, k, R, or q) in the rst column. The remaining columns will contain each of the marked data groups, in the order they appear in the group list. The nal column output option is to export each of the marked groups as a single data column le of the sort described above. When you select one of the output le types shown in Figure 8.3 on the next page you are prompted to select a directory, as in Figure 8.4 on the following page. Each marked group will be exported to a le in that directory with a le name formed from the group label. All of the output les discussed on this page have a header of the form shown below. The rst line identies the version of athena used to write the le. The second line identies the type of le. The next several lines summarize all the parameters from the main window. The remaining lines are any header les recognized by athena from the original data le.
This work is licensed under the Creative Commons Attribution-ShareAlike License.

85

8.1. COLUMN OUTPUT FILES

Figure 8.3: Exporting column data les for each of the marked groups.

Figure 8.4: Folder selection dialog for exporting each marked group. Note that, at this time, there is no way to create a new folder from within this widget. Your target folder needs to already exist.

86

This work is licensed under the Creative Commons Attribution-ShareAlike License.

CHAPTER 8. DATA EXPORT


# Athena data file -- Athena version 0.8.052 # Saving fe.300 as mu(E) # . Element=Fe Edge=K # Background parameters # . E0=7106.497 Eshift=0.000 Rbkg=1.000 # . Standard=0: None # . Kweight=1.0 Edge step=2.825 # . Fixed step=no Flatten=yes # . Pre-edge range: [ -150.000 : -30.000 ] # . Pre-edge line: 3.2697 -0.00046675 * E # . Normalization range: [ 50.000 : 1836.447 ] # . Post-edge polynomial: 32.673 -0.006723 * E + 3.5408e-07 * E^2 # . Spline range: [ 0.000 : 1856.458 ] Clamps: None/Strong # Foreward FT parameters # . Kweight=0.5 Window=kaiser-bessel Phase correction=no # . k-range: [ 2.000 : 21.900 ] dk=1.00 # Backward FT parameters # . R-range: [ 1.000 : 3.000 ] # . dR=0.00 Window=kaiser-bessel # Plotting parameters # . Multiplier=1 Y-offset=0.000 # . # XDAC V1.2 Datafile V1 # "fe.300" created on 10/4/02 at 9:37:52 AM on X-11A # ring energy= 2.58 GeV # E0= 7112.00 # NUM_REGIONS= 3 # RB= -200 -20 20 22k # RSS= 5 0.5 0.05k # PP= 2 2 2 # settling time= 0.50 # offsets= 9925.80 9914.40 # gains= 7.00 7.00 # iron foil, I0: 50N2, It:N2, 300K #------------------------

8.2

Project les

The most important type of output le is the project le. A project le contains all of the data you have imported, all of the parameters associated with each data le, the content of the journal, and several other collections of important data. All of this gets saved in a single, easily transportable le. The primary purpose of the project le is to save you work. When you open a saved project le, all of the data and all of their parameters are imported into athena, returning athena to the state it was in when saved the project le. artemis ( athenas sister program intended for analysis of EXAFS data) can read these project les. Thus the project le is the best way of moving your data between the two programs. Even better, the project le is a form of collaboration. The format of the le is platform independent. A project le written on one computer can read on another computer, even if those computers use dierent operating systems. A project le can be burned to a CD, placed on a web site, or sent to a collaborator by email. To save a project le, simply select one of the File menu options highlighted in Figure 8.5 on the next page. The rst two options saves the entire current state of athena. If the project has already been saved, the Save project option overwrites the previous le with the new state of your project. Hitting Ctrl - s does the same thing. Clicking on the modied indicator the other highlighted region in the screenshot
This work is licensed under the Creative Commons Attribution-ShareAlike License.

87

8.2.1 The project le format and compatibility with older versions

Figure 8.5: Saving a project le.

also saves the project. Alternately, you can select Save project as... and you will be prompted for a new le name for the project. The nal option will write only the marked groups to a project le. You can think of this as a sort of sub-project le. This is another of the many ways that the group markings are used by athena.

As with any software, you should save your work early and often. athena and ifeffit have their aws. It would be a shame to discover one of them after having done a lot of unsaved work.

8.2.1

The project le format and compatibility with older versions

The athena project le is designed to be quick and easy for athena to read. Unfortunately, the le format is not particularly human-friendly. Most of the lines of the project le are in the form written out by perls Data::Dumper module. This freezes athenas internal data structures into perl code. When the project le is imported, these lines of perl code are evaluated. (This evaluation is performed in a Safe compartment, i.e. a memory space with restricted access to perls system functionality. This provides a certain level of protection against project les constructed with malicious intent.) Starting with version 0.8.050, athena writes out its project les using compression. The les written are identical to the format used by the popular gzip program, using the highest level of compression. athena and artemis will import these les or uncompressed project les from earlier versions of athena in a transparent manner. It is quite possible that the user will never even realize that this change in the project le format occurred. 88
This work is licensed under the Creative Commons Attribution-ShareAlike License.

CHAPTER 8. DATA EXPORT One possible problem is if someone using the latest version of athena wants to share a project le with someone who is not using the latest version. In that case, the project le will be written using compression, but the person with the older version will not be able to import it into his version of athena. The best solution to this problem is to encourage your colleague to upgrade to the latest version of athena. Barring that, there are two other possibilities. The better solution is to rename the le from whatever.prj to whatever.prj.gz then use a decompression program to decompress the project. On unix, gzip is a good choice. On the Mac, there are a number of options, including gzip. On Windows, many popular compression and archiving programs can deal with gzip compressed les. Simply run the renamed le through the decompression program and use the resulting le. There are no changes to the textual content of the project le the only change is that athena uses compression by default. The less good solution is for the person writing the project le to set the General compress prj preference parameter to false. This will get you over the hurdle of communicating with your colleague, but it is an inferior solution. Compression reduces the size of the project le by up to a factor of 4, which is a very nice feature indeed.

8.3

Parameter report les

The nal kind of output le is a parameter report. In the Edit menu, you will nd a submenu labeled Write a report, shown in Figure 8.6. The various options in that submenu write out les containing the parameters from the main window.

Figure 8.6: Writing a report on data groups in athena. The rst two options write all the parameters to an Excel le, the second two options write the same information to a simple comma separated value le, the next two options write the information to a plain text le. In each case, you have a choice of saving parameters from all groups or only the marked groups. The last option in the list is a way of moving data from athena to the Xt analysis program. If you
This work is licensed under the Creative Commons Attribution-ShareAlike License.

89

8.3. PARAMETER REPORT FILES

Figure 8.7: An example of the Excel spreadsheet output displayed in OpenOce.

know what that is, you probably already know how to use this output le. If you have no idea what I am talking about, it is unlikely to matter to you. Really.

90

This work is licensed under the Creative Commons Attribution-ShareAlike License.

Chapter 9

Data processing
athena oers a variety of data processing chores chores which modify the data in some way to prepare it for more extensive analysis. With the exception of merging data groups, all data processing features are accesses through the Data menu, shown in Figure 9.1. All the entries in the Data menu, replace the main window with a dialog specially designed for the data processing chore. You can work on more than one data group in any dialog without having to return to the main menu. Clicking on a group label in the group list will make that group current, display parameters appropriate to the data processing dialog, and plot the data in some appropriate manner. When you are nished using the data processing dialog, you can press the button labeled Return to the main window. Doing so will close the special dialog and redisplay the main window.

Figure 9.1: The Data menu is used to access almost all data processing dialogs.

91

9.1. CALIBRATING DATA GROUPS

9.1

Calibrating data groups

Data calibration is the process of selecting a point in your data as the edge energy and applying an energy shift to your measured data so that the selected point is at a specied value. For metals, that value is usually the tabulated edge energy.

Figure 9.2: This is the calibration dialog.

When this dialog in Figure 9.2 starts, the current group is plotted as the derivative of (E ). The menu allows you plot the data as (E ), normalized (E ), derivative of (E ), or second derivative of (E ). If your data is noisy, you may nd it helpful to apply smoothing. ifeffits simple three-point smoothing algorithm is applied the number of times indicated, then the data are replotted. The selected point is shown in the plot with the orange circle, as shown in Figure 9.3 on the next page. You can type in a new value in the Reference box or click the Select a point button then click on a point in the plot. By default, the Calibrate to box contains the tabulated edge energy of the absorber measured for these data, but that too can be edited. When you plot the second derivative, the Find zero crossing button becomes enabled. This nds the zero crossing of the second derivative that is nearest to the current value of the reference point. When plotting the second derivative, smoothing helps, even for fairly clean data. When you click the Calibrate button, the values of e0 and eshift are set for the current group such that the selected point in the data takes the calibration value.

9.2

Aligning data groups

Aligning data is the process of moving a data group in energy onto an absolute energy grid dened by some standard. In athena that standard is chosen fairly arbitrarily it is simply one of the other groups in the group list. The alignment is done by adjusting the eshift parameter. 92
This work is licensed under the Creative Commons Attribution-ShareAlike License.

CHAPTER 9. DATA PROCESSING

Figure 9.3: As you work on calibrating your data, the current reference point is indicated by a small orange circle.

This adjustment can be done simply by manually editing the eshift parameter, but tools exist on the alignment dialog, shown in Figure 9.4 on the following page, to make this somewhat easier. There are several variations on how the alignment is performed and visualized. As the alignment proceeds, it can be plotted as (E ), normalized (E ), the derivative of (E ) (as shown in Figure 9.5 on the next page), or the smoothed derivative of (E ). A three-point smoothing function is applied three times to the derivative of the (E ) if that plotting option is selected. The alignment is always done by moving the current data group and keeping the standard xed. The standard is selected from the menu at the top of the dialog. This menu contains the entire contents of the group list, excluding those groups that cannot be plotted in energy. You can perform the alignment by hand by clicking any of the buttons labeled with numbers. Those buttons will move the current group up or down in energy by the amount on the buttons label. Alternately, you can type an energy shift value in the box that displays the current value of eshift . You can click these buttons until the data line up nicely. Clicking the Auto align button performs a simple t in an attempt to align your data to the standard. The t is evaluated over an energy range from 50 volts below the edge to 100 volts above. The parameters in the t are an energy shift and an overall scaling term. The function minimized is the dierence between the derivative of the standard and the derivative of the current group modied by the tting parameters. The energy shifted data is interpolated onto the energy grid of the standard for the t. This algorithm works quite well for data that are fairly clean and are misaligned by less than 5 or 10 volts. For noisy data, the t may be more successful if you choose to t smoother data by selecting that option from the menu labeled Fit as:. For very misaligned data, you may need to manually set an approximate value for eshift before clicking the Auto align button. You can apply the automated alignment algorithm to many groups in sequence. First mark all the groups that need to be aligned, then click the button that says Align marked groups. This may take a few minutes, depending on how many groups you have marked, but at the end hopefully all of your data will be nicely aligned. This alignment algorithm is the same as the one used by the preprocessing feature (Sec. 3.5.2 on page 27) of the column selection dialog. If you have imported a reference channel (Sec. 3.4 on page 25) with your data, you can use this dialog to align the reference channels. This puts your real data on a proper absolute energy grid, which is very important for comparing edge energies in XANES studies.
This work is licensed under the Creative Commons Attribution-ShareAlike License.

93

9.2. ALIGNING DATA GROUPS

Figure 9.4: The data alignment dialog.

Figure 9.5: As you work on aligning your data, the current data group is plotted along with the standard. This gives you visual feedback on how well your data are aligned.

94

This work is licensed under the Creative Commons Attribution-ShareAlike License.

CHAPTER 9. DATA PROCESSING

It is very important to align your data well. Many other parts of athena assume that you have already done a good job of aligning the data. Merging (Sec. 9.12 on page 110) and linear combination tting (Sec. 10.1 on page 113) are examples of this.

A common approach to processing data that I use is to import a rst scan and to decree that one as the standard. I will calibrate the reference channel of that rst scan. That puts the reference of the rst scan at its proper place on an absolute energy scale. Once that is calibrated, I will import the rest of my data from that series of measurements and also import a reference channel for each one. I will then align each of the reference channels to the reference channel of my designated standard. If the data is of high quality, I will typically use the pre-processing feature while importing all of my data. In many cases, following this procedure and trusting the automated alignment is sucient to prepare my data for merging and further analysis.

9.3

Dispersive XAS

In a dispersive XAS experiment a curved crystal polychromator replaces the the standard monochromator. By virtue of being curved, a polychromator passes a much broader band of energies than a monochromator. The curved geometry means that dierent parts of the crystal are at dierent angles relative to the incident white beam, so each part of the crystal passes a dierent energy. The curvature also serves to focus the polychromatic beam to a spot at some distance from the crystal. The details of the band pass and the focal distance depend on the energy range of the experiment. The sample is placed at the focal spot. All the energies pass through and interact with the sample. After the sample, the energies splay out as the beam defocuses. The dispersive data is measured as a function of pixel position on an areal detector. Each pixel subtends an energy range of the polychromatic beam.

9.3.1

The dispersive data processing algorithm

These data must be calibrated by converting pixel position to energy. This is done by measuring a well-known standard and the unknown data in the identical experimental conguration. The standard is compared to the same sample as measured on a normal XAS beamline. The dispersive and standard data are compared. Pixel position p is converted to energy by a quadratic function: E = A + B p + C p2 (9.1)

The parameters A, B, and C are determined by tting the standard measured in dispersive mode to the standard measured normally. That set of parameters is then applied to all the data measured under the same experimental conditions. In this example, taken from the demo le (Sec. 2.2 on page 14) for dispersive data calibration, data was measured on copper sulde along with a copper foil used as the standard. The rst item in the group list is the data measured copper foil on a conventional beamline. The third item is the copper foil data measured in dispersive mode. The second item is that same measurement calibrated by the beamline scientist and can be used to test athenas implementation. The remaining data are a sequence of dispersive measurements made on copper sulde. The conventionally measured data is selected as the Standard in the menu at the top of the page in Figure 9.6 on the next page. The t using the equation above is quite sensitive to the starting conditions. It is therefore prudent to adjust the linear term by hand. The initial guess for the calibration terms is shown in red along with the
This work is licensed under the Creative Commons Attribution-ShareAlike License.

95

9.3.2 Using the dispersive data correction

Figure 9.6: The dispersive XAS calibration dialog.

conventional data in blue in Figure 9.7 on the facing page. Changing the linear term to 0.29 and clicking the Reset oset button results in the green spectrum, which is much closer to the standard data. The Reset oset re-evaluates the oset term to roughly align the rst peak of the rst derivative of the standard with the peak of the dispersive spectrum calibrated with the new linear term. These two terms will stay strictly related as long as the constrain oset to linear term button. Once you have a linear term and oset that are close to correct, unclick that button and try tting by clicking the Rene alignment parameters button. The resulting (E ) spectrum, shown in Figure 9.8 on the next page, looks very much like the conventional data. For these data, the dispersive (k ) spectrum is almost identical to the conventional spectrum. This gives some condence in using the tted conversion parameters for the copper sulde data. Armed with these parameter values, we can convert the copper sulde data to energy. A converted dispersive measurement can be made into a data group and inserted into the group list by pressing the Make data group button. The Convert all MARKED pixel groups button will apply the conversion parameters to all marked data groups (Sec. 6.2 on page 66). Note that the algorithm employed by athena is a reimplementation of an algorithm long used at ESRF beamline ID24.

9.3.2

Using the dispersive data correction

By default, the dispersive data correction tool is disabled in athena. The reason is that the test made on each imported data le to determine whether it is contains dispersive data is rather time consuming. Since rather few of athenas users measure dispersive data, it is better to disable that time-consuming test. Because it is disabled, you will see that the entry for Calibrate dispersive XAS is greyed out in the Data menu. To enable the dispersive data correction, go to the preferences dialog (Sec. 6.8 on page 73) and set the Pixel do pixel check parameter to true. You will now be able to access the dispersive data correction 96
This work is licensed under the Creative Commons Attribution-ShareAlike License.

CHAPTER 9. DATA PROCESSING

Figure 9.7: The copper foil calibrated using the default parameters and a reasonably close guess.

Figure 9.8: The t to the copper standard.

This work is licensed under the Creative Commons Attribution-ShareAlike License.

97

9.4. DEGLITCHING DATA dialog.

9.4

Deglitching data

Occasionally your data has spurious points that are obviously dierent from the surrounding points. These so-called glitches can be caused by a variety of issues involving the monochromator, the electronics, or the sample itself. In principle, it should not be necessary to do anything at all about glitches. A feature in the data that is only one or two points wide necessarily contributes a high frequency signal to the data. Since the data are treated using Fourier techniques, these high frequency additions to the data should have scant impact on the data. In practice, there are a variety of ways that glitches like those shown on the right in Figure 9.10 on the facing page can impact the processing of the data. Certainly, large glitches are unsightly and have an aesthetic impact on the presentation of your data. The process by which glitchy points are removed from the data is called deglitching. Yes, I also think thats a funny sounding word.

Figure 9.9: The deglitching dialog.

athenas approach to deglitching involves simply removing the points from the data. No eort is made to interpolate from the surrounding points in an eort to replace that point with a presumably more appropriate value. The reason that no interpolation is done is that EXAFS data are typically measured on a grid that is oversampled. When the data are converted from (E ) to (k ) as part of the background removal, the data are rebinned onto the standard k-grid. Since a rebinning is performed later in the data processing, there is no reason to interpolate at the time of deglitching. Deglitching only removes points from the data in athenas memory. The data on disk are never altered. There are two methods of deglitching oered by athenas deglitching dialog, shown in Figure 9.9. The rst involves selecting and removing the glitches one by one. The points are selected by clicking the Choose a point button then clicking on the glitch in the plot. After clicking on the plot window, the selected point 98
This work is licensed under the Creative Commons Attribution-ShareAlike License.

CHAPTER 9. DATA PROCESSING is indicated with an orange circle, as on the left of Figure 9.10 on the facing page. Clicking the Remove point button removes that point from the data, shown in the bottom panel.

Figure 9.10: (Left) This is an example of data the needs deglitching. In this case, there was a problem with data channels not arriving at the measurement computer in the proper sequence. This timing problem resulted in occasionally spikes in the data. (Right) A point has been selected for removal. The point agged for removal is indicated with a little orange circle. (Bottom) The selected point has been removed from the data. The deglitching margins are displayed along with the data. The second method for removing glitches is more automated. In the gure above, the deglitching margins are shown by the orange lines. Those margins are drawn between the specied minimum and maximum energy values. The lines are drawn a set amount above and below the post-edge line used to normalize the data. The separation between the post-edge line and the margins is given by the value in the tolerance box. When you click the Remove glitches button, and points that within the energy range of the margins but which lie above the upper margin or below the lower margin are removed from the data. These margins can also be drawn in the pre-edge region using the pre-edge line. There is no way to use margins in an energy region that includes the edge. This technique is handy in that it quickly removes many glitches in a situation like the one shown. It is very dangerous, however, if not used with care. If the margins extend into the white line region or are so tight around the post-edge line that the oscillatory structure crosses the margins, this technique will happily remove good points from the data. So set your margins well.
This work is licensed under the Creative Commons Attribution-ShareAlike License.

99

9.5. TRUNCATING DATA A useful variation of the point-by-point technique involves plotting the (E ) data. This can only be done for glitches above the edge, but it can be a very useful technique for removing small glitches from the data. In Figure 9.11 we see (E ) data for U3 O8 that appear ne.

Figure 9.11: (Left) (E ) data for U3 O8 that have a tiny glitch hidden in the high energy region. (Right) Plotted as (k ), the glitch at about 12 A1 in these (k ) data is clearly seen.

When the (E ) is displayed, the k-weight value specied by the k-weight controls is used. From there, the point-by-point technique is identical to how it used with (E ) data. The advantage is that small glitches might be easier to see and to pluck from the data when the data is plotted as (E ). The point-by-point deglitching algorithm works on the (E ) data in the same manner as for (E ) data. Points are selected by clicking on the plot, then removed by clicking the Remove point button.

9.5

Truncating Data

If your data does something odd at one end of the scan, the easiest solution might be to simply trim it away. The truncation dialog in Figure 9.12 on the facing page allows you to chop data before or after a selected value. The menu is used to tell athena whether points should be trimmed from before or after the selected point. The point can be chosen by typing in the box or by clicking the pluck button then clicking on the plot. When you select a point, it is indicated with a vertical line, as shown in Figure 9.13 on the next page. To remove the data before or after that line, click the Truncate data button. Sometimes the issue is not simply that the data are icky after a certain point. Sometimes your sample has elements with nearby edges, thus limiting the range over which you can actually measure the data. An example is shown in Figure 9.14, the Ti K edge is at 4966 eV and the Ba LIII edge is at 5247 eV. A careless choice of spline and normalization range will lead to a data processing disaster. Of course, truncation is not the only way of dealing with this issue. A careful choice of the spline, pre-edge, and normalization ranges is usually sucient to treat any strange features at the beginning or end of the data set. So which is better? I think its a matter of preference. As long as you understand what you are doing and process all your data in a consistent, defensible manner, you can use either approach. This truncating algorithm is the same as the one used by the truncating feature (Sec. 3.5.2 on page 27) of the column selection dialog. 100
This work is licensed under the Creative Commons Attribution-ShareAlike License.

CHAPTER 9. DATA PROCESSING

Figure 9.12: The truncation dialog.

Figure 9.13: Tin oxide data with some spurious points near the end of the scan.

This work is licensed under the Creative Commons Attribution-ShareAlike License.

101

9.6. REBINNING DATA GROUPS

Figure 9.14: The Ti K and Ba LIII edges of BaTiO3 .

9.6

Rebinning data groups

Some beamlines oer the option of slewing the monochromator continuously from the beginning of the scan to the end. A typical implementation of this works by driving the mono at a given speed and reading the measurement channels continuously. The signal is integrated for bins of time. After each time interval, the integrate signals are stored in a buer. At the end of the scan, the buer is dumped to disk. At my old beamline (MRCAT, Sector 10 at the APS), a typical EXAFS scan measured in this mode takes under 3 minutes. The drawback of this measurement mode (other than the generation of tons of data that needs to be analyzed!) is that the data are vastly over sampled. The energy grid is typically 0.3 to 0.5 eV. That is ne in the edge region, but much too ne for the EXAFS region. The dialog shown in Figure 9.15 on the facing page allows you to specify a simple three-region grid. Typically, the pre-edge region is sparse in energy, the edge region is ne in energy, and the EXAFS region is uniform in wavenumber. The grid sizes and the energies of the boundaries are entered into their entry boxes. You can view the results of the rebinning by pressing the Plot data and rebinned data button. Clicking the Make rebinned data group button performs the rebinning and makes a new group. This group gets placed in the group list and can be interacted with just like any other group. You can bulk process data by marking a number of groups and clicking the Rebin marked data and make groups button. This may take a while, depending on how many groups are being processed. This deglitching algorithm is the same as the one used by the rebinning feature (Sec. 3.5.1 on page 27) of the column selection dialog. This uses a boxcar averaging to put the measured data on the chosen grid. This has the happy eect of cleaning up fairly noisy data, as you can see in Figure 9.16 on the following page.

9.7

Smoothing data

Smoothing data is usually a bad idea. The way to improve noisy data is to measure more of it and rely upon the central limit theorem to work its magic. Smoothing is usually little more than an aesthetic x and it introduces distortions to your data that become serious sources of systematic uncertainty in any later attempts to analyze the smoothed data. 102
This work is licensed under the Creative Commons Attribution-ShareAlike License.

CHAPTER 9. DATA PROCESSING

Figure 9.15: The rebinning dialog.

Figure 9.16: Quick scan data that have been rebinned onto a normal EXAFS energy grid.

This work is licensed under the Creative Commons Attribution-ShareAlike License.

103

9.8. CONVOLUTING DATA GROUPS Be that as it may, athena gives you a few smoothing options. One applies ifeffits three-point smoothing algorithm repeatedly to your data. The number of iterations can be set using the number selection control. The other is a wacky sort of Fourier thing that I once wrote. On occasion it works ne, usually it sucks. Eventually I plan to implement a Savitsky-Golay lter. You can overplot the data and the smoothed data using the button on the left, as shown in Figure 9.17 on the next page. The button on the right makes a group out of the smoothed data and places it in the group list.

Figure 9.17: The smoothing dialog.

9.8

Convoluting data groups

This is one of athenas odder utilities. It takes perfectly ne normalized (E ) data and makes it worse by adding articial broadening, articial noise, or both. The broadening can be a Gaussian or a Lorentzian convolution by the selected width in energy. The noise is randomly generated using an epsilon that is chosen as a fraction of the size of the edge step. Like other dialogs, there is a button for plotting the data along with its modication and another for turning the modied data into a data group listed in the group list. These are shown in Figure 9.19 on the following page. An example of broadened data is shown in on the left in Figure 9.20 on the next page and an example of data with articial noise is shown on the right.

9.9

Deconvoluting data groups

104

This work is licensed under the Creative Commons Attribution-ShareAlike License.

CHAPTER 9. DATA PROCESSING

Figure 9.18: Some noisy gold oxide data that has been smoothed using the iterative smoothing algorithm.

Figure 9.19: The convolution dialog.

This work is licensed under the Creative Commons Attribution-ShareAlike License.

105

9.10. SELF-ABSORPTION APPROXIMATIONS

Figure 9.20: (Left) Iron foil data broadened by 1 eV. (Right) Iron foil data with a bit of articial noise added.

Spectral deconvolution is on athenas to do list.

9.10

Self-absorption approximations

The statement that (E ) measured in uorescence is the ratio of the signals on the uorescence and incident ion chambers is only true in the limit of very thin samples or very dilute samples. For thick, concentrated samples, the depth into which the incident beam can penetrate changes as ne structure of (E ) changes. As the oscillatory part wiggles up, the penetration depth diminishes. As it wiggles down, the depth increases. This serves to attenuate the oscillatory structure. Ideally, all your samples that must be measured in uorescence should be either suciently thin or suciently dilute that your data is unaected by this self-absorption eect. Sometimes, the constraints of the sample are such that self-absorption cannot be avoided. In that case, you need to gure out what to do at the level of the data analysis to nd the correct answer in the face of this problem. One solution is presented here. The self-absorption correction dialog oers four dierent algorithms to approximate the eect of selfabsorption using tables of x-ray absorption coecients. One of them works on XANES data, while all four can be used to correct EXAFS data. One of the algorithms works well for samples that are not in the innitely thick limit. These various algorithms are taken from the available literature and are oered to allow you to compare. The example I show here are particularly well suited to this sort of correction. In both cases, we have a way to evaluate the success of the correction. In general, it can be dicult to guarantee the success of the correction, particularly if the entire composition of the sample is not well known. That means that, in practice, this sort of correction is not always useful. But when it is, its very useful indeed. It is also important to understand that the self-absorption eect only eects the amplitude of your EXAFS data, not the phase. Thus even if you are unable to properly correct, you can still analyze your EXAFS data for bond lengths. 106
This work is licensed under the Creative Commons Attribution-ShareAlike License.

CHAPTER 9. DATA PROCESSING

9.10.1

Correcting XANES data

The self-absorption dialog in Figure 9.21 allows you to choose between the four algorithms and to provide the parameters of the correction.

Figure 9.21: The self-absorption dialog. In this example of correcting XANES data, ammonium sulfate was dissolved in water at three dierent molarities: 0.1, 0.47, and 0.94. The correction algorithm requires a complete description of the sample, so we need to determine the ratio of water to ammonium sulfate.
1 amu = 1.6605 x 10^-27 kg 1 mole = 6.0221 x 10^23 particles 1 water molecule is 18 amu = 2.988 x 10^-26 kg 1 mole of water is .01800 kg 1 liter of water = 1 kg water, so 1 liter is 55.5555 moles

Adjusted for the density change upon adding the solute, there are about 54.8 moles of water in the solution So the formulas for these three molar solution are ((NH4)2SO4)0.10(H2O)54.8, ((NH4)2SO4)0.47(H2O)54.8, and ((NH4)2SO4)0.94(H2O)54.8. The uncorrected and corrected data for the 0.94M sample are shown in Figure 9.22 on the right. The three uncorrected spectra are shown on the left and the corrected spectra are shown on the bottom. Thanks to Dani Haskel and Zhang Ghong for these data.

9.10.2

Correcting EXAFS data

This work is licensed under the Creative Commons Attribution-ShareAlike License.

107

9.10.2 Correcting EXAFS data

Figure 9.22: (Left) This is the 0.94M data corrected by this algorithm. (Right) Here is the raw data for the three samples. You can see the eect of self-absorption growing for the more concentrated samples. (Bottom) The corrected data. Not bad, eh?

108

This work is licensed under the Creative Commons Attribution-ShareAlike License.

CHAPTER 9. DATA PROCESSING Of the four algorithms, only the Booth algorithm as shown in Figure 9.23 is suitable for samples of nite thickness. The other three all assume that samples are innitely thick.

Figure 9.23: The self-absorption dialog with copper data for correction using the Booth algorithm.

After selecting an algorithm, you can use the other controls to enter the incident and outgoing angles in degree and the thickness of the sample in microns. All algorithms require that you specify the formula of the sample with stoichiometries in atomic percent. These two data groups were measured from the same thin copper foil, one in transmission and the other in uorescence. These data were provided by Corwin Booth and are the data from the paper where he and Bud Bridges presented their algorithm. Since this is a thin lm, only the Booth algorithm is appropriate. (Although you might want to compare it to the other algorithms, if only to see how the others overestimate the size of the correction due to the fact that they do not consider lm thickness.) The formula for copper is Cu and Corwin reports that the thickness of the sample is 4.6, the incident was 49 degrees and the outgoing angle was 41 degrees. Enter these values and plot the correction. Save the corrected data group and compare it to the transmission data, as shown in Figure 9.24 on the next page. There are several things that can eect the comparison of the corrected uorescence data and the transmission data. These include how the two data sets were normalized, the incident and outgoing angles, and the thickness. Try changing all those things to see how they eect the correction.

9.10.3

Information depth

For any sample, you can plot the information depth as a function of wavenumber. This quantity was dened by Troger et al. and represents the depth into the sample probed by the incident beam for a given sample geometry as a function of energy. In that depth, 68 percent of the incident photons are absorbed and 68 percent of the uorescence photons are generated. The information depth provides a useful metric for whether a lm sample can be considered thick in a particular experiment.
This work is licensed under the Creative Commons Attribution-ShareAlike License.

109

9.10.4 Algorithm references

Figure 9.24: It works pretty well. The green trace is the corrected uorescence spectrum, which compares well to the transmission data.

9.10.4

Algorithm references

Fluo algorithm The program documentation for Fluo can be found at Danis web site and includes the mathematical derivation: http://www.aps.anl.gov/xfd/people/haskel/uo.html Booth Algorithm C. H. Booth and F. Bridges, Physica Scripta, T115, (2005) p. 202. See also Corwins web site: http://lise.lbl.gov/RSXAP/ Troger Algorithm L. Troger, et al., Phys. Rev., B46:6, (1992) p. 3283 Pfalzer Algorithm Another interesting approach to correcting self-absorption is presented in P. Pfalzer et al., Phys. Rev., B60:13, (1999) p. 9335. This is not implemented in athena because the main result requires an integral over the solid angle subtended by the detector. This could be implemented, but the amount of solid angle subtended it is not something one typically writes in the lab notebook. If anyone is really interested in having this algorithm implemented, contact Bruce. Atoms Algorithm B. Ravel, J. Synchrotron Radiat., 8:2, (2001) p. 314. See also the documentation for Atoms at Bruces website for more details about its uorescence correction calculations. Elam tables of absorption coecients W.T. Elam, B.Ravel, and J.R. Sieber, Radiat. Phys. Chem., 63, (2002) p. 121-128

9.11

Removing multi-electron excitations

XAS is normally thought of in terms of a single electron phenomenon. A photon goes in and a photoelectron goes out. In fact multi-body phenomena are possible and, on occasion, must be considered in the interpretation of XAS data. One such is the so-called shake-o eect in which the photoelectron has sucient kinetic energy to excite a high-lying electron. For example, at around 415 eV above the uranium LIII edge, the photoelectron can excite an or N7 transition. 110
This work is licensed under the Creative Commons Attribution-ShareAlike License.

CHAPTER 9. DATA PROCESSING The cross-section of this secondary edge can be quite small. In the example of the LIII N6,7 transition, the secondary cross section is about 3 orders of magnitude smaller than the primary LIII edge. If, in this example, you have very good data with measurable EXAFS beyond about 10.5 A1 , the multi-electron excitation will not be small compared to the LIII EXAFS. Other multi-electron excitations have even larger cross-sections compared to their primary excitations. For a much more complete discussion of multi-electron excitations see Iztok Arcons Mulielectron Photoexcitations page. athena uses a relatively simple algorithm to attempt to remove the eect of the multi-electron excitation from your data. Be warned that the algorithm described here requires considerable user input and sucient knowledge to properly evaluate the results.

This algorithm can do serious damage to your data.Without a sober, knowledgeable assessment of the results of applying this algorithm made by you, the user, this part of athena should be considered fragile and dangerous.

That said, lets carry on. The dialog shown in Figure 9.25 provides an interface to a simple, three-parameter algorithm for approximately removing the eect of the multi-electron excitation.

Figure 9.25: The multi-electron excitation removal correction dialog.

Describe basic idea secondary peak is a broadened reection of the rst. Describe algorithm spectrum shifted and broadened then subtracted from the data. Plot in various spaces to evaluate result. Real evaluation will require proper tting of data. Make a group. Database of energy osets. How did we know that to be the eect of an MEE? Problems tting + C. Hennig, Phys. Rev. B, 75, (2007) p. 035120.
This work is licensed under the Creative Commons Attribution-ShareAlike License.

111

9.12. MERGING DATA GROUPS

Figure 9.26: Removing the eect of the multi-electron excitation. The secondary excitation can be seen as the shoulder marked by the purple arrow. The red line shows (k ) after removal.

9.12

Merging data groups

Sadly, most data that we measure is, frankly, kind of crappy. A single scan typically ranges from noisy to so dominated by noise that its hard to recognize it as oscillatory. Fortunately, the central limit theorem works every single time. If you add up enough noisy scans, it eventually turns into real data! All entries in the group list which are marked will be included in the merge. Make sure that the marked groups really are the ones you want to include in the merge! Data can be merged as (E ), normalized (E ), or (k ). In most cases, it makes little dierence which one you choose. (R) will be the same regardless. (This can be tested, in fact, I encourage you to do so.) The standard deviation in the merged data is also computed and stays with the data in project and certain output les, although athena does nothing else with the standard deviation other than plotting it, which is shown in Figure 9.28 on the next page. By default, each data set is weighted the same in the merge. You can specify the weight to use for each data set using the importance parameter, which is 1 by default for ever group. Alternately, you can let ifeffit determine the amount of noise in the data by looking at the signal between 15 and 25 in R-space and then use the noise to weight the data. In that way, cleaner data contributes more to the merge. The choice between using the noise or the importance is made using the check buttons in the menu. The data merging feature is one of athenas most important. My typical work pattern is to carefully align scans on a sample, merge them, then analyze the merged data in artemis.

It is essential that your data be well-aligned before merging. Merging poorly aligned data has the eect of signicant attenuating the ne structure.

When merging as (E ) or normalized (E ), if every data group included in the merge has a reference channel, the reference channels will also be merged and these two merged spectra will be tied together as a reference channels (Sec. 3.4 on page 25). Thus the merge of the reference channels can serve as the alignment standard for the merge of the data. There is one situation where merging as (E ) will be substantively dierent from the other two options. 112
This work is licensed under the Creative Commons Attribution-ShareAlike License.

CHAPTER 9. DATA PROCESSING

Figure 9.27: The contents of the Merge menu, showing the various ways that data can merged.

Figure 9.28: Data merged as (E ) plotted with its standard deviation.

This work is licensed under the Creative Commons Attribution-ShareAlike License.

113

9.12. MERGING DATA GROUPS If something happens to change the values of the signals on the detectors in such a way that (E ) for subsequent scans is of very dierent sizes but the normalized (E ) data is consistent for all the data, then the merge in (E ) will be dominated by the scans with larger absolute values while the merge in normalized (E ) will treat all the data with similar weights. One way of having this happen is to change amplier gains between scans. In that situation, you probably should choose to merge normalized or (k ) data.

114

This work is licensed under the Creative Commons Attribution-ShareAlike License.

Chapter 10

Data analysis in Athena


athena provides various kinds of data analysis. None of the data analysis capabilities in athena require the use of feff. Analysis of data using feff is a huge topic and involves a dierent program, artemis. The data analysis techniques included in athena are all purely empirical. While there is no substitute for careful, sophisticated analysis of EXAFS data using theory from feff, often the empirical techniques described in this chapter are adequate to answer the questions you have about your data. athenas analysis tools are accessed from the Analysis menu, as shown in Figure 10.1.

Figure 10.1: The contents of the Analysis menu.

10.1

Linear combination tting

115

10.1.1 Fitting a single data group athena has a capability of tting a linear combination of standard spectra to an unknown spectra. These ts can be done using normalized (E ) spectra or (k ) spectra. One use of this sort of analysis might be to interpret the kinetics of series of spectra measured during a reduction reaction. By tting each intermediate spectrum as a linear combination of the end members, one can deduce the rate of the reaction. Another possible use would be to determine the species and quantities of standards in a heterogeneous sample. To access this feature, choose Linear combination t from the Analysis menu. The normal parameter view will be replaced by the dialog in Figure 10.2 for performing the linear combination t.

Figure 10.2: The linear combination tting dialog.

10.1.1

Fitting a single data group

The linear combination dialog presents a table of menus. Each of these menus can be used to select a spectrum from among the data groups currently in the Data groups list. The basic idea of this dialog is that you will choose two or more standard spectra and t a linear combination of them to the current (i.e. the one highlighted in pale red in the Data groups list) group. The tting is done using the normalized (E ) spectra. If the standards or the unknown are to be attened, then the attened spectrum will be used. (See the section on background removal (Sec. 4.1 on page 35) for details about attened spectra.) You should have already done some data processing on the standards and on the unknowns. Specically, you should align your data and set appropriate normalization parameters for each spectrum before starting to use the linear combination tting dialog. Failing to adequately prepare your data for these ts may result in questionable ts. To do the t, weighting parameters are dened for each standards spectrum except for the last one in the list. The weight for the last spectrum is one minus the sum of the other weights, thus constraining the standards to be 100 percent of the unknown. Thus, if you used three standards, the rst two would have weights x and y and the third would have weight 1-x-y. x and y would then be varied to best t the data. Each standard spectrum is interpolated onto the energy grid of the unknown when the t is performed as 116
This work is licensed under the Creative Commons Attribution-ShareAlike License.

CHAPTER 10. DATA ANALYSIS IN ATHENA normalized (E ). The t is performed over the data range indicated by the text boxes near the top of the window. There are pluck buttons which can be used to set the tting range by clicking on a plot of the data. Fitting normalized (E ), derivative (E ), or (k ) is chosen using the radio buttons just above the table of standards. When tting (k ) spectra, you have the option of tting a single spectrum to the data. When tting normalized or derivative (E ) spectra, you have the option of oating an E0 for each standard independently. This is intended to x up any inconsistencies in the energy alignment of the various spectra (although it is much better to do a good job of aligning your data before doing your linear combination tting). These E0 variables can be introduced by clicking on the checkbuttons in the table of standard spectra. You can introduce a linear oset to the t to normalized (E ) spectra. This is simple a line added to the sum of spectra in the t. It introduces two parameters to the t, a slope and an intercept. The line is multiplied by a step function centered at the E0 of the unknown. Thus the linear oset is introduced only after the edge of the unknown. The purpose of this oset is to accommodate any variations in how the normalization is performed on the various spectra. To turn on the linear oset in the t just click on the button labeled Add a linear term after e0?

For best results, you should do a good job of aligning and normalizing your spectra before starting linear combination analysis. When normalization and alignment are done correctly, you can expect your tted weights to sum to 1 and variation of E0 for the data or standards will be unnecessary.

10.1.2

Constraints and modications to the t

athenas linear combination dialog oers several constraints to the tting parameters. The constraints are set and unset using the checkbuttons near the bottom of the dialog. Weights between 0 and 1 You can constrain the variable weights to be between 0 and 1 by clicking on the button labeled Weights between 0 and 1. In this case, each weight used is computed from the variable using this formula:
guess def weight_varied = 0.5 weight = max(0, min(1, weight_varied))

The weight reported at the end of the t, then, is the result of that formula. Note that the use of the min/max idiom means that uncertainties cannot be calculated for situations where the guess variable gets pinned to 0 or 1. That can happen in situations where one or more of the standards used in the t is not appropriate to the data and is an indication that you should rethink the set of standards used in the t. When this option is not selected, the guessed variable itself is used as the weight in the t and is not prevented from being negative or larger than 1. Force weights to sum to 1 You can loosen the constraint that the weights sum to 1 by deselecting the nal checkbutton. This allows the nal weight to oat freely along with the rest rather than constrain it to equal 1 minus the sum of the rest, as described above. Loosening this constraint might yield t results that are hard to interpret. If the constraint that weights must be between 0 and 1 is in place, then the weight of the last standard in the t is computed by this formula:
This work is licensed under the Creative Commons Attribution-ShareAlike License.

117

10.1.3 Fitting, statistics, reports


def weight_final = max(0, 1 - (w1 + w2 + ... wn))

This forces the nal weight to be positive, but may result in a t that does have weights that, in fact, do not sum to one. Should that happen, it might be interpreted to mean that the normalization of the data or standards was not correct or that the choice of standards is not appropriate to the data. Constrain all standards to use a single E0 shift You can force all standards to use a single E0 parameter in the t. This is equivalent (albeit with a sign change) to xing all the standards and using an E0 shift on the unknown data. Adding noise to the data It is sometimes useful to check the robustness of the t against noisy data. This is particularly true for a data set wherein some data are much noisier than others. To this end, athena allows you to add pseudo-random noise to the data before performing the t. This is done using ifeffits random() function with a user-supplied value for sigma. No care is taken to normalize sigma relative to the data, so a bit of trial and error might be necessary to nd a suitable level of noise for your test. For normalized (E ), sigma has a simple interpretation it is a fraction of the edge step. For derivative (E ) and (k ) data, you will need to compare your sigma value to the actual values of the data. You can examine the level of noise relative to your data before tting by using the Plot data and sum from the operations list.

10.1.3

Fitting, statistics, reports

To perform the t, click Fit from the operations list. After the t nishes, the data and the linear combination will be plotted along with vertical bars indicating the range over which the t was evaluated. The values of all the tting parameters are written to the Fit results tab. Interpretation of the statistical parameters in the linear combination t is somewhat challenging. There are two reasons for this, both of which have to do with the fact that a non-linear, least-squares minimization is used in the analysis. First, it is dicult (perhaps impossible) to quantify the number of independent measurements in the XANES spectrum. That number is certainly less than the number of data points measured. Nonetheless, when the chi-square is evaluated, the number of data points is used as the number of measurements. Second, athena has no way of evaluating a measurement uncertainty for the XANES measurement. A value of 1 is used for in the equation for chi-square. These two issues, taken together, mean that chi-square and reduced chi-square tend to be very small numbers much smaller than 1. As a result, it is impossible to use reduced chi-square to evaluate the quality of a single t. Relative changes in chi-square between ts are probably meaningful. However, given the two problems described above, chi-square does not have a very dierent meaning from the R-factor. The R-factor reported in the text box is
sum ( (data - fit)^2 ) -----------------------sum ( data^2 )

where the sums are over the data points in the tting region. The chi-square and reduced chi-square are those reported by ifeffit. Interpretation of the statistical parameters requires you to be mindful of what you know about the system you are measuring. The statistical parameters alone are not sucient to evaluate the t results. The results of sample fractions must be meaningful in the context of any external knowledge you have about the system. You can replot the data and the t using the most recent values for the tted parameters by clicking Plot in the operations list. 118
This work is licensed under the Creative Commons Attribution-ShareAlike License.

CHAPTER 10. DATA ANALYSIS IN ATHENA You can save the text from the t results box to a le by clicking Write a report in the operations list. This writes a column data le with the t results as the header information. The columns in the le are x-axis (either energy or k), the data, the best t, the residual, and each of the weighted components. You can make a data group out of the linear combination by clicking Make t group in the operations list or out of the residual by clicking Make dierence group in the operations list. This will allow you to plot and manipulate the t or dierence after leaving the linear combination dialog. The data group containing the t result will be treated as normal data that can have a background removed or be Fourier transformed. When you save a t using the derivative spectra, the t group will be saved as a normal (E ) spectrum. Reset in the operations list returns almost everything in the dialog back to its original state. If you need more than four standards, the number of standards as well as several other aspect of the linear combination tting is congurable using the preferences dialog.

10.1.4

Constraining linear combination t parameters between groups

The various operational parameters described above can be constrained between data groups in the same manner as background removal and Fourier transform parameters on athenas main page. Two items in the operations list are Set params, all groups and Set params, marked groups. These will export the current groups values for tting range, noise, weights between 0 and 1, force weights to sum to 1, and use of linear term to other groups. This should probably be done before using the marked group tting feature described in the next section.

10.1.5

Batch processing

One of the choices in the operations list is to Fit marked groups. All groups marked by having their purple buttons checked will be t in the manner described above using the current selection of tting standards and other tting options. When the sequence of ts is nished, the Write marked report option will become enabled in the operation list. This will allow you to write a report in the form of a comma separated value le which summarizes the results of the sequence of ts. This report le can be read into any spreadsheet program. Note that the report le will only reect the ts done during the batch job. Any changes made to the tting model will not be included in that report until a new batch job is performed. Also note that the only way that the batch job is dierent from running the same sequence of ts by hand is that the report le can be generated. There is currently no way to generate a similar report from a sequence of ts not run using the batch processing option. However, you always have the option of saving individual t reports as described above.

10.1.6

Combinatorial tting using many standards

One of the uses of this sort of XANES tting is to try to gure out whats actually in a sample. One approach to guring this out is to measure all plausible standard compounds and try tting a large number of dierent combinations of the standards to the data. provides a tool for automating this. Here is how it works: 1. Load all of the standards that you want to consider into the table of standards in the linear combination dialog. You may need to increase the maximum number of standards using the preferences dialog to provide enough space in the table for all of the standards that you wish to consider. 2. You can limit the number of standards used in each t with the incrementer widget just below the button marked Use marked groups. By default this number is 4, which says that the ts will
This work is licensed under the Creative Commons Attribution-ShareAlike License.

119

10.1.6 Combinatorial tting using many standards consider all possible binary, ternary, and quaternary combinations of standards. Increase this number to consider higher orders of combinations of standards. Decrease it to limit the number of ts to perform. You can also mark one standard as required by clicking the radio button in the right-most column of the table of standards. This will limit the combinations of standards tested against to data to those that contain the required standard. 3. Click Fit all possible combinations in the operations list and go get a cup of coee. If the number of possible standards is large, this series of ts could take a while. For example, with 11 standards and 11 11 considering up to the quaternary combinations, athena will perform 550 ts. (Really! C2 + C3 + 11 C4 = 550). Once this series of ts nishes, the tab labeled Combinatorics will become active and raise to the top. In Figure 10.3, you will see two tables. The top table concisely summarizes all the ts that were performed, in order of increasing R-factor. Initially, the rst item in the list which has the lowest R-factor is selected (i.e. highlighted in pale red).

Figure 10.3: The combinatorial tting results tab. The second table contains each of the standards and its weight and E0 from the t selected in the upper table. You can select a t from the upper table by clicking on its line. When you do so, that t becomes highlighted in pale red, its tting results are inserted in the bottom table, its best t function is plotted along with the data, and its results are inserted into the other two tabs. In this way, you can examine any t from the series, as seen in Figure 10.4 on the next page. Depending on the selection of standards, it is reasonable that two or more ts might have similar Rfactors. You might interpret that to mean that those ts are statistically indistinguishable or you might be able to invoke some a priori knowledge to help choose between the similar ts. Other ts farther down in the list will be obviously worse both by statistical metric and by examination of their results. Clicking the right mouse button on a t in the upper table will post a context menu with options relevant to the selected t. These options include saving the t as a data group; writing a data le with columns for the data, t, residual, and each weighted standard; saving the report from the Fit results tab 120
This work is licensed under the Creative Commons Attribution-ShareAlike License.

CHAPTER 10. DATA ANALYSIS IN ATHENA

Figure 10.4: The best t from a combinatorial sequence.

to a le; and writing a comma-separated-value report for the entire combinatorial sequence which can be imported into a spreadsheet program. Beneath the tables is a button labeled Write CSV report for all ts. Clicking this will prompt you for a le name and location, then write a comma-separated-value report of all ts.

10.2

Peak tting

Peak tting involves tting a number of analytical line shapes to XANES data. The typical approach is to simulate the XANES data using one or two step-like function and several Gaussians or Lorentzians for the peaks in the data. The centroids, amplitudes, and widths of the various line shapes are either xed or varied to best t the data. In athenas implementation of peak tting, a Levenberg-Marquardt non-linear least-squares minimization is used. (To be specic, ifeffits minimize command is used after constructing an array with a sum of line shapes.) Peak tting is an inherently empirical analysis technique. By themselves, the line shapes used have little physical meaning. The utility of peak tting is in quantifying the variation of certain spectral features in a sequence of data. As an example, consider the small peak that appears just before the main rising part of the edge in a titanate perovskite. In Figure 10.6 on page 121, this is the peak around 4968 eV. This peak varies as a function of temperature as you approach then exceed the crystallographic phase transition. The size of the peak can be related to the amount of distortion in this tetragonal structure. Peak tting is a useful tool in this temperature-dependent study as it can quantify the relationship between a spectral feature and an extrinsic parameter. Figure 10.6 on page 121 shows the peak tting dialog. The available line shapes include arc tangent error function Gaussian Lorentzian

Two other obviously useful functions are not available in the current version of athena, the pseudoVoight (typically implemented as a weighted sum of a Gaussian and a Lorentzian) and the Cromer-Lieberman calculation of the bare atomic edge step (which might better approximate the shape of the XANES data).
This work is licensed under the Creative Commons Attribution-ShareAlike License.

121

10.3. LOG-RATIO/PHASE-DIFFERENCE ANALYSIS

Figure 10.5: The peak tting dialog.

Each line shape has an independent centroid, amplitude, and width. By default, the centroids are xed and the amplitude and width are varied in the t. Which parameters are xed and which are varied are controlled by the check buttons in the columns labeled Fit. The pluck button (Sec. 6.3 on page 68) next to the centroid can be used to grab a value from the plot. In my experience, the ts are fairly unstable when the centroids are varied, particularly with peak functions placed close together. I typically leave the centroid values xed, adjusting them by hand and rerunning the ts if necessary. The peak shapes are unit normalized. This means that the amplitude is the area under the peak. The result of a t can be saved as a group in the group list for later comparison to your data. The log le is a column data le containing the t results in the header and columns of 1. 2. 3. 4. 5. energy the data the t the residual each component

Humble confession: the peak tting dialog is one of the weaker parts of athena. It is serviceable, but somewhat buggy and missing some important features. One of these days it will get some more of my attention.

10.3

Log-ratio/phase-dierence analysis

Log-ratio/phase-dierence analysis is a purely empirical technique that can be used to determine changes in the distribution parameters of the rst coordination shell for certain kinds of data. This technique is most 122
This work is licensed under the Creative Commons Attribution-ShareAlike License.

CHAPTER 10. DATA ANALYSIS IN ATHENA

Figure 10.6: Fit to PbTiO3 data measured at room temperature using an arc-tangent, a Lorentzian, and a Gaussian.

useful for data with a well-separated rst coordination shell, i.e. one for which data from higher coordination shells is spectrally isolated from the rst shell. An excellent example of a situation where this analysis would be useful would be a temperature series. In that case, log-ratio analysis can be used to measure the variation in 2 as a function of temperature and phase dierence analysis can be used to measure variation in bond length. The approach of log-ratio/phase-dierence analysis is to compare unknown data to a well known standard. The standard might be a room temperature measurement in the case of a temperature series. Or it might be a well ordered oxide for comparison with more disordered oxide forms. In any case, the analysis returns the dierences between the standard and the unknown of the various cumulants of the distribution of atoms in the rst shell. The analysis is performed by rst by Fourier ltering both the data and unknown to spectrally isolate the signal from the rst coordination shell. Then polynomials are tted to the log of the ratio of the amplitudes of the (q ) functions and to the dierence of the phases of the (q ) function.
Log-Ratio(q) = ln( Amp_unknown(q) / Amp_standard(q) ) Phase-Diff(q) = Phase_unknown(q) - Phase_standard(q)

These are t using the cumulant expansion:


Log-Ratio(q) = c_0 + 2*c_2 * q^2 + (2/3)*c_4 * q^4 Phase-diff(q) = 2 * c_1 * q - (4/3) * c_3 * q^3

The standard is selected from the menu at the top of this dialog. The unknown is the current group, i.e. the one highlighted in pale red. There are some other caveats along with the fact that this technique requires a spectrally isolated rst shell. 1. A perfectly ordered coordination shell is not necessary, but the distribution of atoms in the rst shell must be well described by an expansion in a small number of cumulants. Thus, this technique may be inappropriate for highly disordered materials. 2. Although this analysis is often referred to in the literature as model independent analysis, that is as much a shortcoming as an advantage. The technique can be used to measure changes in structural cumulants, but cannot be used to measure absolute values of those cumulants. 3. This analysis cannot be performed on higher coordination shells except in the vary rare case of a second shell which is spectrally isolated both from the rst shell and from all higher shells.
This work is licensed under the Creative Commons Attribution-ShareAlike License.

123

10.4. PRINCIPLE COMPONENT ANALYSIS 4. The presence of spectral weight from any higher shell or from any multiple scattering paths will add considerable systematic uncertainty to this analysis. When you select Log-Ratio from the Analysis menu, the main window is replaced with the logratio/phase-dierence dialog, shown in Figure 10.7.

Figure 10.7: The log-ratio/phase-dierence dialog. Once you select Fourier transform parameters and ranges for use in the analysis, you can click the Fit button to perform the t. The t to the log-ratio of the amplitudes is plotted when the t is over. The buttons can be used to plot either the t to the log-ratio of amplitudes or the t to the phase dierence. The ts use all cumulants up to the fourth. Depending on your data quality, choice of Fourier transform ranges can be important and quite sensitive. You can save the log-ratio and phase-dierence data along with the ts to a le by clicking the Save ratio data and t button. The three plot buttons behave just like the purple plot buttons would behave were only the standard and unknown marked. Note that the kmin, kmax, kw, dk, rmin, rmax, and dr parameters for the standard and the unknown will be reset to the values used in this analysis, but not for frozen groups (Sec. 6.6 on page 71). My favorite explanation of this analysis method is Application of the Ratio Method of EXAFS Analysis to Disordered Systems, G. Bunker, Nucl. Inst. Meth., 207, (1983) p. 437-444.

10.4

Principle component analysis

PCA is on athenas to do list. 124


This work is licensed under the Creative Commons Attribution-ShareAlike License.

CHAPTER 10. DATA ANALYSIS IN ATHENA

Figure 10.8: The log-ratio/phase-dierence dialog.

10.5

Dierence spectra

In many situations, the trends in a sequence measured data can be indicative of the of the physical process being measured. Shown in Figure 10.9 is a sequence of Pt LIII spectra measured on a hydrogenated Pt catalyst. In this sequence, the hydrogen is being desorbed, resulting in measurable changes in the spectra.

Figure 10.9: The dehydrogenation sequence of a Pt-bearing catalyst. Selecting one of the dierence spectra options from the Analysis menu replaces the main window with the dierence dialog, as shown in Figure 10.10 on the following page. Dierence spectra can be computed as (E ), normalized (E ), (k ), (R), or (q ). For dierence spectra to be meaningful, it is essential that data processing be performed correctly for each data group. It is essential that you take great care with selecting parameters (Sec. 7.1 on page 75), calibrating (Sec. 9.1 on page 90), aligning (Sec. 9.2 on page 90), and all other processing chores. As you click on each group in the group list, the dierence spectrum is calculated and plotted. You can select two points, shown in Figure 10.11 on page 125 by the orange markers, and integrate the area under that part of the spectrum.
This work is licensed under the Creative Commons Attribution-ShareAlike License.

125

10.5. DIFFERENCE SPECTRA

Figure 10.10: The dierence spectrum dialog with data taken from the diff.prj demo le.

The dierence spectra in energy or k can be saved to data groups. Those data groups are treated like any other energy or k group. Dierence groups in energy can have a background removed and dierence spectra can be Fourier transformed. This part of athena is directly applicable to dichroism studies. The dierence spectra in normalized (E ) and the integration can be used to measure magnetic moments in magnetic materials.

126

This work is licensed under the Creative Commons Attribution-ShareAlike License.

CHAPTER 10. DATA ANALYSIS IN ATHENA

Figure 10.11: (Left) The dierence spectra between the rst group in the list and the current group in the screenshot of the dierence dialog. (Right) The dierence spectra plotted after making data groups from each one.

This work is licensed under the Creative Commons Attribution-ShareAlike License.

127

10.5. DIFFERENCE SPECTRA

128

This work is licensed under the Creative Commons Attribution-ShareAlike License.

Chapter 11

Worked examples
This chapter presents several eshed-out examples of performing specic chores with athena. At this time there are three examples. More may be added in future versions of this document. Basic data processing This example walks through the import and processing of several data les measured on an iron foil. Data calibration and alignment, parameter constraint, and merging are demonstrated in this example. A dicult background removal problem MoO3 presents a particularly challenging background removal problem. This example demonstrates an iterative approach to background removal. After an initial removal, the MoO3 are analyzed in artemis using a simple model and that information is used to improve upon the background removal in athena. Linear combination analysis Using data measured on a variety of gold standards and a sequence of data measured on a system of cyanobacteria chemically reducing gold chloride to metallic gold.

11.1

Basic data processing

This worked example will walk you through data import, demonstrate calibration, alignment, and merging of data, and consider well chosen parameter values for background removal and Fourier transform. This example uses data collected on an iron foil at three temperatures. To begin, import (Sec. 3.1 on page 19) the rst scan at 60K, fe.060. This is a relatively simple data le containing columns for energy and the signals on the I0 and It detectors. Select columns to form (E ) data as shown in Figure 11.1 on the following page. When I collected these data, I purposefully miscalibrated the monochromator so that I would have a data set for explaining the use of athenas calibration dialog. The rst thing to do, then, is to correctly calibrate these data. Open the calibration dialog (Sec. 9.1 on page 90) by selecting Calibrate energies from the Data menu. The derivative of (E ) for these data will be plotted, shown in Figure 11.2 on the following page on the left. The choice of edge position, denoted by the little orange circle, is reasonable in that it is close to the rst peak of the rst derivative, as one expects. The monochromator calibration is obviously wrong as the orange circle is at 7105.5 eV, while the tabulated value for the iron K edge is 7112 eV. We want to select the peak of the rst derivative and set that point to 7112 eV. We can simply use the currently selected point it is quite close to the peak. Alternately, we can click the Select a point button and try to click on the plot, selecting point even closer to the peak. To do that, it would be helpful 129

11.1. BASIC DATA PROCESSING

Figure 11.1: The column selection dialog with columns chosen correctly for the iron foil data.

Figure 11.2: The iron foil data, as plotted in the calibration dialog. (Left) Derivative of (E ). (Right) Second derivative of (E ).

130

This work is licensed under the Creative Commons Attribution-ShareAlike License.

CHAPTER 11. WORKED EXAMPLES to change the value of emin and emax in the energy plot tab (Sec. 5.1 on page 52) the replot the data such that a tighter region around the peak is displayed. A third, highly accurate way of nding the exact peak of the rst derivative is to plot the second derivative of the data by selecting second deriv from the display menu. The second derivative of the data along with the currently selected value of edge position are shown on the right of Figure 11.2 on the facing page. With the second derivative selected for display, the Find zero-crossing button becomes activated. clicking that button will cause athena to search in both directions for the nearest energy value that hits the y=0 axis and select that as the new edge position. The value should be about 7105.3 eV. Click the Calibrate button and return to the main window. You will notice two things once the main window is displayed again: the value of e0 is now 7112 and the value of the eshift parameter is now about 6.7. In athena, calibration works by simultaneously setting those two parameters such that the selected point has the chosen energy value. Now, import the second scan at 60K, fe.061. Mark (Sec. 6.2 on page 66) both groups by clicking on their little purple buttons and plot them in energy by clicking on the E button.

Figure 11.3: (Upper left) Misaligned iron foil (E ) data. (Upper right) The derivatives of the misaligned data, as plotted in the alignment dialog. (Lower left) Aligned data plotted in k, but with e0 unconstrained. (Lower right) Aligned data plotted in k after constraining e0 . One aligned and constrained in e0 , these successive scans are quite consistent.

The upper left of Figure 11.3 shows that these data are not aligned. Since they are successive scans on the same iron foil under the same experimental conditions, we expect these data to be identical within statistical noise. The reason that they are dierent is that the second scan has not yet been calibrated. Fixing this requires two steps. First, open the alignment dialog (Sec. 9.2 on page 90) by selecting Align
This work is licensed under the Creative Commons Attribution-ShareAlike License.

131

11.1. BASIC DATA PROCESSING scans from the Data menu. The two scans are plotted as the derivative of (E ). The rst scan in the list, fe.060, is automatically selected in the Standard menu. The second scan is highlighted in orange in the groups list and is displayed as the Other. These are very clean data, so the automatic alignment algorithm should work well. Click the Auto align button. If you data is noisy, the automated alignment might not work well, in which case you can use the other buttons to adjust the energy shift until you are satised that the data are well aligned. Returning to the main menu, we nd that the eshift parameter for fe.061 is now about 6.7 eV. When plotted together in energy, the data are well aligned. However when plotted together in k by pressing the k button, there remains a problem, as we see in the lower left of Figure 11.3 on the preceding page. The fe.061 data have been aligned, but not calibrated. That is, its e0 parameter has not been set to the same value as for the fe.060 data. Consequently, the position in the data where k=0 is dierent for the two spectra and the (k ) data from the background removal are dierent. To correct this, you can either enter the value for e0 from fe.060 7112 eV into the e0 text entry box after clicking on fe.061 in the group list. Alternately, you can select fe.060 in the group list, then right click on the e0 parameter to raise its context menu (Sec. 7.1.1 on page 75) and select Set all groups to this value of E0. Once the e0 parameters are set the same for these data sets, we see in Figure 11.3 on the preceding page in the lower right that the data are quite consistent between these two scans. Now we need to import the remaining data measured on the iron foil. Using the le selection dialog, select the remaining data les as described in the section on multiple le import (Sec. 3.3 on page 24) and shown in Figure 11.4.

Figure 11.4: Importing the remaining iron foil data.

Clicking the Open button will import all those data les and list them in the group list. Once they are imported, mark (Sec. 6.2 on page 66) all of the groups either by typing Ctrl - a or by clicking the A mark button above the group list. Finally select the fe.060 group by clicking on it in the group list. Once you have done all of that, athena will look like Figure 11.5 on the facing page. At this point, only fe.061 has been aligned to fe.060 and had its value of e0 properly constrained. We need to do so for the remaining data groups. Processing all 5 of the remaining data groups would be quite tedious if we had to handle each one individually. Fortunately athena has lots of tools to help process large quantities of data. To align (Sec. 9.4 on page 92) the remaining data to fe.060, choose Align data from the Data menu. athena chooses the rst item in the group list as the data alignment standard and selects the second group as the one to align. These selections are shown at the top of Figure 11.6 on page 132. Of course, fe.061 has already be aligned. If you select any other group by clicking on it in the group list, you will see that it it is not yet aligned. You can align the remaining groups by selecting each on in turn 132
This work is licensed under the Creative Commons Attribution-ShareAlike License.

CHAPTER 11. WORKED EXAMPLES

Figure 11.5: All of the iron foil data have been imported and marked.

and clicking the Auto align button but that seems tedious. Much better to click the Align marked groups button. Since all the groups are aligned, the automated alignment algorithm will be applied to each one in turn. Once nished, you can click on groups to check on the quality of the alignment. Since these are very good data, the automated alignment should have worked well. Click on the Return to the main window button to continue with the data processing. Each of the data groups has now been aligned, but only fe.061 has the same value of e0 as fe.060. Again, clicking through the groups list and editing the e0 values seems horribly tedious. Here we see the true value of the Set all groups to this value of E0 in the e0 context menu (Sec. 7.1.1 on page 75). The (k ) data for the aligned and constrained data are shown in Figure 11.7 on the following page. There is another, perhaps quicker, way of doing everything that is described above. To start, import the fe.060 data and calibrate it as explained at the start of this section. Then use the le selection dialog to select all of the remaining data. Click to the Preprocess tab, select the fe.060 data as the standard, then click the Mark, Align, and Set parameters buttons. Now click the Open button. As the remaining data are imported, the alignment and e0 constraint will happen on the y and the new group will be marked. Once the le selection dialog using these preprocessing features is nished, athena should look just like it did in Figure 11.5. As a nal chore in this section, we will merge (Sec. 9.12 on page 110) the data measured at each temperature. Since the data are properly aligned and calibrated, this is a ne time to perform the merge. First mark each data group that should be merged together. As we see in Figure 11.9 on page 133, the two groups measured at 300K are marked. Select Merge marked data in mu(E) from the Merge menu. This will perform the merge then insert a new group in the group list. Then select Change group label from the Group menu or type Ctrl - l to give the merged group a more suggestive name. Repeat this process for the data at each temperature. Now you are ready to begin analysis on the iron foil data!
This work is licensed under the Creative Commons Attribution-ShareAlike License.

133

11.1. BASIC DATA PROCESSING

Figure 11.6: All of the iron foil data are marked and waiting to be aligned.

Figure 11.7: The (k ) spectra for all the iron foil data.

134

This work is licensed under the Creative Commons Attribution-ShareAlike License.

CHAPTER 11. WORKED EXAMPLES

Figure 11.8: Using the preprocessing features of the column selection dialog to align and constrain data on the y as it is imported.

Figure 11.9: Merging the data at each temperature and renaming the merged groups.

This work is licensed under the Creative Commons Attribution-ShareAlike License.

135

11.2. A HARD BACKGROUND REMOVAL PROBLEM

11.2

A hard background removal problem

This section was based closely on idea presented in a tutorial written by Shelly Kelly. That document was expanded somewhat and edited to match the format of this document. The data shown here were kindly donated by Simon Bare of UOP LLC. This tutorial shows a step by step process for removing a tough background. This tutorial uses MoO3 which has a split close oxygen rst shell and a lot of structure in the XANES region of the EXAFS data. A method for using a theoretical (k ) spectra to determine the shape of the background function through the XANES region of the absorption edge is demonstrated. This example involves artemis. Since using artemis is outside the scope of this document, the details of discussion below of the t to the rst coordination shell in MoO3 will be glossed over.

11.2.1

Getting started

To start, open the moo3-tutorial.prj le in Athena. The rst data set contains the MoO3 data, with all parameters set to their default values for background removal, including an e0 value of about 20006.8 eV. (E ), (k ), and (R) for these data are shown in Figure 11.10 using these values.

Figure 11.10: MoO3 data using athenas default background removal parameter values and a k-weighting of 2. (Upper left) (E ). (Upper right) (k ). (Bottom) Magnitude of (R) data. The indicators show the positions of 2 and 4 A1 in the (E ) and (k ) data.

136

This work is licensed under the Creative Commons Attribution-ShareAlike License.

CHAPTER 11. WORKED EXAMPLES If the background through the XANES region is good there should be little change in the Fourier transform by including or excluding the low k-region of the (k ) data. Make a copy of the original data set by selecting Copy group from the Group menu of typing Ctrl - y with the rst group selected in the group list. Change its label to moo3-kmin by selecting Change group label from the Group menu or typing Ctrl - l . To test the low k-region (k ) data move kmin in the Fourier transform range from the default 2 A1 to 4 A1 . Look at the (E ) and (k ) data in Figure 11.10 on the preceding page to see where 1 4 A is in these data. 4 A1 is beyond the most dicult region for determining the background function.

Figure 11.11: The magnitude (Left) and real part (Right) of the (R) data using kmin values of 2 and 4 A1 for the Fourier transform. See the change in the Fourier transform of the data through the rst peak region, so only use the data from 4 A1 . Import this data set into artemis.

11.2.2

Examine the theory

Open the artemis project le Moo3-kmin.apj. This project le contains the data with kmin = 4 A1 and a simple theoretical calculation using published crystallographic data for MoO3 . With kmin = 4 A1 for the Fourier transform in artemis. The theory consists of three paths: 2 oxygen atoms at 1.70 A 2 oxygen atoms at 1.94 A 2 oxygen atoms at 2.30 A Set E0 =0, 2 =0.003, R=0 for all paths and use artemis plot the data and with this simple calculation. The data are shown in Figure 11.12 on the following page. The purpose of comparing the data to the raw theory is to verify that the theory provides a reasonable starting place to begin tting the data. This theory looks like it will work for this data set. The q-space data shows that the data and the theory are not aligned very well. The k-space data and theory shows that the theory has the same overall shape. The Fourier transform of the data shows that the background needs to be xed by the mist at low R. The other tting parameters should accommodate that mist.

11.2.3

A simple t to the rst coordination shell

This work is licensed under the Creative Commons Attribution-ShareAlike License.

137

11.2.3 A simple t to the rst coordination shell

Figure 11.12: A comparison of the MoO3 data and the sum of paths before performing a t. (Upper left) (k ). (Upper right) the magnitude of (R). (Lower left) (q ). (Lower right) the real part of (R).

138

This work is licensed under the Creative Commons Attribution-ShareAlike License.

CHAPTER 11. WORKED EXAMPLES

Figure 11.13: A comparison of the MoO3 data and the sum of paths after performing a simple t. (Upper left) (k ). (Upper right) the magnitude of (R). (Lower left) (q ). (Lower right) the real part of (R).

This work is licensed under the Creative Commons Attribution-ShareAlike License.

139

11.2.4 Using the t as a background removal standard Fit the theory to the data. With E0 xed to 0, 2 and R are t for the three paths. E0 is not oated in this t because we are attempting to nd a theory that will work well as a theoretical background removal standard for the selected value of e0 . Note that the t is quite good between about 1.3 and 2 Ain Figure 11.13 on the previous page. Since the data is well described in that region by the simple rst-shell tting model, we can conclude that the peak at lower R represents a shortcoming of the background removal. Save the (k ) for the t to a le so it can be reimported into athena. In the athena project le for this section, the group moo3 kmin t contains this theoretical (k ).

11.2.4

Using the t as a background removal standard

After importing the theoretical (k ) into athena, we use it as the background removal standard for a copy of the original data. A background removal standard is set using a control among the additional background parameters (Sec. 6 on page 61). Just select the group containing the theoretical (k ) from the drop-down menu shown in Figure 11.14.

Figure 11.14: Using another group as the background removal standard.

The new (R) data shown Figure 11.15 on the facing page have a much less pronounced peak in the low R region. Examining the data, you will nd that background has a nice shape through the edge region with e0 at a reasonable location on the edge. Note that the value of the lower spline clamp (Sec. 4.4 on page 47). Examining the (k ) and (q ) spectra will show that these data are nicely aligned with the theory. You can now read these data into artemis and begin your data analysis in earnest.

11.2.5

Understanding

The background removal algorithm (Sec. 4.3 on page 43) nds the background function which optimizes the Fourier components of the spectrum below rbkg . In the absence of a background removal standard, 140
This work is licensed under the Creative Commons Attribution-ShareAlike License.

CHAPTER 11. WORKED EXAMPLES

Figure 11.15: Comparing the (R) function for background removals with and without the theoretical background removal standard. The magnitude (Left) and real part (Right) of the (R) spectra using kmin values 4 A1 for the Fourier transform.

optimizing those Fourier components means to minimize them. That is, the spline is found which results in the smallest possible values for the components below rbkg . That is not necessarily correct. Although there certainly are no atoms at very short distances, that does not mean that there should be no nitevalued Fourier components at low R. The peak corresponding to the rst coordination shell is broadened for a variety of physical and mathematical reasons, including 2 and the nite range of the Fourier transform. When a standard is used for the background removal, the optimization works to make the low R components of the data as much like the low R components of the theory. In short, using a background removal standard acknowledges that the rst shell peak leaks into the low R region and may not go to zero even at R=0. The standard, then, puts an additional constraint on the background function. It is possible to nd a substantively similar background function just by tweaking the various background removal parameters in the absence of a standard. An example is shown in Figure 11.16 on the next page. The problem with the tweaking approach is that it is fairly ad hoc. By performing the t as part of an iterative approach to the background removal, you are making better use of the information content of the data and a more complete use of the meaning of rbkg , i.e. the value above which the Fourier components correspond to data and below which those components correspond to data.

11.3

Linear combination analysis

This section outlines the linear combination tting analysis of an experiment to study the kinetics of the reduction of aqueous Au3+ chloride to metallic gold. The experiment is described and these data are presented in Mechanisms of Gold Bioaccumulation by Filamentous Cyanobacteria from Gold(III)-Chloride Complex, M.F. Lengke, B. Ravel, M.E. Fleet, G. Wanger, R.A. Gordon, G. Southam, Environ. Sci. Technol., 40:20, (2006) p. 6304-6309. The experiment probed the mechanism of bioaccumulation of gold by the interaction of a model cyanobacterium (Plectonema boryanum UTEX 485) with aqueous Au3+ chloride. This resembles a common subsurface environment associated with gold deposits in various locations around the world. In those environments, Au3+ chloride bearing uids rise from the deep subsurface and wash over bacterial mats. The bacteria die but their remains interact chemically, reducing metallic gold from the uid. In our experiment, a culture of P. boryanum was sampled and placed in a Teon uid cell appropriate for an XAS measurement. An aliquot of Au3+ chloride solution was titrated into the uid cell and we exited the hutch as quickly as possible. Overnight, we measured XAS scans continuously. In the morning we set
This work is licensed under the Creative Commons Attribution-ShareAlike License.

141

11.3.1 Examining the data

Figure 11.16: Comparing the (R) function for a background removal using the theoretical background removal standard and another with various parameters tweaked to obtain a similar result. The magnitude (Left) and real part (Right) of the (R) spectra using kmin values 4 A1 for the Fourier transform.

the sample aside, remeasuring it every few hours until the end of the experiment. Finally we measured a similar sample that had been prepared a week earlier. in this way, we had a time sequence tracking the nearly complete reduction of Au3+ chloride to some form of colloidal gold. (The gold is known to be colloidal from TEM measurements, we could not distinguish colloidal and bulk gold in our XAS measurements.)

11.3.1

Examining the data

Import the athena project le containing the gold standards and gold/cyanobacteria data. You will see that it contains a subset of the reduction sequence, including data data from 0.12 hours through 1 week. Below the cyanobacteria data are several gold standards. Note that these data have all been carefully calibrated, aligned, and merged. Each measurement was made using a gold foil as an alignment reference (Sec. 3.4 on page 25). Figure 11.17 on the next page shows the sequence of data measured on the cyanobacteria on the left and a variety of gold standards on the right. The plot on the left also shows the starting material, aqueous Au3+ chloride, and the end product, metallic gold. The data clearly show the transformation over time between these two end members. In particular, note the reduction of the white line intensity at about 11921.5 eV and the growth of the peak at about 11946.7 eV which is characteristic of the metallic gold spectrum. The purpose of this experiment is two-fold. One goal is to determine the reaction kinetics of the reduction. To that end, we will assume that the data are a linear combination of aqueous Au3+ chloride and metallic gold and measure their relative fractions as a function of time. The second goal is to determine whether the reduction involves an intermediate state and, if so, to identify that species. Our strategy to answer that question will involve adding other standard compound to our mixture of aqueous Au3+ chloride and metallic gold to see if the data are better described by a ternary rather than binary mixture of standard materials. To begin, select one of the time points in the group list. Most gures in this section show the data measured at 7.03 hours. Next, select Linear combination t from the Analysis menu. This replaces the main window with the linear combination tting dialog and plots the data along with vertical lines indicating the extent of the tting range. From the rst two drop-down menus, select Au foil and Au3 Cl aq, as shown in Figure 11.18 on the facing page. In the operations list, click on Fit this group to perform the initial t to these data. After the t nishes, the result of the t, shown in Figure 11.19 on page 142 is plotted. The tab labeled Fit results 142
This work is licensed under the Creative Commons Attribution-ShareAlike License.

CHAPTER 11. WORKED EXAMPLES

Figure 11.17: (Left) The sequence of measurements from 0.12 through 720 hours. The top-most trace shows the starting material,aqueous Au3+ chloride. The bottom trace shows the end product, metallic gold. (Right) All of the standards contained in the project le.

Figure 11.18: athenas linear combination tting dialog with the end member standard compounds selected for the initial t.

This work is licensed under the Creative Commons Attribution-ShareAlike License.

143

11.3.2 Improving the t becomes active. Clicking on it, we see that the t tells us that the data are 511 percent metallic gold. Given the quality of the t, it seems that we are well justied in our assumption that these data can be modeled by a simple linear combination of the end members.

Figure 11.19: The result of the initial t to the 7.03 hour data using the end members as the tting standards.

11.3.2

Improving the t

As nice as this quick and easy result is, its not perfect. A close examination of the plot in Figure 11.19 shows quite a bit of mist throughout the entire tting range. (Note that you can examine the mist by clicking the Plot dierence button and replotting the data by clicking Plot data + sum in the operations list.) This mist suggests that our hypothesis of an intermediate state between Au3+ chloride and metallic gold may be valid. As a rst guess for what that intermediate state might be, I think should be something without a strong white line. The t in the region of the white line is pretty good. Looking at the various standards on the right side of Figure 11.17 on the previous page I suspect that the sulfur ligated species, Au sulde, Au thiosulfate, or Au thiomalate, are likely candidates. To test one, we need to add it to the list of tting standards on the Standards spectra tab and rerun the t. In the third row, select Au sulde from the drop-down menu, then click Fit this group from the operations list. This is a noticeably better t. The amount of mist throughout the tting range and especially in the peak at about 11946.7 eV is smaller. Examining the results tab, we see that the amount of Au3+ chloride is about the same as before but that the metallic gold content is only 342 percent, with the sulde taking up the remaining 182 percent.

11.3.3

Understanding the t

The t including the sulde certainly looks better, but is it? The results tab also reports some simple statistics from the t. The R-factor a measure of mean square sum of the mist at each data point was 0.000073 for the two-standard t and shrank by a factor of 2 to 0.000035 for the three-standard t. That conrms the observation that the degree of mist seems smaller in the plot of the three-standard t. The reduced 2 of the t also reduced by about a factor of two, from 0.0000514 to 0.0000250, suggesting a substantive improvement in the t quality. Those are strange numbers, though. Any textbook on scientic statistics will tell us that a good t using a non-linear, least-squares minimization (such as that used by 144
This work is licensed under the Creative Commons Attribution-ShareAlike License.

CHAPTER 11. WORKED EXAMPLES

Figure 11.20: The result of the t to the 7.03 hour data using the end members along with gold sulde.

ifeffit and athena) should give 1 for a t in which the model is a good representation of the data. That is certainly true, but supposes that you have a good determination of the measurement uncertainty. We dont. In principle, the standard deviation spectrum from the merge of measured data (Sec. 9.12 on page 110) could be used as an approximation of the measurement uncertainty, but that is not possible in this case. The data at 7.03 hours are a single measurement from a time sequence. There is nothing to merge because each measurement is a solitary measurement. Consequently, athena has to use 1 as the value of the measurement uncertainty. That is grossly in excess of the true measurement uncertainty, resulting in very small values for 2 . We cannot, therefore, assert that any particular t is a good t simply by invoking what we know about Gaussian statistics. We can, however, compare successive ts, such as the two we have made thus far. An improvement of a factor of 2 in the value of reduced 2 is certainly signicant. We can, with condence, state that there is an intermediate component on the basis of the analysis presented thus far. But what is that intermediate. We have not yet proven its identity (although gold sulde is a strong contender!) because we have not yet considered other options. There are two algorithmically distinct but conceptually identical ways to attempt to solve this problem. One involves the use of principle component analysis (a feature not yet available in athena) of the data followed by target transform analysis to attempt to identify the third species from among the standards. The approach discussed here involves using combinatorial techniques to directly test a library of standards against our data. The mathematics of these two approaches is quite dierent. Since they share one major limitation, they are practically equivalent ways of identifying the intermediate state. The limitation is that both approaches require that the intermediate species be represented by the library of standards. If that unknown species is absent from the library, neither technique is able to identify it.

11.3.4

Combinatorial analysis

Testing each standard against the data sounds like an unbearably boring process particularly since we may, in principle, want to consider all possible binary, ternary, or higher combinations of standards. The project le contains 9 standards. All possible combinations of 2 or 3 standards from a pool of 9 results in 120 possibilities. Performing and recording the results from that many ts sounds horrible. Fortunately, athena knows how to automate that chore. First mark all of the standards and none of the cyanobacteria data. Then click the Use marked groups button. This will insert all of the standards into the table.
This work is licensed under the Creative Commons Attribution-ShareAlike License.

145

11.3.4 Combinatorial analysis By default, the table is only four rows long. You will need to exit the linear combination tting dialog and open the preference dialog (Sec. 6.8 on page 73). Set the Linearcombo maxspectra preference to at least 9. Return to the linear combination dialog and load the 9 standards into the table. Click the Use at most control down to three. At this point you could click Fit all combinations to begin tting all 120 combinations of 2 and 3 standards. This is, however, a bit of a waste of time. We know that there is metallic gold in these data. The fth column in the table of standards is labeled req., which is short for required. Click the radiobutton in the Au foil row. This will cause the combinatorial sequence to only consider combinations which include the metallic gold standard. This reduces the number of binary and ternary combinations to 36. Now click Fit all combinations in the operations list. This will take a while. Its a good time to get a cup of coee.

Figure 11.21: The results of the combinatorial tting sequence, as displayed on the in the combinatorics tab. Once the sequence of ts nishes, athena displays tables containing the results of all of the ts in order of increasing R-factor. The rst column of the top table shows which standards were included in the ts using the numbering scheme of the bottom table. The other two columns show the R-factor and reduced 2 of each t. When you click on a row in the top table, the results of that t are inserted into the bottom table and the t is plotted. When the combinatorial sequence nishes, the best t of the bunch is displayed. It turns out the the combination of gold metal, aqueous Au3+ chloride, and gold sulde that we examined above is, in fact, the best t. However, it is juts barely the best t. The t with gold thiomalate in place of gold sulde is just barely worse. From a statistical perspective, the two ts are equivalent and the amounts of metal and chloride in the ts are very similar. The gold thiosulfate and gold thiocyanide ts are just a bit worse yet. A couple of other ts show similar statistics but an investigation shows that the peak around 11946.7 eV is not t very well. After that, the other ts in the table fall o quickly in quality. The conclusion that one can comfortably draw from this is that the intermediate species is some sort of gold-sulfur complex. The aqueous gold sulde standard gave the best result by a hair, but the other three species with a gold-sulfur ligand were statistically similar. To model the kinetics in this system, I will use the sulde species, but it is probably not correct to say that the intermediate species is aqueous gold sulde. 146
This work is licensed under the Creative Commons Attribution-ShareAlike License.

CHAPTER 11. WORKED EXAMPLES Rather it is some gold-sulfur complex formed when the cyanobacteria bacteria cells lyse upon exposure to the Au3+ chloride solution.

11.3.5

Analyzing the data series

To investigate the kinetics of this system, we will now apply the model consisting of three species metal, chloride, and sulde to the cyanobacteria measured at each time step. Click on the top line of the upper table. This will plot the result for our best t. It will also insert those three standards into the table on the Standards spectra tab. Click on that tab, then mark all the cyanobacteria data groups and unmark all of the standards in the group list. Now click on Fit marked groups in the operations list. This will step through the marked groups, applying the three-standard tting model to each one. Again, you may want to relax as you wait. Once the sequence of ts nishes, you may want to click through the data groups and examine the ts at the various time steps. Note that the Marked ts report option in the operations list becomes active. Clicking on this prompts you for a name for an output le. This output le is a comma separated value text le which can be easily imported into a spreadsheet, much like one of athenas report les (Sec. 8.3 on page 87). In Figure 11.22 we see that the metal content increases monotonically while the chloride content decreases monotonically. The column with the sulde content is not seen in the image, but it remains roughly constant throughout the experiment.

Figure 11.22: A report on the results of tting the marked groups. The report is written to a le that can be imported into a spreadsheet, like OpenOce Calc shown here.

In this example, I have outlined the analysis performed in the paper cited at the beginning of the chapter. We have, as we set out to do, examined the reaction kinetics and tentatively identied an intermediate species. Using automation built right into athena it was relatively easy to manage a large quantity of data.

This work is licensed under the Creative Commons Attribution-ShareAlike License.

147

11.3.5 Analyzing the data series

148

This work is licensed under the Creative Commons Attribution-ShareAlike License.

Chapter 12

Hephaestus
hephaestus is a collection of several simple graphical interfaces to the Xray::Absorption package and other tables of atomic data.
In his workshop he has handmaidens he has forged out of gold who can move and who help him in his work. ... With Athena, [Hephaestus is] important in the life of the city. The two [are] the patrons of handicrafts, the arts which along with agriculture are the support of civilization. Mythology, Edith Hamilton

12.1

Description

hephaestus is a container for several utilities based on the periodic table of elements and on tables of absorption coecients. These utilities are generally of interest to the X-ray absorption spectroscopist and are of particular value at the synchrotron. The hephaestus window consists of two parts. On the left is a button box containing the buttons used to access the dierent utilities that hephaestus oers. On the right is the container displaying whichever utility is selected. To change utilities, simply click on one of the buttons in the button box. The Units, Resource, and Xsection menus contains selection buttons. The Units menu sets the units used in the various utilities. The choices are energy in electron volts (eV) or wavelength in A. This sets how units are displayed in the absorption data, formula, and ion chamber utilities. The anomalous scattering and chemical data utilities do not use this setting. The unit setting is also a handy calculator for eV to wavelength and back. Simply type a number into one of the appropriate entry boxes and switch units to do the calculation. The Resource buttons determine which tables of absorption data will be used for calculations in the absorption data, formula, and ion chamber utilities. hephaestus is a front end to the Xray::Absorption perl module, which provides a uniform interface to absorption data from a wide variety of sources. Calculations using the various resources should only dier by a few percent, but it may be useful to know what those dierences are. The Xsection buttons tell hephaestus to make computations in the Absorption and Formula pages using the total, photoelectric, coherent, or incoherent cross-sections. This is fully supported when using the Elam, McMaster, and Shaltout resources. The Chantler resource combines the coherent and incoherent cross-sections into a single scattering cross-section, thus the scattering cross-section is used if either the coherent or incoherent buttons are selected in the Xsection menu. The other two do not include data about the coherent and incoherent cross-sections. The total cross-section is the sum of the photoelectric, coherent, and incoherent cross-sections. The ion chamber utility uses the full cross-section. 149

12.2. PERIODIC TABLE OF ABSORPTION DATA

12.2

Periodic Table of Absorption Data

This utility displays edge and uorescence line energies for the elements. Simply click on an element in the periodic table and the edge and line energies will be displayed. Some of the data resources have incomplete compilations of edge and/or line energies. For example, the Cromer-Liberman and Shaltout resources do not come with line energies. In those two cases, a minimal set of line energies are imported from the McMaster resource so that various certain can reasonably be made. The Elam resource (which is the default) contains a thorough list of edge and line energies. The lter plot helps you to determine an appropriate material as a uorescence lter. It assumes that you are measuring the K edge of any element below La and the L3 edge for all other elements. When you click on an element, hephaestus makes a good guess as to the best lter material. You can change the lter material by entering another element or by right-clicking on an element. If you enter a string that is not an element symbol, the box with the lter element will turn red when you attempt to make the lter plot. The uorescence lines are plotted as Gaussians. The line widths are ad hoc and without physical meaning, although the positions of the Gaussian centroids and the heights of the peaks (one relative to the other) are taken from the Elam tables the sole point of this plot is to show the position of the line relative to the edges of the absorber and lter. The rules for selecting the lter element are 1. 2. 3. 4. 5. 6. For element below Z=38, assume the K edge is being measured and use the Z-1 element. For element between Z=39 and 57, assume the K edge is being measured and use the Z-2 element. Use Br for a Rb absorber because Kr is a silly lter material. Use Rh for a Ru absorber because nobody wants a Tc lter! Use I for a Ba absorber because Xe is also a silly lter material. For elements above Z=57, assume the LIII edge is being measured. Use the rst element whose K edge is more than 90 eV above the L1 line of the absorber. 7. Use Rb for a U or Np absorber because Kr is still a silly lter material. For elements below Z=24 (chromium), no lter choice is given. Filters for lower-Z elements are not used because no element exists with a K-edge between the line and absorption energies of the absorber. The absorption length calculation on this utility a feature of earlier versions has been retired. All the functionality of that calculation is available on the formulas utility. Clicking an element on this page or on the Data utility inserts that element and its density onto the Formulas utility. If you click on an absorption edge in the table of edge energies, the lines associated with that edge will be highlighted.

12.3

Absorption Lengths of Compounds

This utility computes absorption lengths of compounds using the supplied photon energy along with the chemical formula and density. There is a list of common materials, their formulas, and their densities. Clicking on that list inserts those known data into the appropriate entry boxes. Clicking the Compute button will display some information about the materials in the Results box, including the absorption length. If you know the formula and density of your material, you can enter those then click the Compute button. Hitting the return key while focus is on any of the formula, density, or energy entry boxes is the same as clicking the Compute button. The formulas can be written with quite a bit of exibility. Parens and square brackets, as commonly used in chemistry notation, will be interpreted correctly. Subscripted numbers are simply entered in line next to the element symbol or parenthesized group that they modify. 150
This work is licensed under the Creative Commons Attribution-ShareAlike License.

CHAPTER 12. HEPHAESTUS

Figure 12.1: (Left) The periodic table of absorption data. (Right) Plot of the absorption edge of the lter element compared to the dominant lines of the absorbing element.

Element symbols must be in capitalized form. That is, Na is acceptable, but na, NA, and nA are not. The formula parser uses proper capitalization to determine stoichiometry. Chemical formulas can also be written using the notation of TeX or INSPEC. This is particularly handy for cutting and pasting from other programs. PbTiO3, PbTiO$ 3$, and PbTiO/sub 3/ will be interpreted identically.

Figure 12.2: Absorption lengths of compounds.

To compute the attenuation A of the beam from the absorption length, use this formula: A = exp(1 x/t) (12.1)

where x is the sample thickness and t is the absorption length. For dense materials, the mass required to make a sample that is 1 absorption length thick and 1 square centimeter wide is also reported. This mass is computed for incident photons of the specied energy. To determine the appropriate mass for your sample, multiply by the actual area of your sample and by the desired thickness in absorption lengths. This calculation is merely the product of the density and the absorption length.
This work is licensed under the Creative Commons Attribution-ShareAlike License.

151

12.4. PERIODIC TABLE OF CHEMICAL DATA User-supplied data You can maintain a personal database of materials, their formulas, and densities. If you wish to dene a new material or update the data for one of the built-in materials, just click the Add button. This will prompt you for the name of the material then insert that material into the list on the left as well as save it in a le for future use. Any material, including one of the built-ins, can be removed by clicking the Remove button. Density and molarity An alternate calculation is made by selecting Molarity from the density option menu. When molarity is chosen, the calculation will be made on the solute of a solution of the specied molarity. In that case, the mass of the formula unit of the sample will be computed and the specied molarity will be used to determine the density of the solute in the solution. When considering a solvated sample, dont forget that the solvent also absorbs photons. Computing sample length for unit edge step If any of the elements in the material has a K or L edge energy within 100 eV of the value supplied in the energy box, the sample length for unit edge step will be calculated. This is done by calculating the total absorption 50 volts above and 50 volts below the edge and subtracting the dierence. This dierence is converted into the sample length required to make a transmission edge step of 1. This calculation will be suspect in the odd case where the material has two absorption edges within 50 volts. When preparing a sample for a transmission measurement, both the absorption length and the unit edge step length should be considered. Information depth The information depth is a rough measure of the depth into a sample that the x-rays penetrate and from which the XAS signal can be extracted. The calculation in hephaestus follows L. Troger, et al., Phys. Rev., B46:6, (1992) p. 3283. In that depth, 68 percent of the incident photons are absorbed and 68 percent of the uorescence photons are generated. hephaestus assumes that the sample and detector are placed at 45 degrees to the sample. For other measurement geometries, this calculation will over-estimate the information depth. The information depth tends to be shorter than One way that this calculation might be useful is in estimating the contribution to the XAS signal from an amorphous surface layer of known thickness on top of a crystalline bulk.

12.4

Periodic Table of Chemical Data

This utility is quite simple. Click on an element and several interesting factoids will be reported. Thats it.

12.5

Absorption of Ion Chambers

This utility tells you how much of the beam you ion chambers will absorb at a chosen energy and when lled with a combination of two gases. The selection buttons allow you to choose from several standard detector lengths or a length that you provide. The sliders are used to adjust the fractions of two gasses in the chamber. Only the common gasses (He, N2, Ne, Ar, Kr, and Xe) are available. As you slide the sliders back and forth to change the mixing fractions, the percentage absorption is reported in the space below the sliders. 152
This work is licensed under the Creative Commons Attribution-ShareAlike License.

CHAPTER 12. HEPHAESTUS

Figure 12.3: Periodic table of chemical data

The third slider allows you to change the pressure in the ion chamber for the calculation. The pressure slider is measured in Torr. One atmosphere is 760 Torr.

Figure 12.4: Absorption of ion chambers One shortcoming of this utility is that the percentage is not updated as you type the photon energy or the user supplied chamber length. After changing one of those values, hit the return key or tweak any slider to update the calculation. The photon ux calculation will tell you the ux incident upon the detector using the formula for voltage measured at a given photon energy using a current-to-voltage amplier (such as a Keithley 527 or 528)
e * energy * flux * gain V = -------------------------IonizationEnergy

The ionization energy is about 32 volts for most gasses and the electron charge e is about 1.6E-19 Coulombs. The ux calculation uses the result for percent absorption, thus this result is the net ux upon the chamber and not the measured ux. A rule of thumb that sometimes works for the I0 chamber is to choose gases such that about 10is enough for a good measurement while still leaving most of the photons to interact with the sample. For the
This work is licensed under the Creative Commons Attribution-ShareAlike License.

153

12.6. EMISSION LINE TRANSITIONS transmission chamber, a good rule of thumb is to choose gases that absorb about 2/3 to 3/4 of the photons. This spreads the measurement out more or less evenly over the length of the capacitor plate and still allows some photons to reach the reference chamber. The 2/3 to 3/4 rule works well for the gases in the uorescence chamber as well.

12.6

Emission Line Transitions

This displays a chart of the electronic transitions corresponding to the various uorescence emission lines. There is no interactive component to this page. The chart follows Figure 1.1 in the Center for X-Ray Optics X-Ray Data Booklet.

Figure 12.5: Chart of emission line transitions

12.7

Edge and Line Finders

These utility displays a list of absorption edges or uorescence lines in order of increasing energy. Clicking the button centers the view of the list box around the edge just below the specied energy. This tool is useful in any situation where you need to know what edge or line is in the vicinity of the specied energy. It may be useful to know what edge energy is at an integer multiple of the specied energy. For instance, you may be suspicious that a harmonic of the monochromator is exciting an edge in your sample. Suppose you are seeing a feature at about 6000 eV in your spectrum while using a Si(111) monochromator. You might then suspect that the third harmonic at 18000 eV (the Zr K edge is at 17998 eV) is the culprit. To check, enter 6000 in the entry box and click the third harmonic button on the edge nder page. The information in the edge nder list is the element symbol, the edge symbol, and edge energy. The information in the line nder list is the element symbol, the full Siegbahn line symbol, the IUPAC line designation, a measure of the line intensity, and the line energy. The intensity values are such that all lines of a type (e.g. all K- lines) have intensities which sum to 1. Thus these numbers are for several reasons a very crude measure of how dierent lines which are nearby in energy might relate in a real measurement. Hitting the return key while the focus is on the energy entry box in either page is the same as clicking the Find it button. These utilities use line and edge energies from the Elam data resource regardless of which resource you have chosen to use in other utilities. 154
This work is licensed under the Creative Commons Attribution-ShareAlike License.

CHAPTER 12. HEPHAESTUS

Figure 12.6: (Left) The edge nder (Right) The line nder

12.8

Complex Scattering Factors for the Elements

This utility plots the complex corrections to the scattering factors for the elements. i.e. the energy dependent f (E ) and f (E ) terms. These functions are tabulated from the Cromer-Liberman calculations for the isolated, neutral atom. Solid state eects are ignored. To make a plot, click and element. There are selection buttons for plotting one or both parts of the complex scattering function. There are also selection buttons for setting whether the next plot will be a new plot of if it will add to the previous plot. You can set the energy range of the plot along with the spacing of the grid in energy that is used to interpolate from the tabulated values. Finally, you have the option of convoluting the scattering functions by a Lorentzian of a specied width or, by clicking the checkbutton, using the natural line width of the element. Any negative value for the line width will be set to the natural line width. The most recently displayed complex scattering function can be saved to a le by clicking the button at the bottom of the screen. Only the most recent element and only those parts that were displayed in the most recent plot is saved. The energy range and grid size of the most recent display is used in the output le. To change the element, energy axis, or the parts of the function for a saved le, it is necessary to redisplay the function using the desired parameters.

12.9

Initialization le

The initialization le is C:Program Files\Ifeffit\horae\hephaestus\hephaestus.ini on Windows and /.horae/hephaestus.ini on unix or Mac. You can edit this le to change the startup values of several of the parameters used in hephaestus, including the utility shown at startup and the initial values of the data resource, units, and cross section. The most important use of the initialization le is to enable or disable the use of ifeffit in hephaestus. Set the General ifet parameter to 1 or 0 enable or disable the use of ifeffit. Disabling ifeffit removes the f (E )/f (E ) utility from the button bar, disables the Cromer-Liberman entry in the Resources menu, and disables the lter plotting feature on the absorption page. So why would you want to do that? Well, importing ifeffit into hephaestus increases its memory use dramatically. This may be undesirable on a beamlines data collection computer. The ifeffit-less hephaestus is quite a bit more slender.
This work is licensed under the Creative Commons Attribution-ShareAlike License.

155

12.10. KEYBOARD SHORTCUTS

Figure 12.7: (Left) Complex scattering factors for the elements (Right) Plotting the complex scattering factors of Ti and Ba

12.10

Keyboard shortcuts
Shortcut effect ============================================================= Control-1 display the absorption data utility Control-2 display the formulas utility Control-3 display the chemical data utility Control-4 display the ion chamber utility Control-5 display the emission line transitions chart Control-6 display the edge finder utility Control-7 display the line finder utility Control-8 display the anomalous scattering utility Control-0 display the document Control-q quit Alt-F post the File menu Alt-U post the Units menu Alt-R post the Resources menu Alt-X post the Cross Sections menu Alt-H post the Help menu

12.11

Bugs and Missing Features

Every calculation at high energy is inaccurate in hephaestus. Xray::Absorption does not correctly handle the mass-energy absorption coecients at high energy, although the ion chamber utility does attempt a (very) crude correction. More types of information can be added to the chemical data utility. If there is something you would like to see, you should send the data in an easily readable format (i.e. plain text spreadsheet or word processor les should not be considered easily readable). Merely suggesting new data types is unlikely to have any eect. Supplying the data is highly likely to have an eect. My wish list includes a utility for calculating mirror critical angles and other tools for reectivity, including auger/uorescence branching ratios in one of the periodic table utilities, and providing the Berger/Hubble XCOM tables as one of the data resources. 156
This work is licensed under the Creative Commons Attribution-ShareAlike License.

CHAPTER 12. HEPHAESTUS

12.12

Credits

The layout of hephaestus with its button bar on the left side which changes the mode of the main part of the program was inspired by programs I use on my KDE systems, Kontact for example. I found it eective so I swiped it for this program. The pictures used on the buttons were cropped from images I found using Google. The picture of the ion chamber is from Advanced Designed Consultings web site. Their ion chambers are quite nice. The edge nder icon was swiped from the find.png icon in the kids icon theme for KDE. The line nder icon is from a web page by the Alberta Synchrotron Institute and depicts a uorescence map of some rock. The documentation icon was found under a Creative Commons license at http://battellemedia.com/archives/001952.php. The formulas utility owes much to Gerry Roe, who pointed out a bug, and Erik Gullikson, whose similar utility on the web set me straight. The information used in the chemical data utility is from the kalziumrc le, which was swiped from the Kalzium package. See http://edu.kde.org/kalzium/ for more details. The data for Mossbauer active isotopes was taken from http://www.mossbauer.org. Plotting and function generation in the anomalous scattering utility and the lter plot is provided by Matt Newvilles ifeffit. The ion chamber and edge nder utilities were inspired by the similar utilities in the data acquisition program by Lars Fuerenlid and Johnny Kirkland and in wide use at NSLS. Lars and Johnny seem to have a deeper love of pastel than do I. The electronic transitions chart was created from scratch but slavishly following Figure 1.1 in the Center for X-Ray Optics X-Ray Data Booklet. hephaestus makes use of the Xray::Absorption, Chemistry::Formula, Ifeffit, and Ifeffit::Tools modules as well as Tk and several things from http://www.cpan.org. And, of course, the users of my various software eorts deserve all the credit for kind praise and useful feedback over these many years. The absorption data resources all have literature references. The Elam tables are from W.T. Elam, B.Ravel, and J.R. Sieber, Radiat. Phys. Chem., 63, (2002) p. 121-128. This is the source of data for the edge and line nders and for the lter plot. The McMaster tables were published as W.H. McMaster et al., Compilation of X-ray Cross Sections. Lawrence Radiation Laboratory Report, (1969) National Bureau of Standards, pub. These data were originally compiled in machine readable form by Pathikrit Bandyopadhyay. The Henke tables are derived from B. L. Henke, E. M. Gullikson, and J. C. Davis, Atomic Data and Nuclear Data Tables, 54, (1993). Data is available at the LBL website. The Chantler tables are derived from C. T. Chantler, J. Phys. Chem. Ref. Data, 24, (1995) p. 71 and the data les can be found at NISTs web site. The Cromer-Liberman tables are derived from S. Brennan and P.L. Cowen, Rev. Sci. Instrum., 63, (1992) p. 850. The Shaltout tables were published as A. Shaltout, H. Ebel and R. Svagera, X-Ray Spectrom., 35, (2006) p. 52-56.

This work is licensed under the Creative Commons Attribution-ShareAlike License.

157

Вам также может понравиться