sourCEntral - mobile manpages

pdf

ATHENADOC

NAME

Athena − interactive EXAFS data processing

SYNOPSIS

   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 Athena's gift to them
   beyond all others −− a genius for lovely work, and a fine
   mind too.
                                  Homer, The Odyssey, Book 7

Athena is a program for interactive XAS data processing, including converting raw data to mu(E), aligning, merging, deglitching, Fourier transforming, and plotting. Basically, Athena is intended to handle all chores involving XAS data except for quantitative analysis by fitting to theoretical standards. Athena’s sister program Artemis is the fitting program.

Athena has two interesting and unusual features. The first is that there are no buttons for explicitly removing the background from mu(E) data or for performing Fourier transforms. The only active buttons displayed on the main window are for plotting. Athena always knows when data requires a background removal or a Fourier transform and will perform the necessary analysis steps before displaying the plot.

The second interesting feature is that it is just as easy to perform analysis and plotting chores on multiple data sets as on an individual data set. Athena automates the most common data processing chores and automatically generates plots of one or more data sets.

DESCRIPTION

Athena is a graphical and interactive program written in the perl programming language, using the Tk display engine, the IFEFFIT EXAFS library, and the PGPLOT plotting library. (See below for a list of relevant URLs.)

When Athena starts, you are presented with a window whose layout looks something like this:

     +−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−+
     |    menubar                             |
     +−−−−−−−−−−−−−−−−−−−−−−−−−−−+−−−−−−−−−−−−+
     |                           |            |
     |                           |            |
     |                           |   Group    |
     |     Group                 |   List     |
     |    Parameters             |            |
     |                           |            |
     |                           |            |
     |                           +−−−−−−−−−−−−+
     |                           | Plot crrnt |
     |                           +−−−−−−−−−−−−+
     |                           | Plot mrked |
     |                           +−−−−−−−−−−−−+
     |                           |            |
     |                           |   Plot     |
     |                           |  Features  |
     |                           |            |
     |                           |            |
     +−−−−−−−−−−−−−−−−−−−−−−−−−−−+−−−−−−−−−−−−+
     |    echo area                           |
     +−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−+

As you import data into Athena, data groups are created and those groups are listed in the section labeled ‘Group List’ . You select a group as the active one by clicking the left mouse button on its entry in the group list. When selected, the list entry is highlighted with a pale red background and the parameters associated with that group are displayed in the large area on the left labeled ‘Group Parameters’. When you pass the mouse over a label in the group parameters section, you will notice that the label changes color. This indicates that a mouse click on the label will have an effect. Clicking the left mouse button will display a hint in the echo area as to the function of that parameter. See the section on group operations for the effect of a right mouse click.

The view of the group parameters is replaced when certain features of Athena are used. Choosing any of the options from the Data, Align, Diff, or Analysis menus will temporarily replace the group parameters with views of parameters relevant to the chosen task. For example, when the log-ratio option is chosen from the Analysis menu, the view of group parameters is replaced by a view of the interface to Athena’s log−ratio/phase−difference analysis.

Below the group list are two rows of button for plotting data. The red buttons are for plotting the selected data group. The purple buttons are for plotting multiple data groups. These buttons are labeled according to the data space of the plot. E, k, R, and q refer to energy, photoelectron k, real space R, and back-transform k, respectively.

Below the plot buttons are a set of tabs for specifying the details of the plots in each space. For each space you can specify the range of the x−axis. For energy plots, you can select whether the background function is plotted along with the data and whether the data and background are normalized. For k−space plots, you can select the amount of k−weighting. For R− and q−space plots, you can select which part of those complex functions are plotted. There are also tabs for setting up stacked plots and for establishing plot indicators. For a complete discussion see the section on plotting.

Finally, at the bottom of the page is the echo area. Athena uses this area to display hints, brief help messages, warnings, and updates about recently performed analysis or plotting actions. A few features of Athena will prompt the user for a text string. In those situations, the echo area is temporarily replaced by text string dialog.

Throughout Athena the right mouse button serves to post context sensitive menus. These include parameter labels, groups list entries, and other elements on the screen. You should try clicking the right mouse button in different places to see what useful things might pop up.

NAME

ATHENA’s data groups

When you read data into the program (see the section on importing data) it is assigned to a data group. A data group consists of mu(E) (or perhaps chi(k)) data and all the parameters necessary for performing background removals, Fourier transforms, and other analytical or plotting chores.

When you import data, it is assigned a uniquely named data group for use in Ifeffit and displayed in the group list section of the main window. The entry in the group list consists of a bit of text showing the group’s name to the right of a checkbutton. You can select a group by clicking the left mouse button on its name. When a group is selected, it will be highlighted in pale red in the group list and the values of its parameters will be displayed in the main section of the window. You may modify the parameters by typing in the entry boxes or by selecting menu items.

Clicking the right mouse button on a group name will pop up a menu. The contents of this menu replicate the functionality of the red and purple plots buttons as well as the Group menu from the menubar.

Marking groups

Clicking the checkbutton to the left of the group name in the group list will mark the group. Many features of Athena work on the ensemble of marked groups. The most important of these is plotting. When a purple plot button is pressed, a plot showing all marked groups will be displayed. Some analytical functions, merging (see the section on merging data) for example, also works on the ensemble of marked groups.

There are some features for quickly marking and unmarking many groups. These can be found in the Mark menu or accessed by keyboard shortcuts. All groups can be marked by hitting "Control−a". All groups can be unmarked by hitting "Control−u". The marking of every group can be inverted (i.e. marked groups become unmarked and unmarked ones become marked) by hitting "Control−i". Finally the marking of the currently selected groups (i.e. the highlighted one and the one whose parameters are shown in the main portion of the Athena window) can be toggled by hitting "Control−t".

"Control−r" is the most flexible and powerful option for marking many groups, but also the most confusing. This prompts you for a regular expression which will be matched against the labels in the Groups list. In its simplest form, you can respond to the prompt with a normal string. For instance, suppose your project contained all the iron foil data that comes with the Athena distribution. Then you would have the following groups in the Groups list: "fe_060", "fe_061", "fe_062", "fe_150", "fe151", "fe_300", and "fe_301". These represent multiple scans at temperatures of 60K, 150K, and 300K. If, at the prompt, you enter "_0", then all groups whose labels contain the substring "_0" will get marked, i.e. the ones at 60K.

You can also use meta−characters in your match. These use Perl’s syntax because the expression you give at the prompt is interpreted verbatim as a perl regular expression. In the previous example, if you give "_[13]" as the expression, it will match the groups measured at 150K and 300K because that regular expression means to match against an underscore followed by either a 1 or a 3. Perl’s regular expression syntax is very rich, so this feature allows you considerable flexibility in marking groups.

If you do not know perl’s syntax or find regular expressions confusing, I would still recommend using this feature in its simple form, i.e. avoiding meta−characters. Because data file names are often chosen to be suggestive of the sample and because data acquisition programs often use some kind of incrementation scheme for successive scans, matching against simple strings can still be very handy.

The matching is done case sensitively.

If you know what "(?{ code })" means, then the answer is ‘Yes, Athena does give you enough rope to hang yourself, so don’t.’ If you do not know what that means, then I promise you do not have to worry about it.

More information about perl’s regular expression syntax is easy to find on the web. Try searching for "perl regular expression" on Google.

Reorganizing the group list

You can adjust the order in which groups are listed in the group list by using the keyboard shortcuts "Alt−k" and "Alt−j", which move the current group up and down in the group list. These adjustments will be used by all features of Athena which use the group list (e.g. pull down menus and the order in which groups are written to project files).

ATHENA: Freezing data groups

ATHENA Freezing data groups

A frozen group is one whose parameters cannot be casually changed. The point of this is to avoid mistakenly changing a group using one of Athena’s many facilities for constraining parameter values between groups. By freezing a group, you can be sure that you will not change a group’s parameters away from their carefully set values.

When a group is frozen, there are several visual clues displayed on the screen. The group’s label in the group list will be displayed in italic font. When a frozen group is made current, it’s label will be highlighted in light green rather than the normal pale red. Finally, the heading labels for the different sets of parameters will be displayed in italic font when a frozen group is the current group.

Freezing and unfreezing groups is effected by entries in the Values menu. The submenu labeled "Freeze groups" has several options for freezing one or more groups at a time. One of those options is to freeze all groups whose labels in the groups list match a regular expression. This works identically to the similar method for marking groups, as described in Data groups.

The following are keyboard shortcuts to various ways of freezing groups:

  Control−f        freeze this group
  Control−F        freeze all groups
  Control−U        unfreeze all groups
  Control−M        freeze marked groups
  Control−R        freeze groups matching a regular expression

Those tools in Athena which involve modifying data or parameters do not work on frozen groups, including alignment, calibration, deglitching, and truncation. Those tools which can be used to generate new data groups from existing groups work unaltered on frozen groups, including rebinning, smoothing, convolving, and difference spectra.

Data analysis chores work normally on frozen groups, even though these do, in fact, change certain values associated withd ata groups. These include self-absorption corrections, linear combination fitting, and peak fitting. Log−ratio/phase−difference analysis may not work as expected on frozen groups. It is possible to change Fourier transform parameters for an unfrozen group on the LR/PD page. Those parameters will not be changed for a frozen group, thus the LR/PD analysis will not respect the parameter values specified on the LR/PD page.

A few other small features work normally even for frozen groups, including changing group labels (via the Groups menu or by control−l) and setting stacked plots. Also, the y−axis offset parameter is the sole parameter on the main page that may be edited for a frozen group.

NAME

ATHENA − Importing data

Athena uses Ifeffit for data import, thus it uses all the same rules for what kind of data is interpretable (see the Ifeffit document for details). In short, Athena should be capable of reading most plain−text, column data, including the files generated by the data acquisition software at many of the world’s EXAFS beamlines.

Special care is taken to handle data files which have Macintosh end−of−line characters. Also files which exist in deeply nested folders and so have fully resolved file names which might pose a problem for Ifeffit’s string length limitation are also handled specially. In both cases the files are copied by Athena into a temporary location and, in the case of Macintosh files, converted to unix end−of−line convention before importing via Ifeffit.

Among the data types that you can import are

Two column mu(e) data with columns for energy and mu.

Two column chi(k) data with columns for photoelectron wavenumber and chi.

Raw data with columns for each detector

The files "mu.dat" and "chi.dat" from Feff.

Dispersive XAS data measured as a function of pixel on a camera.

After selecting a file with the file selection dialog, you are presented with a column selection dialog. The text of the data file is displayed on the right side of this dialog. This will help you select the correct columns. This dialog is used to indicate which column in the data file contains the energy (or wavenumber) array and which column(s) are used to construct mu(E) (or chi(k)). In the case of mu or chi data, Athena will make a good guess about which column contains the data. In the case of raw data, Athena will attempt to recognize columns containing fluorescence or transmission data. It is not always successful, so you may need to indicate which columns to use in the numerator or denominator. For transmission data, you also need to click the button indicating that a natural log of the data must be taken.

As you select columns for constructing the data, the mathematical formula will be displayed in a text box below the buttons. Remember that for transmission data the formula is

      ln( I0 / It )

and so you would select the "I0" column as the numerator and the "It" column as the denominator. For fluorescence (or electron yield) data the formula is

      If / I0

and so "If" is the numerator and "I0" is the denominator. You can handle multi−element detector data by selecting multiple columns for the numerator. In that case, a formula like this will be displayed

      (I1 + I2 + I3 + I4) / I0

For multi−element data, you have the choice of performing this summation on the fly or of reading each element into an individual data group. The latter choice is convenient if you want to examine each element individually before merging some or all of them.

The replot button will simply replot the current column selection. This is most useful when the reference column selection has been plotted, as described below.

Reading multiple files

Since version 0.8.052, single and multiple files selection is handled with the same dialog. The multiple file selection dialog from earlier versions is no longer in use. To select more than one file, keyboard−mouse events are used. If you select a file then shift−click another file, all files between the two, inclusive, will be selected. If you control−click on a file, then that file will selected in addition to all previously selected files.

In that way, you can import many files into Athena all at once. If Athena notices that one of the files is formatted differently from the previous file, it will redisplay the column selection dialog, otherwise it will import each file without the need for your interaction.

Setting a reference channel

If your data file contains a reference channel that you wish to use to align and aclibrate your data, you need to read in the reference channel in at the same time as your data. This is done by pressing the button labeled "Set reference channel". Doing so will display a grid of columns much like the one used to specify the data. Use this grid to set the numerator and denominator of the reference signal. The same energy array will be used for the reference as for the data. There are buttons for indicating if the reference is the same element as the data and for plotting the current reference column selection.

If you set a reference channel, a data group will be created for the reference and placed in the Data Groups list just after the data. The reference channel is treated like normal data in every way but one. The E0 shift parameters of the data and its associated reference are strictly constrained to be the same. As one changes, the other will change as well. The reference channel can then be used to align the data. Using the data alignment dialog to align the reference channel will thus have the effect of aligning the data simultaneously. See the section on data alignment for more details.

Preprocessing

It is possible to do extensive preprocessing of imported data files. This works on the assumption that you have imported one file from a group of related data files, established good values for its parameters, and are willing to apply those parameters to other imported data without individual interaction. This can be a big time saver if you are importing large quantities of related data.

There are five preprocessing chores that can be done on a data file

Truncation using the truncation energy of the standard. See the section on truncating data.

Deglitching using the algorithmic deglitching parameters of the standard. See the section on deglitching data.

Crude alignment to the standard. See the section on aligning data. The energy shift applied during preprocessing will be applied to the energy array associated with the data group before any other processing chore proceeds.

Constraint of all parameter values to those of the standard. see the discussion of constraining parameters in the group operations section.

These preprocessing steps are all optional and are performed in the order listed. Take care particularly with truncating and deglitching, which permanently remove data points from the preprocessed data group.

To preprocess data, click the preprocessing button in the column selection dialog. Doing so will expand the dialog vertically to accommodate all the widgets for setting preprocessing parameters.

Next select a preprocessing standard from the menu labeled ‘Standard’. This menu contains all the mu(E) data groups currently in the group list. Once you select a standard, all the rest of the widgets will activate and the standard will be plotted along with the deglitching tolerance lines and the truncation energy. You can select preprocessing steps by clicking on their checkbuttons then adjusting the parameters as desired.

Once you are ready, click OK. The new data group(S) will be read in, the preprocessing steps will be performed, and the processed data will be plotted.

Conversion of encoder readings to energy

Need to know d−spacing, steps/degree, and the zero offset. D−spacings in the program are for room−temperature, not 50C, not 77K.

NAME

ATHENA − Saving data

Saving and restoring projects

Athena allows you to save projects. A project consists of all data groups, their parameters, the current values of the plotting parameters from the plot features section of the window, the current set of plot indicators, and the project journal. An option for saving your project is found in the File menu. The project file is a flat text file formatted in a way that is a bit hard for a human to read but quick and easy for Athena to read.

Restoring a project is done by importing it just as you would a data file. Athena will recognize one of its own project files and interpret it accordingly.

Reading in a project file will not alter any current data groups. The data groups from the project will be appended to the groups in the group list.

Saving data files

Spectra from a data group can be saved as ASCII column data using options in the File menu. Spectra in any of the four data spaces can be saved. Energy spectra can be saved as normalized, derivative, or plain mu(E) and the background function is saved as the third column in a mu(E) or normalized mu(E) file. chi(k) files are three columns, "k", chi(k), and the window in "k" used for the Fourier transform. chi(R) is a six column file where columns 2 and 3 are the real and imaginary parts, column 4 and 5 are the magnitude and phase, and column 6 is the window in "R" for the Fourier back−transform. chi(q) is a five column file with the same format as the chi(R) file, bjut without the column for the window. If the data is from a merged mu(E), norm(E), or chi(k) group, then an additional column will be saved containing the standard deviation array.

You may also save the set of marked groups as columns in a single data file. For chi(R) or chi(q) data, you specify which part of the complex function you want to save. A file like this may be handy for importing into a plotting program for making publication−quality plots.

NAME

ATHENA − Plotting data

Athena aspires to make it as easy to plot a large number of data groups as it is to plot a single data group. By pressing one of the red plot buttons, the selected data group (i.e. the one highlighted in pale red in the groups list) is plotted in the chosen data space. By pressing one of the purple buttons, all marked groups (i.e. all groups whose purple checkbuttons are checked) are plotted in the chosen data space.

In the Plot menu in the menubar are options for zooming and unzooming a plot. To zoom in on a region of a plot, select Zoom and, in the plot window, click two points indicating the corners of the zoom region. You can zoom repeatedly. Unzooming will restore the original plot.

The Cursor option in the Plot menu asks you to click on a point in the plot window. The x and y coordinates of that point will be written to the echo area.

The last plot can be written to a graphics file by selecting the appropriate option in the "Save image as" submenu in the Plot menu. Currently only a limited number of graphics formats are supported. Selecting Print from the Plot member will send the last plot directly to a printer, but this currently only works on a few platforms and then not very reliably.

It is possible to detach the plot buttons from the main window. This places the red and purple plot buttons in their own small window which can be dragged anywhere on the screen. This feature does not work on Windows.

Plotting marked groups

As mentioned above, groups are marked by clicking on the checkbutton net to their entries in the groups list. Pressing a purple plot buttons will plot each of the marked groups. There are a few ways of handling the marking of multiple groups. Each of these is available by a key sequence as well as by selecting an entry from the Mark menu.

All groups can be marked by hitting "Control−a". All groups can be unmarked by hitting "Control−u". The marking of every group can be inverted (i.e. marked groups become unmarked and unmarked ones become marked) by hitting "Control−i". Finally the marking of the currently selected groups (i.e. the highlighted one and the one whose parameters are shown in the main portion of the Athena window) can be toggled by hitting "Control−t".

Plotting in energy

You can plot the data, its background function, its pre−edge line, and its post−edge normalization line by clicking on the appropriate check buttons. You can also plot normalized or derivative spectra, however either of those precludes plotting the pre− and post−edge lines. The plot will be remade whenever you click one of these checkbuttons.

The range on the x−axis is chosen by the boxes marked Emin and Emax.

You can control separately how single and marked groups plots are made. The red check buttons control how single group plots are made and the purple buttons control marked group plots. These colors are chosen to correspond to the colors of the plot buttons. Note that the pre− and post−edge lines and the background function cannot be drawn for multiple data set plots.

Choosing the k−weight

Between the plot buttons and the Plotting options section is a row of check buttons. The purpose of these is to select the k−weight that will be used in plots made in k, R, or q.

Plotting in k−space

The k−weight of the plot and the Fourier transform are always the same, unlike in versions of Athena before 0.8.051. The option labeled "chi*k^kw" uses whatever value is specified for the arbitrary k−weight in the Fourier transform section of the main window. That option is useful for values of k−weight other than 0, 1, 2, or 3, or for plotting two or more spectra each with different k−weights.

The Fourier transform window in k can also be plotted by selecting the button labeled ‘Window’.

Again the red and purple buttons indicate how single and marked group plots will be made and the x−axis range is chosen by the setting values in the text boxes at the bottom.

Plotting in R−space

You can plot any of the parts of the complex Fourier transform −−− the real, imaginary, magnitude, or phase. You may also plot the envelope, which is the magnitude plotted with the negative of the magnitude. For single group plots, many parts can be over−plotted. For example, the real part can be plotted inside the envelope by selecting those two red buttons. For marked group plots, only a single part can be plotted. This restriction is in place to avoid very cluttered plots that take a long time to display.

The k−weight of the Fourier transform is chosen by selecting the k−weight buttons just below the plotting buttons. Note that this behavior is different than in versions prior to 0.8.051.

The Fourier transform window in R can also be plotted by selecting the button labeled ‘Window’.

Again the red and purple buttons indicate how single and marked group plots will be made and the x−axis range is chosen by the setting values in the text boxes at the bottom.

Plotting in q−space

You can plot any of the parts of the complex Fourier backtransform −−− the real, imaginary, magnitude, or phase. You may also plot the envelope, which is the magnitude plotted with the negative of the magnitude. For single group plots, many parts can be over−plotted. For example, the real part can be plotted inside the envelope by selecting those two red buttons. For marked group plots, only a single part can be plotted. This restriction is in place to avoid very cluttered plots that take a long time to display.

The k−weight of the forward Fourier transform is chosen by selecting the k−weight buttons just below the plotting buttons. Note that this behavior is different than in versions prior to 0.8.051.

The Fourier transform window in k can also be plotted by selecting the button labeled ‘Window’.

Again the red and purple buttons indicate how single and marked group plots will be made and the x−axis range is chosen by the setting values in the text boxes at the bottom.

k−q plots

There is a red, single group plot button labeled kq. This plots chi(k) along with the real part of the back−transformed spectrum. If the window button is selected either for k− or for q−space plots, then the window will also be displayed. The k−weight indicated for the Fourier transform is always used so that the two spectra are of the same size.

Stacking plots

A stacked plot is one in which the different traces are offset vertically. In Athena a vertical offset is applied to a trace by setting the y−axis offset parameter for a data group to a non−zero value. This parameter can be set in an evenly incremented fashion for the set of marked groups by selecting the "Stacked plot" tab in the Plotting options. Enter a number for the y−axis offset parameter of the first marked group and for the size of the incremenet. Press the button that says "Set y−axis values", then press one of the purple plot buttons to see the stacked plot.

Indicators

An indicator is a mark placed at an x−axis value whenever a plot is made. Indicators do not go away when a new plot is made. Instead the indicator is drawn on every new plot. Indicators are thus a convenient way of highlighting a particular feature in a data set and comparing that feature between data sets.

To set the indicators, select the plotting options tab labeled Ind. then click on one of the plick buttons. You will be prompted to select a point by mouse clicking on the plot. The value you click on will be recorded as will the space of the plot from which that point was selected. You may defined several indicators at a time.

Indicators chosen from plots in energy, k, or back−transform k will be drawn whenever a new plot is made in energy, k, or back−transform k. Indicators chosen in energy will be converted to k for plots in k or back−transform k. Indicators chosen in k or back−transform k will be converted to energy for plots in energy. Thus indicators can be used to understand how features in energy spectra appear in chi(k) and vice versa.

Indicators chosen from plots in R will only be displayed in R−space plots.

The indicator is a vertical dashed line whose height is chosen to fit conveniently in the plot. They are drawn for both single and multiple data set plots. The check button labeled Display indicators in the Ind. tab controls whether or not the indicators are actually drawn. Thus you can suppress theplotting of indicators without loosing the positions you have selected.

The point finder

The point finder tab in the plotting options section of the screen is used to identify the exact values of points in various plots. It works by specifying a point on the x−axis of the recent plot or by selecting a point using the pluck button then clicking the button that says "Find Y". This will insert the y−coordinate that corresponds to the given x−coordinate into the text box below. It will also replot the data, indicating the selected point with a green cross.

Used once, this is not too different from the cursor function found in the Plot menu. The real strength of the point finder lies in using it to find y−coordinates for a given x−coordinate in two or more plots. You can specify an x−axis coordinate, find the corresponding y−axis coordinate, plot a different data set, and find its corresponding y−axis coordinate. It thus allows you to investigate the scan−to−scan behavior at a particular energy point, k−value, or R−value.

The point finder works by interpolation. That is, it does not find the data point closest to the indicated x−coordinate. Rather it, interpolates a y−coordinate from the data at the specified x−coordinate. Also, when an x−coordinate is plucked from the data, ony the x−position of the cursor is used. That is, the interpolation is done at the x−position of the selected point and not at the data point closest to the cursor.

The reverse operation −− selecting a y−coordinate and finding the corresponding x−coordinate −− does not yet work.

The plot multiplier

Occasionally it is useful to scale the y coordinates of a plot by some constant. The plot multiplier, set at the very bottom of the group properties part of the main window serves this purpose.

The plot multiplier is set automatically for detector groups (see the section on group operations) so that the detector groups and mu(E) will plot on the same scale. The plot multiplier is also useful for comparing chi(k) with different k−weights. Giving a plot multiplier larger than 1 to the group with the smaller k−weight will plot the two spectra on similar scales.

0 is usually a poor choice for this parameter, although Athena will, in fact, allow you to set it to that value. If Athena notices that a group has 0 as its plot multiplier, a warning will be printed to the echo area.

Pluck buttons

Scattered throughout the group parameters section of the main window and in other places throughout Athena are little buttons displaying a blue cross. These buttons are for plucking parameter values for the plot window. To use them, press the pluck button then click on a point in the plot window. The x coordinate where you clicked will be inserted in the text box to the left of the pluck button.

ATHENA: Plot styles

ATHENA − Plot styles

Plotting styles are collections of the parameters contained in the E, k, R, and q tabs in the Plotting options section of Athena used to describe how plots are made in energy, k, R, and q. Each collection is given a name and is saved in an external file for use in susequent Athena sessions. There is always one style available called "default" containing values for the plotting options set by the values from the user preferences. One example of a plotting style might be to save emin and emax values appropriate for plotting XANES data saved under the name "xanes". As another example, you might have a particular data set for which you plot an especially long or short k−range. It is quick and easy to switch between saved plot styles.

All the functionality for plot styles is accessed via a menu that becomes avalable when the cursor passes over the "Plotting options" label just above the various tabs. You will notice that the label changes color as the cursor passes over it. Clicking the right mouse button posts the plot styles menu.

The first option in the menu allows you to save the current set of plotting parameters. You will prompted for a name. The second option is a submenu for restoring one of the named plot styles. The third option is for removing one of the name plot styles from the list.

Note that plot styles saved using this utility are not specific to a project and persist between sessions. Also note that the default style is determined by the settings of the user preferences and not by the plotting options which are saved to a project file.

Currently only the contents of the E, k, R, and q tabs are saved in a plot style. In the future, the parameters for the indicators and the stacked plots might be saved as well.

NAME

ATHENA Interactive EXAFS background removal

The energy shift

The energy shift is applied to the energy array associated with the data group before any other processing chore proceeds. The energy shift can be entered by hand, but is much more commonly obtained using the alignment dialog. It may also be set automatically as data is imported if the alignment preprocessing feature is used. The value for E0 is the value after the energy shift is applied to the data.

The AUTOBK algorithm

Normally, Athena uses the Autobk algorithm to determine the background and normalize mu(E) data. This algorithm is describe in detail in Near−edge x−ray−absorption fine structure of Pb: A comparison of theory and experiment, M. Newville, et al. Phys. Rev. B47:21 (1993), pages 14126−−14131.

In short, the background is determined by optimizing the low frequency components of the Fourier transform of the data. The "Rbkg" parameter determines the cutoff frequency below which the optimization happens. Thus, the spline is varied until the transformed spectrum between 0 and "Rbkg" is optimized. In general, this means that portion of the spectrum is simply minimized, however you may choose a background removal standard and optimize the spectrum by making the data closely match the standard between 0 and "Rbkg". Thus, with a standard, the spectrum below "Rbkg" may have significant spectral weight.

Another way of looking at the Autobk algorithm is that it uses "Rbkg" to define the Fourier frequency below which the signal is dominated by the background and above which the signal contains the data. Thus Autobk attempts to remove those Fourier components which are due to the background while leaving those which contain the data.

Often a Feff calculation is used as a ‘Standard’, although you may wish to use another data set with a background removal you have reason to trust. To use a Feff calculation, import a chi.dat file along with your data. Select your data and then select the chi.dat file from the standards menu in the group parameters section of the main window.

Occasionally, you may have reason not to trust the edge−step determined by the normalization routine. In that case you can specify one explicitly by editing its value and check the button labeled fix step. If you do not check that button, the value will be recomputed from the normalization algorithm and overwritten in the Edge step entry box.

Normalization

Edge step normalization is used by Athena. That means that the difference between mu(E) and mu0(E) is divided by an estimation of mu0(E0). This edge step value is determined in a way that is quite standard among EXAFS programs. A line is regressed to the data in some region below the edge and subtracted from the data. Then a quadratic polynomial is regressed to the data in some region above the edge and extrapolated back to E0. The extrapolated value of the post−edge polynomial at E0 is used as the normalization constant. These two regressions are controlled by the Pre−edge range and Normalization range parameters in the group parameters section of the main window. The normalization constant is reported in the Edge step box.

The order of the polynomial can be set to 2 (linear) or 3 (quadratic) using the normalization radio buttons on the "additional" background parameters page. Changing the order of the polynomial will influence the value of the normalization constant and will also change the appearence of the flattened data, as described in the next section. Changing polynomial order may be a useful tool when dealing with XANES data of limited data range.

Flattening

The quadratic polynomial which is regressed after the edge is normally used only to determine the edge step. It is quite possible for a set of properly normalized spectra to overplot very nicely as chi(k) but not as norm(E). This is because the standard normalization does not alter the shape of the background function beyond the edge. If there is variation in the over−all slope beyond the edge, a set of overplotted norm(E) spectra will form a sort of fan beyond the edge. Flattening is a visualization trick which subtracts the linear and quadratic portions of the post−edge polynomial from the data in such a way that the flattened, normalized spectrum oscillates around 1. Thus, much of the variation in the background functions in an ensemble of data can be suppressed when plotting. This is particularly useful when making plots of XANES data.

The flattening is purely visual. The subtraction of the post−edge linear and quadratic portions of the background is made only for plotting. chi(k) is not in any way affected by the flattening operation.

In the Background removal section of the main window, there is a check button which turns flattening on and off for the data group. When flattening is turned off, the standard norm(E) spectrum will be plotted. Flattening is controlled group−by−group, so it is possible to make a multiple data set plot in which some spectra are flattened and others are not.

Spline clamps

Spline clamps are an optional feature for use in background removal. They provide a restraint to the Autobk algorithm which seeks to coerce the background spline not to diverge from the data at the ends of the data range. This restraint takes the form of a penalty in the evaluation of the fitting metric for a background spline when the spline diverges from the data at the ends. There are optional clamps at either end of the data range. By default, only the high−energy clamp is used. Athena offers menus for choosing the strength of the restraint (i.e. the magnitude of the penalty for a diverging background) for each clamp. The strength indicates the size of the penalty dor deviation of the background from the data.

One of the example data files that comes with Athena is called "clamp.prj". It is a project file which demonstrates the effect of different high−energy clamping strengths on data for which the background shows a tendency to diverge. Import this project and plot the data in k−space and in R−space to see this effect.

Cromer−Liberman normalization

For XANES data or in a situation where the AUTOBK algorithm is unsatisfying, it may be useful to have a consistent, reliable way of normalizing your data. Athena allows you to normalize by matching to the Cromer−Liberman calculations for the absorption of a free atom. The measured spectrum is adjusted to match the energy dependence of the Cromer−Liberman calculations at energies far below and above the edge. While this is a very consistent way of normalizing data, especially data of limited range as is often the case in XANES measurements, it is rarely a useful way to extract chi(k).

The "CLnorm" algorithm requires knowledge of the absorbing atom. When Athena imports data it attempts to determine the absorber by comparing the E0 value (determined by inspection of the derivative spectrum) to a table of atomic edge energies. On occassion, Athena guesses wrong. In those cases, you should set the absorber element by hand using the Z menu near the top of the screen.

When "CLnorm" is chosen, several of the widgets for editing parameters used by the AUTOBK algorithm are disabled.

The details of the Cromer−Liberman calculations can be found in Relativistic Calculation of Anomalous Scattering Factors for X−Rays, D.T. Cromer and D. Liberman, J. Chem. Phys. 53 (1970), pages 1891−−1898.

NAME

ATHENA’s Edit menu

Many features of Athena involve displays of text. To keep these things neat and organized, all such textual displays are placed in notecards in a pop−up dialog that can dismissed from view. The text palettes can be summoned into view from the Edit menu. Once the palette is displayed, the different palettes are on tabs and so it is easy to switch between them. Earlier versions of Athena did bad things if you dismissed the palettes window by clicking the delete button on the window decorations. That bug has been fixed. That button and the button within the window that says "Dismiss" behave identically.

The IFEFFIT buffer

Athena works by constructing commands for Ifeffit based on the current state of the data groups and passing those commands to Ifeffit. Almost all commands sent to Ifeffit are also displayed in the Ifeffit buffer palette. This buffer is useful for diagnosing analysis problems, debugging the program, and learning how to use Ifeffit directly.

At the bottom of this palette is a direct link to Ifeffit. Commands typed into this text box will be sent directly to Ifeffit. This allows you to perform arbitrary commands beyond the normal scope of Athena’s operation. This command line has some of the features of a shell command line, including tab completion of Ifeffit keywords and a command history accessed by the up and down arrows.

The titles buffer

The title lines associate with the currently selected data group are displayed in the titles buffer. These are typically the lines in a data file which preceed the column data, however additional title lines might be generated by Athena or even added or deleted by the user.

Direct editing of data

Although Athena allows interactive deglitching and data truncation, sometimes it is easier to directly edit the data file. In this palette, the data file is displayed in a text box. You can edit the data as text. Pressing the Save button will overwrite the data file and re−read the data into Athena. Note that data from projects cannot be edited in this way.

The echo buffer

All hints, error messages, and update messages written to the echo area are also written in the echo buffer. Thus the echo buffer is a crude historical record of your current Athena session.

Recording macros

In Athena, a macro is a recording of the commands sent to Ifeffit and to the Ifeffit buffer. To record a macro press the Start Recording button in the macro palette then do whatever sequence of analysis and plotting chores you want to record. When finished press the Done button and you will be prompted for a file in which to save the macro.

These macros can be reimported into Athena or imported directly into Ifeffit. They are also useful for learning to manipulate Ifeffit directly or for use as the basis of a batch processing script. A macro may be a useful addition to a bug report.

Project journal

Probably the most important of these textual interaction is the project journal. This is a simple text−box where you can write down notes relevant to your data analysis. The contents of this journal is saved when you save a project into a project file and is restored when you import a project.

The active use of the journal is highly recommended. Maintaining a journal can make it much easier to return to and understand a project after even a short absence.

Reports

Also in the Edit menu is a submenu for generating reports about the current project. Most of the report formats are ways of presenting the data groups and the values of their various parameters. Two of the report formats are intended for use with spreadsheet or database programs. The parameter values either for all groups or for all marked groups can be written to a file in the Excel95 format. This can be read by many common spreadsheet programs, including Excel, Gnumeric, KSpread, and OpenOffice Math. The second format is a comma−separated−value file. It too can be read by spreadsheet programs as well as by database programs. The third report format is a plain text, columnar report on all the groups or on the marked groups.

The final item in this submenu is of rather special interest. Some users of the EXAFS analysis program XFit like to use Athena and the Autobk algorithm to do background removal but them prefer to use XFit to analyze the data. The XFit file output has the results of the background removal written in the format expected as input by XFit.

NAME

ATHENA’s Group and Values menus

There are several functions in the Group menu that operate on individual groups. Groups can be copied, renamed and removed. Care is taken with copied and renamed groups to assure that group names are unique. Individual groups, marked groups, or entire projects can be removed. This means that these data are removed from Athena’s memory, not that the data or project files are deleted from the disk.

You can also reset the e0 value for a group form the Group menu. There are two options, one is to reset it to the value of the first inflection point in the edge. The other is to use a tabulated value for the absorbing atom. The tabulated values are only available if the program Atoms is also installed on your system.

Another option in the Group menu is used for identifying a data group. This tells you what kind of data the groups contains (some common data types are mu(E), normalized mu(E), chi(k), merged chi(k), and so on) as well as the group name used to manipulate this groups data within Ifeffit. If you look at the Ifeffit interaction buffer, you will see that all commands related to the data group use the group name. The group name is restricted to 8 characters or less. The restriction is in place in an attempt to avoid generating Ifeffit commands that are too long for Ifeffit’s parser.

There are also a couple of option in the Group menu for reordering items in the Data list. The current group can be moved up or down a slot at a time in the list by selecting the "Move up" or "Move down" options, or by hitting the "Alt−k" or "Alt−j" key sequences. The new order of the list is reflected in all parts of Athena that use the list, such as the Standards menu or the order of groups in a project file.

Detector and background groups

If a group was imported from raw data, you may create detector groups. These are new data groups that have, as their data, the numerator and denominator of the function used to create the mu(e) data. Typically, these groups are the I0 channels and the transmission or fluorescence channel. Detector groups can only be plotted in energy and cannot have background removal or Fourier transforms performed on them. When the detector groups are made, their plot multipliers (see "The plot multiplier") are set to values appropriate for over−plotting the two detector groups with the mu(E) data. Detector groups are useful for identifying the source of glitches or other systematic errors. Information about the detectors is not saved to the project file, thus detector groups can only be created when working from raw data files.

If a group can be plotted in energy (i.e. it is mu(E) or normalized mu(E) data), you may create a background group. This is a new data group that contains the background function as its mu(E) data. The data in this group is treated just like normal data in that it can be plotted in any of the four energy spaces. Background groups are useful for comparing the results of background removals using different parameters. They may also be useful for comparing to a calculated mu0(E) function or for interpreting low−R phenomena such as multi−electron effects or the so−called atomic XAFS (AXAFS).

Constraining parameters

It is possible to constrain parameters between data groups. That is, you can adjust one or more parameters for one data groups and then set parameters for other data groups to be the same. There are several ways of applying these parameter constraints.

In the Group menu are options for setting all the parameters all at once. You may set the parameters for every other data group to the values for the selected group. You may also set the parameters only for the marked groups to those of the selected group. Note that the two options in the Group menu operate of every single parameter displayed in the main window.

For finer−grained control over applying parameter constraints, click the right mouse button on the blue labels for the background removal or Fourier transform sections of the main window. This allows you to constrain those groups of parameters as described above without affecting the other parameter groups.

For the finest−grained control over applying parameter constraints, click the right mouse button on the label of the parameter that you want to constrain. As the mouse passes over the label, you will see that label change color. That is a visual cue that pressing a mouse buttons will have an effect. When you click the right mouse button, a menu will pop up allowing you to constrain the value of that parameter. Again, you can set that parameter for every group or only for the marked groups. You can also set that parameter in the selected group to its value in the ‘standard’ group.

The concept of the ‘standard’ is a moving target. If one and only one group is marked, that group is the standard. Thus the standard can easily be changed. If zero groups are marked, then there is no standard. Attempting to constrain to the standard when no standard is defined will result in a hint being written to the echo area. If two or more groups are marked, then again there is no standard and a note will be posted to the echo area.

Session defaults

Athena offers a lot of control over how parameter values are set when data is first imported into the program. Global default values for all the parameters can be set using the prefernces dialog. These defaults can be adjusted within a session by setting the session defaults. When you set the sesson defaults, the values are taken from the current values for parameters for the selected group. When new data is imported into Athena, the defaults will be taken from the global defaults unless the session defaults are set. In that case, the session defaults will be used.

Like the parameter constraints, the session defaults can be set with the different levels of ganularity. Individual parameters can be set as session defaults, groups of parameters, or all the parameters. The options for setting the sessions defaults are found in the right−click, context menus for individual parameters, the context menus for parameter groups, and in the Values menu. Also in the values menu is an option for unsetting the session defaults.

Restoring default parameter values

The right click menus described above also have an option (for most but not all) parameters) to restore the default value. When Athena starts it reads all default parameter from a configuration file. Restoring a default means to use the configuration default for a parameter. Restoring defaults is an attractive option if you have been playing around with lots of parameters and you want to abandon all changes and start over.

NAME

ATHENA Interactive EXAFS energy calibration

Energy calibration is the assignment of a particular energy value to a particular point of mu(E) data and shifting all the other data points accordingly. For example, it is common to assign the atomic edge energy to the first large peak in the first derivative spectrum. Athena handles this by using an E0−shift parameter.

When energy calibration is chosen from the Data menu, the view of the group’s parameters is replaced in the main window by a dialog for setting the calibration. This dialog allows you to view the data as mu(E) or as its normalized, derivative, or second derivative spectrum. The location of the current value of E0 is displayed as the reference point. This reference point can be changed by hand or by clicking the "Select a point" button and plucking a point from the plot. Below the reference point is a control for applying various iterations of smoothing using Ifeffit’s three−point smoothing function. Below that is the energy to which that point should be calibrated. By default this gets filled with the atomic edge energy, but it too can be changed by hand. Once you have values for the reference and the calibration that you like, click the "Calibrate" button. This will compute the correct value of the E0−shift to perform this calibration. That E0−shift will be used in all further displays of the data.

The "Select a point" button simply uses the x−value of the point in the plot where you click as the reference point. The smoothing is applied to the data before the first or second derivative is calculated.

Smoothing

It can be difficult to decide on a point to choose as E0 in noisy data. Athena allows you to smooth the data before calibrating. This applies Ifeffit’s "smooth()" function, which does a simple three−point smoothing, one or more times before plotting the data.

Finding the zero crossing

An alternative to the "Select a point button" is the "Zero crossing" button, which becomes active only when plotting the second derivative of the spectrum. Clicking that button tells Athena to find the energy value of the closest point to the current value for the edge energy that crosses the zero axis. In fact, Athena finds the energy values on either side of the nearest zero crossing and linearly interpolates between them to find the zero crossing.

Note that this only finds the zero crossing. You must press the "Calibrate" button to actually perfomr the data calibration.

Since the zero crossing algorithm finds the zero crossing nearest to the current choice for E0, it may sometimes find a point that is not the one you were looking for. In that situation, use "Select a point" to pick a spot close to the zero crossing you want, then try the zero crossing algorithm again.

Calibrating and aligning many data sets

Note that calibrating two data sets does not ensure that they will be aligned. One way of calibrating and aligning data is:

1.

Calibrate the first data set in the list

2.

Constrain all other data sets to use the same value for E0

3

Use the alignment dialog to align the data.

You can begin calibrating a new data set simply by clicking on another group in the group list. When you click on the new group, its reference point and suggested calibration value will be inserted into the calibration dialog and the data will be plotted along with a marker showing the reference point.

NAME

ATHENA Interactive EXAFS data deglitching

ATHENA uses two schemes for deglitching the current data group, that is for removing spurious points that lie far above or far below surrounding points. The first method is a ‘pick and delete’ scheme. On the deglitching view accessed from the Deglitch menu, there is a button labeled ‘Choose a point’. Clicking that will raise the plot window and prompt you to select a point on the graph. The data will be redisplayed with the selected data point marked by a circle. If that is the correct data point for removal, click the button labeled ‘Remove point’.

The second deglitching scheme is an algorithm that attempts to identify and remove all glitches from either the pre−edge or the extended region. The algorithm works by defining a tolerance and an energy range. The data will be plotted along with either the pre− or post−edge line (depending on the chosen data range). Additionally, lines will be drawn above and below the pre− or post−edge line, separated by the amount of the tolerance. Any data points which extend above or below the tolerance lines will be removed from the data when the Remove glitches button is clicked.

Points removed by deglitching are lost from the data group, but the data file from which they came is not altered.

The Athena distribution provides example files for testing deglitching. These are uhup.003, which has glitches in the extended data range, and Udsvuo2.029, with glitches in the pre−edge. Use these files to play around with the two deglitching methods.

NAME

ATHENA Interactive EXAFS data truncation

The Truncate option in the Data menu displays a view for truncating data. This view allows you to define an energy and to choose whether the data points before or after that energy are removed from the data. If the cutoff direction is chosen as "after", then all data points at energies higher than the selected energy will be removed from the data set. Similarly, if the direction is "before", all data points with energies less than the selected energy will be removed.

Note that truncating data permanently alters the data group in a way that can only be recovered by reimporting the data. Once you truncate, you cannot untruncate. However, truncating does not effect the original data file.

Truncation might be useful if data becomes noisy or distorted after a particular energy or if the measured data range extends past a second absorption edge.

Note that truncation is rarely required of data. The pre−edge range can be chosen to start after the point where you might truncate or the normalization and spline ranges can be chosen to end before the point in the data at which you might truncate. For many purposes this is sufficient and has the advantage of not altering the data.

NAME

ATHENA − Rebinning data

The rebinning utility uses Ifeffit’s rebin() function to move oversampled mu(E) data onto a sparser grid. A common example of oversampled data is the spectrum from a quick XAS measurement (i.e. one in which the monochromator is slewed continuously in some manner during the measurement). This works by performing a boxcar average for each point on the sparse grid. The main advantage (from the point of view of analyzing EXAFS data) is to lower the overhead within Athena. The sparse grid is often one quarter the size of the oversampled grid or smaller. The algorithm used here is exactly the same as the algorithm used by Ifeffit to move data from the energy grid to the wavenumber grid during background removal. Thus the chi(k) and chi(R) are statistically (although probably not numerically) equivalent for the oversampled and rebinned data.

The sparse grid is composed of three regions, pre−edge, edge, and EXAFS. To construct the grid, Athena requires that the user specify five numbers. The first two numbers specify the boundaries of the regions. The default boundary values are −30 eV and +50 eV. This means that edge region begins 30 volts below the edge energy and extends to 50 volts above the edge energy. The next three numbers specify the size of the grid in each region. The default values are 10 eV for the pre−edge region, 0.5 eV for the edge region, and 0.07 inverse Angstroms for the EXAFS region. Note that the grid is always uniform in energy in the pre−edge and edge regions, but uniform in wavenumber in the EXAFS region.

The rebinning dialog

Data can be rebinned at any time by selecting the rebinning dialog from the Data menu. This dialog provides entry boxes for specifying the five parameters of the sparse grid and uses the selected edge energy for the group. Only mu(E) data groups can be rebinned.

Once you have specified the parameters, press the button labeled "Plot data and rebinned data" to see the result of the rebinning. You can then save the rebinned data as a data group by pressing the button labeled "Make rebinned data group". This will insert the rebinned data in the groups list where it can be manipulated like any other mu(E) data group.

Note that you can easily compare the reuslts of rebinning with different grid parameters by saving the rebinned data from different parameter sets.

Rebinning data as it is imported

It is also possible to rebin data on the fly as it is imported. To do this, click the "Show extra features" button on the column selection dialog. This will display the notecards for such things as specifying the pre−processing parameters and the reference channel. See the data import document page.

One of the tabs is for specifying the rebinning parameters. This tab asks for the five parameters described above as well as the element symbol of the absorbing atom. You must specify the absorbing atom because, at this point, the value for the edge energy has not yet been found by Athena. Additionally, you must check the button labeled "Do rebinning" for the rebinning to be performed. The data will then be rebinned as it is imported. This rebinning can be done in parallel with preprocessing, settin the reference channel.

Other information

The default values for the rebinning parameters can be set in the preferences dialog.

This algorithm is, admitedly, a bit limiting in that it only allows for a three−region sparse grid. If your data requires a different grid, the only solution is to process your data as needed before importing it into Athena.

NAME

ATHENA − Interactive EXAFS data smoothing

Smoothing is a way of attmpting to remove noise from data. It’s probably a bad idea in most cases because most smoothing algorithms tend to affect the Fourier components of data in unpredictable ways. However, smoothing algorithms are really easy to write and so there was no good reason not to include the option for the small number of situations where smoothing might be appropriate.

You have two choices for how to smooth your data. You can either repeatedly apply Ifeffit’s smooth function, which does a simple three−point smoothing. You may choose how many times to apply the smooth function. You other choice is a Fourier filter smoothing, which works by interpolating the data onto a uniform energy grid, doubling the data by appending the reverse of the data to the end of the data, Fourier filtering over the entire data range, then interpolating the result back onto the original data grid.

For both options, you can play around with the parameters and compare the smoothed data to the original data. If you desire, you can then make a data group out of the smoothed data.

NAME

ATHENA Interactive EXAFS data convolution

Athena has a capability for convoluting and adding noise to spectra. To access this feature, select "Convolve mu(E)" from the Data menu.

The convolution function operates on the selected group (i.e. the one highlighted in pale red in the groups list). The functional form of the convolution can be chosen from a menu as either Lorentzian or Gaussian. The width of the convolution function is specified in eV units in the entry box below the menu. Random noise can be added to the spectrum by entering a positive number in the second entry box. This number is interpreted as a fraction of the edge step. That is, after the convolution and added noice, the data and convolved spectra will be plotted as normalized data. The RMS value of the added noise is thus relative to 1. If you specify noice of 0.01, then the noise added to the normalized spectrum will have an RMS value of 0.01 and the noise added to the mu(E) spectrum will be 0.01 times the edge step.

Note that for Lorentzian convolution, the width is the FWHM. For Gaussian convolution, the width is sigma which is smaller than the FWHM by about a factor of 2.4.

The convolved, noisy data can be saved to a data group and treated just like real data. That is, you can remove the background and do Fourier transforms. Thus the effects of convolution and noise can be propagated through to the chi(k), chi(R), and chi(q) spectra.

NAME

ATHENA − Self−absorption corrections

In a fluorescence experiment, the depth into the sample that the incident beam penetrates is modulated as the energy changes. The edge step and the fine structure oscillations modulate this depth, thus attenuating the amplitude of the measured chi(k). This effect is commonly called the "self absorption".

Athena encodes several different algorithms from the literature. This is in part so that the user can directly compare different approaches on the same data and in part because Athena’s author does not know which one is best. There are controls for choosing among the algorithms in the upper left corner of the page.

The controls for the self absorption correction are pretty simple. The correction is always done on the current group, i.e. the one highlighted in pale red in the Groups list. The absorbing atom and absorption edge of the current are displayed at the top of the page. Below that are controls for the incident and outgoing angles, both measured in degrees, and for the sample thickness, measured in microns. For algorithms that work only on thick samples, the thickness entry box is disabled. For algorithms that use the thickness parameter, it is important to set this correctly −− particularly for thinner samples −− or else the correction will be quite inaccurate.

The final control is for inserting the formula of the sample, which is required for computing the correction. The formulas can be written with quite a bit of flexibility. Parentheses 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.

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.

All algorithms make use of tabulated values of absorption coefficients of the elements. The Elam tables from the Xray::Absorption package are used.

The calculation is made by pressing the button labeled "Plot data and correction". Hitting carriage return when focus is on the formula or thickness entry boxes will also perform the calculation. If you wish top save the corrected data as a data group (thus making an entry in the Groups list), click the button labeled "Make corrected data group."

After the correction is computed, some information about the calculation is displayed in the feedback box below the plotting and saving buttons.

The Fluo algorithm

This algorithm is intended to correct XANES spectra in the limit of the thick sample. For a sample that is a few absorption lengths thick or less, this correction will greatly overestimate the correction. It should only be used for samples which are several absorption lengths or more thick.

This can be used as a correction to the EXAFS spectrum as well. As such, it is similar to the Booth algorithm (save for the lack of depth dependence), in that it includes an effect from the oscillatory function. This algorithm should yield very similar EXAFS results to Booth for thick samples at high k.

It is absolutely essential that the formula given to this algorithm include everything in the sample, including the absorbing material and whatever else makes up the sample. For instance, if your sample is solvated complex, the formula must include the proper stoichiometry for the solvent and solute combined. As another example, if your material is powder dispersed within a binder such as boron nitride or sucrose, the formula but include the proper stoichiometry for the sample and binder combined.

As an example, a 0.47 molar solution of ammonium sulphate in water has a formula of ((NH4)2SO4)0.47(H2O)54.8.

The Booth and Bridges algorithm

This algorithm is a correction to the measured EXAFS but not for the XANES portion of the spectrum. This approach works for a sample of any thickness or concentration. There may be significant error in this approach for samples with very large chi(k) oscillations or for glancing angle geometries, but in most situations these errors are quite small. See the reference below for more details.

The main result of Booth and Bridge’s paper is a correction to the measured chi(k) that is only valid for sufficiently thin samples. This approximation is central to the derivation of the equation (Eq. 4 in that paper) and results in a formula that is numerically unstable for thick samples. To address this problem, the authors also derived a formula for the thick sample limit. Athena performs a test on the numerical stability of the nearly exact formula and uses the thick sample formula if the nearly exact formula will be unstable.

The Troger et al algorithm

This algorithm is a correction to the measured EXAFS but not for the XANES portion of the spectrum. This is very similar to the thick sample limit of the Booth and Bridges algorithm, albeit without the oscillatory chi(k) dependence in the denominator of the correction function. In the limits of thick sample and high k, Troger and Booth should give the same spectra. At low k, they will be somewhat different. In the thin sample limit, the Troger algorithm is much less accurate than the Booth algorithm.

The published algorithm also includes a term for correcting the effect of an uncertain background subtraction. This has not been implemented in Athena.

The Atoms corrections

This algorithm is a correction to the EXAFS spectrum and follows the implementation in my own Atoms program. This uses tables of absorption coefficients to simulate the effects of self absorption, the I0 energy dependence, and the normalization correction on S0^2 and sigma^2. The correction is very simple −− it multiplies the measured chi(k) by the approximated amplitude correction from the self absorption calculation. It them sums the three approximations for the sigma^2 effects and multiplies the measured chi(k) by the exponent of this sum times k^2. Thus:

    chi_corr(k) = Amp_corr * exp( k^2 * sig_corr ) * chi_meas(k)

This is certainly the least accurate of the corrections offered by Athena, but since my Atoms program has included these corrections for years, it seems appropriate to include it here for comparison to the more accurate algorithms. It is only intended for thick samples.

For more details about these approximations, see the Atoms documentation.

The Information Depth

Troger et al. defined an interesting concept −− the information depth. This is the depth into the sample in which, for given incident and outgoing angles, 68% of the fluorescence photons are generated. Equivalently, this is the angle−dependent depth in which the incident beam attenuates e−fold. Thus for a given measurement geometry, this depth gives a metric to define sample thickness. When the information depth button is pressed, the computed depth is plotted as a function of wavenumber using tabulated values of absorption coefficients for the elements in the formula. See section V and figure 5 in the paper by Troger et al.

Data quality

The Fluo and Booth corrections both use the measured oscillatory spectrum as a part of the correction function. Thus both algorithms require reasonably good data as input. If data are dominated in any region by experimental error (e.g. if the background functions do something funny or if there are serious glitches), then the corrected result will be similarly effected. Another way of saying this is that Athena’s self−absorption corrections are intended only to correct the effect of self−absorption and not other problems that one often encounters in difficult fluorescence experiments. As always, care taken to obtain the best possible data will yield the best possible results.

To minimize this problem in the Fluo algorithm, the flattened spectrum is used whenever the flatten button is checked for a data group. This neglects the real effect of the attenuation of the background of the cross section at high energy, but that seems not to be a serious problem, given that this effect shows up in the tabulated cross sections used to compute other terms in the correction.

References
Fluo algorithm

The program documentation for Fluo can be found at Dani’s web site and includes the mathematical derivation:

   http://www.aps.anl.gov/xfd/people/haskel/fluo.html

The Booth algorithm

Published in Physica Scripta as part of the XAFS 12 proceedings. See also Corwin’s web site:

   http://lise.lbl.gov/RSXAP/

The Troger Algorithm

L. Troger et al. Phys. Rev. B46:6 (1992) pp. 3283−3289

The Pfalzer algorithm

Another interesting approach to correcting self−absorption is presented in P. Pfalzer et al, Phys. Rev. B60:13 (1999) pp. 9335−9339. 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

B. Ravel, J. Synchrotron Radiat. 8:2 (2001) pp. 314−316. See also the documentation for Atoms at Bruce’s website for more details about it’s fluorescence correction calculations.

Elam tables of absorption coefficients

W.T. Elam, B.Ravel, and J.R. Sieber, Radiat. Phys. Chem. v.63 (2002) pp. 121−128.

NAME

ATHENA Interactive EXAFS deadtime correction

Athena does not yet have this feature.

NAME

ATHENA Interactive EXAFS data alignment

Aligning data scans one to another

Athena allows you to align data groups interactively by visually comparing mu(E), normalized mu(E), or derivative mu(E) spectra. Selecting an alignment option from the Align menu displays a view for performing the alignment. You choose one data group as the fixed standard and select a second data group from the groups list to shift in energy. Press one of the alignment buttons to add or subtract 0.1, 0.5, 1 or 5 eV from the second data group.

The amount of the energy shift is displayed in view and updated in the selected group’s parameters.

The button labeled ‘Auto align’ will apply a crude algorithm in an attempt to align the spectra in an automated manner. The algorithm works by computing the difference spectrum of the derivative spectra of the standard and the second data groups. It optimizes an e0 shift by minimizing the difference spectrum. While this seems to work pretty well, I am sure data can be found for which it will fail badly.

A caveat: sometimes there is a lag between clicking an alignment button and the redisplay of the data. This lag is due to Ifeffit performing some non−instantaneous data processing function. Repeatedly clicking the alignment buttons in a pique of impatient frustration doesn’t actually improve the Athena’s performance!

You can also adjust the e0 shift without using the alignment view by editing its value in the main window. This is quick and easy, but does not provide the immediate visual feedback of the alignment dialog.

The alignment dialog is a bit slower if you choose to display normalized mu(E). This is because a normalization and background removal is done each time the data is energy shifted. Normally, you will want to use mu(E) or the derivative display since these will respond much faster to your key clicks. However, it is often worth being patient for the slower redisplay with the normalized mu(E) −− particularly if the raw mu(E) are on very different scales.

Aligning data to a reference scan

You can use a reference channel to align your data. Doing so requires that you import the data channel when you import the data. See the section on data import for instructions on using the column selection dialog to import the reference channel with your data. When you asign a reference channel to a data group, the E0 shift parameters of the data and its reference are strictly constrained. If you change the E0 shift of one, you also change the E0 shift of the other. Thus alignment using a reference scan uses the alignment dialog described above.

When, in the alignment dialog, you choose the reference channel as the second data group and align it to some standard, you then align the data to that same standard. This is true because the data and reference use the same energy array and they have their E0 shifts strictly constrained. In this was you can, for example, align and calibrate a metal oxide by aligning its metallic reference to a known standard.

Aligning many groups

The button labeled "Align marked groups" will run the auto−alignment algorithm on all marked groups in the groups list. This is a handy way of bulk processing a large amount of data. As stated above the auto−alignment algorithm is not fool−proof, thus it is prudent to verify the bulk auto−alignment by making a plot in energy of the aligned, marked groups.

The energy shift

The energy shift is applied to the energy array associated with the data group before any other processing chore proceeds. The energy shift can be entered by hand, but is much more commonly obtained using the alignment dialog. The value for E0 is the value after the energy shift is applied to the data.

NAME

ATHENA − Calibrating dispersive data

Dispersive XAS data is typically collected using a CCD camera, resulting a spectrum that is mu as a function of pixel position in the camera. Before these data can be analyzed, the pixel position must be mapped onto energy, thus converting mu(pixel) to mu(E). This chore is essentially impossible a priori. The resolution of the camera, i.e. the bandwidth of each pixel, is a complicated function of the geometry of the optics and of the expriment, including such factors as the distance of the camera from the sample and the distance of the sample from the polychromator. What’s more, it is unlikely that the each pixel subtends a constant bandwidth. Thus the mu(E) is splayed over the pixels of the camera in some nonlinear fashion. The only practical solution is, for a given experimental geometry, to measure a well−known standard before beginning the main experiment. This standard can be compared to a trusted spectrum to determine the mapping of mu(pixel) to mu(E). This mapping function can then be presumed constant for all data measured under that experimental geometry.

Athena assumes that the function mapping mu(pixel) to mu(E) is quadratic in pixel position. Thus

    E_i = C0 + C1*p_i + C2*p_i^2

Each energy value is thus a quadratic function of pixel position. To calibrate mu(pixel), we thus must determine the polynomial coefficients, "C0", "C1", and "C2".

Athena allows the user to adjust the values of the three parameters by hand, starting with sensible default values. Athena uses a somewhat complex refinement function to optimize the parameters once reasonably close values have been found. The refinement works by optimizing the difference between the trusted standard and the converted mu(E) of the dispersive data. However, the minimization function is not so simple as the difference between the two. From the begining of the dispersive data set to 20 eV above the edge of the standard, the minimization function is merely the difference of the two spectra. From 20 eV above the edge until the end of the dispersive spectrum, the difference of the two spectra is weighted by the square root of the energy above the edge. This is essentially the same as k−weighting the difference spetrum. Without energy−weighting the refinement is insufficiently sensitive to the quadratic term. By introducing this energy−weighting, the mapping of mu(pixel) onto mu(E) is usually much more precise.

WARNING!!!

This refinement is extremely fragile in the sense that a starting value for the linear term "C1" that is too far away from the best value will almost certainly result in the refinement finding a false minimum. It is recommended that you adjust the parameters by hand until finding values that are quite close in the sense of nearly matching the dispersive data to the trusted standard both near the edge and far into the EXAFS region. Once close, the refinement should be run to generate the most precise mapping.

Using the dispersive XAS interface

When the dispersive XAS calibration is selected from the Align menu, the main window is replaced by the pixel calibration dialog. At the top of the dialog is a menu containing all the mu(E) spectra from the Data groups list. You should select the one containing the data from the trusted standard. The current group, i.e. the group highlighted in pale red in the Data groups list, is the one that will be calibrated. Unless the current group is identified as mu(pixel) data, all the buttons in the dialog will be deactivated. When mu(pixel) data group is selected, all the buttons will activate and the standard will be plotted aloing with the dispersive data converted to energy using the current values of "C0", "C1", and "C2".

The default value for "C1" is set by the appropriate configuration variable. This number can be set in the prefernces dialog by selecting the pixel group and then setting the resolution parameter. The default for "C1" is 0.5 eV. The default for "C2" is 0. The default for "C0" is

   E0(standard data) − C1*E0(pixel data)

The E0 for the pixel data is determine by Athena in the same way that E0 is always determined, but, since it is pixel data, the E0 value will be a the pixel value of the first maximum of the first derivative. Note that the default for "C0" depends on the value of "C1". If you ever change "C1" by hand, you can recalculate the initial value for "C0" by clicking the button labele "Reset offset".

You can, at any time, replot the standard and the converted dispersive data by clicking the "Replot" button. You can refine the current values by clicking the "Refine alignment parameters" button.

Once you have found a set of parameters that properly map the pixel data onto energy, click the button labeled "Make data group." This will make a new entry in the Data groups list for the converted mu(E) data. This new data group can then be treated for analysis like any other mu(E) data.

Once the set of parameters has been found for the dispersive spectrum of the standard, you can convert any other data using the same parameters. Simply select another data set by clicking on its entry in the Groups list and confirm that the parameters are reasonable by examining the plot the is make when the group is selected. If so, click the "Make data group" button to convert and save the new mu(E) data. In this way, you can process a large quantity of data in reasonably short order.

Enabling pixel conversion

As delivered, Athena has the dispersive data conversion feature disabled. The reason for this is that, to properly handle pixel data, the data importer must run a check to see if the imported data file contains pixel data. It does this by checking that each of the first 100 points in the file is a sequentially numbered integer. This check adds a couple of seconds to the time required to import a data file. If one does not need to consider dispersive data, this check is just a waste of time.

To enable this feature, go to the prefernces dialog and open the pixel group. Select the "do_pixel_check" variable and set it to a true value by clicking on the little checkbutton.

Other things to try

Make pixel conversion a preprocessing option.

Is it possible to stabilize the refinement so that starting from farther away does not land in the wrong local minimum?

Consider some sort of mapping of the "C1" parameter to more broadly investigate the parameter surface of the conversion function.

NAME

ATHENA − Interactive EXAFS data merging

Once you are happy with the parameter values for your data, you may wish to merge several similar groups into a single statistically averaged group. This is done via the Merge menu. The most common ways to use the this feature are to merge chi(k) or norm(E), although data can be merged as mu(E), chi(R), or chi(q) as well.

Merging works by computing the mean and standard deviation of all marked groups in the space chosen. Care is taken to only include data in a data range common to all marked groups in the merged data. A new data group (one not associated with any file) is created and the average spectrum along with the average plus and minus the standard deviation. If the merge is in k−space, these three spectra will be plotted with the appropriate k−weighting.

When a merged data group is the current selection, there is an option in the Plot menu for replotting the figure with the average and standard deviation. For all non−merged data groups, this option is disabled.

When a merged data group is saved to a column data file in the space in which it was merged, the standard deviation array will be saved as an additional column in the data file.

If you want to merge very large amounts of data, say 100s of scans, you may find that you will exceed Ifeffit’s memory limitations. When this happens Athena may behave strangely or may simply crash. One way of avoiding this problem is to split you data ensemble into smaller groups of 40 or so scans each. Merge each smaller group of scans and then merge the merged scans. The other possibility is to recompile the Ifeffit library to use much more memory and so to allow for many more data sets.

There is a configuration option for specifying how to weight the data when performing the merge. The two options are to weight each data set eually or to weight by their high−R noise as computed by Ifeffit’s chi_noise() function. This choice can be toggled either in themerge menu or by explicitly setting this choice in the preferences dialog.

NAME

ATHENA Interactive EXAFS difference spectra

Athena can create and plot difference spectra between two data groups. These difference spectra can be computed between mu(E), normalized mu(E), chi(k), chi(R), or chi(q) spectra. Care is taken for the difference spectra in energy to interpolate the second spectrum onto the energy grid of the first. For R− and q−space difference spectra, the differences of the real and imaginary parts are computed then the magnitude and phase are computed from those.

When you select an item from the Diff menu, a view is displayed containing a menu for selecting the standard group. The second group is the one selected in the groups list. The difference spectra are computed by subtracting the second spectrum from the standard. The difference spectrum is plotted but is not saved as a data group until the button labeled Make difference group is pressed. Then the difference spectrum is placed in the list of data groups and can be operated upon like a normal data group. That is, a difference spectrum in energy can have a background removed (although Cromer−Liberman normalization is disabled for difference spectra), one in energy or in k can be Fourier transformed, and so on.

The spectrum chosen as the standard is different from the second spectrum in a few ways. The second spectrum is always subtracted from the standard. In energy, the second spectrum is interpolated onto the grid of the standard and that grid is used by the difference spectrum group. Also, the data parameters of the standard are given to the difference group.

If the "invert spectra" button is selected, the plot will be made as if the standard and the second spectra are transposed. If the "plot spectra" button is selected, any plot will contain the standard and the second spectrum along with the difference spectrum.

As with the Alignment view, you may experience delays when changing groups in the Difference spectra dialog. Again, clicking buttons in a pique of frustration will not actually help to speed up the process.

Integration

You can integrate the area under a portion of the difference spectrum. The boundaries of the integration are set by filling in the boxes labeled "Integration range" with values appropriate to the difference spectrum. Values in energy should be relative to E0. These values can be plucked from the plot using the little blue buttons.

The actual integration is the standard Romberg algorithm taken from Numerical Recipes and implemented in perl by the authors of Mastering Algorithms in Perl. It’s a bit slow, but is probably more precise than any XAS application needs. The result of the integration is displayed just below the integration range. If a data group is made after integrating, the result of the integration will be added to the title lines associated with the new group.

Batch processing

The button labeled "Make difference groups from all marked groups" allows you to batch process a series of difference spectra. All groups from the Groups list which are marked by clicking the little buttons next to the entries in the list will be processed into difference spectrum groups. Each newly made difference spectrum will be appended to the Groups list. Any marked group which is not of the correct type for making a difference spectrum will be ignored. (That is, a chi(k) data group cannot be made into a difference of mu(E) data.)

Next to the batch processing button is a check button for specifying that each difference spectrum should be integrated before making the difference group. For each one, the intgerated area will be written to the difference group’s title lines. If the integrations are spoecified for a batch job, an additional data group will be made at the end which contains the results of all the integrations. Thus if the data are entered into Athena in order of some extrinsic parameter, then the integrated area will be plotted as a function of that parameter at the end of the batch job. Because these areas are saved to a data group, the area data can be replotted or exported to a data file.

NAME

ATHENA − Interactive EXAFS linear combination analysis

Athena has a capability of fitting a linear combination of standard spectra to an unknown spectra. These fits can be done using normalized mu(E) spectra or chi(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 fitting 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 fit" from the Analysis menu. The normal parameter view will be replaced by a dialog for performing the linear combination fit.

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 fit a linear combination of them to the current (i.e. the one highlighted in pale red in the Data groups list) group. The fitting is done using the normalized mu(E) spectra. If the standards or the unknown are to be flattened, then the flattened spectrum will be used. (See the section on background removal for details about flattened spectra.)

You should have already done some data processing on the standards and on the unknowns. Specifically, you should align your data and set appropriate normalization parameters for each spectrum before starting to use the linear combination fitting dialog. Failing to adequately prepare your data for these fits may result in questionable fits.

To do the fit, weighting parameters are defined 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% of the unknown. Thus, if you used three standards, the first 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 fit the data. Each standard spectrum is interpolated onto the energy grid of the unknown when the fit is performed as normalized mu(E). The fit 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 fitting range by clicking on a plot of the data.

Fitting normalized mu(E), derivative mu(E), or chi(k) is chosen using the radio buttons just above the table of standards. When fitting chi(k) spectra, you have the option of fitting a single spectrum to the data.

When fitting normalized or derivative mu(E) spectra, you have the option of floating an e0 for each standard independently. This is intended to fix up any inconsistencies in the energy alignment of the various spectra. These e0 variables can be introduced by clicking on the checkbuttons in the table of standard spectra.

You can introduce a linear offset to the fit to normalized mu(E) spectra. This is simple a line added to the sum of spectra in the fit. It introduces two parameters to the fit −−− a slope and an intercept. The line is multiplied by a step function centered at the e0 of the unknown. Thus the linear offset is introduced only after the edge of the unknown. The purpose of this offset is to accommodate any variations in how the normalization is performed on the various spectra. To turn on the linear offset in the fit just click on the button labeled "Add a linear term after e0?"

Constraints and modifications to the fit

Athena’s linear combination dialog offers several constraints to the fitting 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 & 1." In this case, the weight used is computed from the variable using this formula

     guess  weight_varied = 0.5
     def    weight        = max(0, min(1, weight_varied))

The weight reported at the end of the fit, 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 fit is not appropriate to the data and is an indication that you should rethink the set of satndards used in the fit.

When this option is not selected, the guessed variable itself is used as the weight in the fit and is not prevented from being negative or larger than 1.

Force wieghts to sum to 1

You can loosen the constraint that the weights sum to 1 by deselecting the final checkbutton. This allows the final weight to float 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 fit 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 fit is computed by this formula:

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

This forces the final weight to be positive, but may result in a fit that does have weights that, in fact, sum to one. Should that happen, it should be interpretted to mean that the choice of standards was not appropriate to the unknown data.

Constrain all standards to use a single e0 shift

You can force all standards to use a single e0 parameter in the fit. This is equivalent (albeit with a sign change) to fixing 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 fit 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 fit. This is done using Ifeffit’s "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 find a suitable level of noise for your test. For normalized mu(E), sigma has a simple interpretation −− it is a fraction of the edge step. For derivative mu(E) and chi(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 fitting by using the "Plot data and sum" from the operations list.

Fitting, statistics, reports

To perform the fit, click "Fit" from the operations list. After the fit finishes, the data and the linear combination will be plotted along with vertical bars indicating the range over which the fit was evaluated. The values of all the fitting parameters are written to the "Fit results" tab. 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 fitting region. The chi−square and reduced chi−square are those reported by Ifeffit.

You can replot the data and the fit using the most recent values for the fitted parameters by clicking "Plot" in the operations list.

You can save the text from the fit results box to a file by clicking "Write a report" in the operations list. This writes a column data file with the fit results as the header information. The columns in the file are x−axis (either energy or k), the data, the best fit, the residual, and each of the weighted components.

You can make a data group out of the linear combination by clicking "Make fit group" in the operations list or out of the residual by clicking "Make difference group" in the operations list. This will allow you to plot and manipulate the fit/difference after leaving the linear combination dialog. The data group containing the fit result will be treated as normal data that can have a background removed or be Fourier transformed. When you save a fit using the derivative spectra, the fit group will be saved as a normal mu(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 fitting is configurable using the preferences dialog.

Constraining linear combination fit parameters between groups

The various operational parameters described above can be constarined between data groups in the same manner as background removal and Fourier transform parameters on Athena’s main page. Two items in the operations list are "Set params, all groups" and "Set params, marked groups". These will export the current group’s values for fitting 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 fitting feature described below.

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 fit in the manner described above using the current selection of fitting standards and other fitting options. When the sequence of fits is finished, the "Write marked report" option will become eneabled in the operation list. This will allow you to write a report in the form of a comma separated value file which summarizes the results of the sequence of fits. This report file can be read into any spreadsheet program.

Note that the report file will only reflect the fits done during the batch job. Any changes made to the fitting 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 different from running the same sequence of fits by hand is that the report file can be generated. There is currently no way to generate a similar report from a sequence of fits not run using the batch processing option. However, you always have the option of saving individual fit reports as described above.

Combinatorial fitting using many standards

One of the uses of this sort of XANES fitting is to try to figure out what’s actually in a sample. One approach to figuring this out is to measure all plausible standard compounds and try fitting a large number of different combinations of the standards to the data. Athena 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 fit with the incrementor widget just below the button marked "Use marked groups". By default this number is 4, which says that the fits will consider all possible binary, trinary, and quaternary combinations of standards. Increase this number to consider higher orders of combinations of standards. Decrease it to limit the number of fits 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 coffee. If the number of possible standards is large, this series of fits could take a while. For example, with 11 standards and considering up to the quaternary combinations, Athena will perform 550 fits. (Really! "11 choose 2" + "11 choose 3" + "11 choose 4" = 550).

Once this series of fits finishes, the tab labeled "Combinatorics" will become active and raise to the top. On it, you will see two tables. The top table concisely summarizes all the fits that were performed, in order of increasing R−factor. Initially, the first item in the list −− which has the lowest R−factor −− is selected (i.e. highlighted in pale red).

The second table contains each of the standards and its weight and e0 from the fit selected in the upper table.

You can select a fit from the upper table by clicking on its line. When you do so, that fit becomes highlighted in pale red, its fitting results are inserted in the bottom table, it’s best fit function is plotted along with the data, and its results are inserted into the other two tabs. In this way, you can examine any fit from the series.

Clicking the right mouse button on a fit in the upper table will post a context menu with options relevant to the selected fit. These options include saving the fit as a data group; writing a data file with columns for the data, fit, residual, and each weighted standard; saving the report from the "Fit results" tab to a file; and wrting 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 fits." Clicking this will prompt you for a file name and location, then write a comma−separated−value report of all fits.

NAME

ATHENA − Peak fitting analysis

Athena has a capability for fitting known lineshapes to XANES data. An arctangent function or an error function is used to model the step portion of the data and Gaussians or Lorentzians are used to model the features of the XANES spectra. To access this feature, choose "Peak fit" from the Analysis menu.

The normal parameter view is replaced with a dialog for performing the peak fitting. The data group selected from the groups list will be used. When the peak fit dialog is first displayed, a fit using only the step−like function and no peak functions is made. The step function is centered at the E0 value for the data group. To add peak functions, specify an energy value for the centroid (or use the pluck button to select a centroid from the plot of the data) and choose a lineshape from the menu of lineshapes. As soon as you select a lineshape, the fit will be redone automatically so you can see how your simulation of the XANES spectra evolves as you add new lineshapes.

You can fit up to 6 lineshapes along with the step−like function. This number is configurable within the preferences dialog. You can also choose to mark the centroids of all the lineshapes with the same sort of markers that are used to specify E0 and the pre−− and post−edge line ranges in mu(E) plots. The other optional features are to display the component peak functions or the difference spectrum along with the data and the fit. The plotting of conponents or difference or marking of centroids can be turned on by default in the preferences dialog.

The peak functions currently available are Gaussian and Lorentzian. These are unit normalized, so the fitted amplitudes are also the areas measured in eV. You can also choose step−like functions −− either arctangent or error function −− as additional lineshapes. The step−like functions are normalized and vertically shifted such that the scale from 0 to the value of the amplitude.

The fit is performed within the fitting range specified at the top of the screen. This fitting range is indicated by two vertical lines in any plot of the fit and the data. The plot is made over the energy range indicated in the plot options section of the Athena window.

For each line shape, you can choose to fit any of the centroid position, the amplitude, or the line width. By default, the amplitude and widths are fit and the centroid is fixed. Take care in allowing the centroids to vary as this can often lead to highly unstable fits.

Occassionally it is useful to reset the amplitudes and widths in the situation where a fit has found screwy values. Clicking the Reset amplitudes and widths button restores the default values. The default values can also be customized in the preferences dialog.

You can do peak fitting on another data group simply by selecting the new group from the data list. When you select the next group, the data will be plotted and the parameter values from the prior fit will be retained, but the fit will not be performed until the Fit lineshapes button is pressed. This behavior is intended to make it easy to use the same peak fitting model on a sequence of data sets and thus to measure the variation in some component throughout an ensemble of data.

After each fit, a complete summary of the fitting result is written into the space viewed by clicking on the tab labeled "Results". 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 fitting region. The chi−square and reduced chi−square are those reported by Ifeffit. This summary of the results can be saved to a log file by clicking the button labeled Write a log file.

The sum of the fitten lineshapes can be saved to a data group for later comparison to the data or for saving to a project or an external file. Clicking the button labeled Save best fit function as a data group will create a new group and new entry in the groups list. This new group is like a detector group (see the section on data groups) in that it can only be plotted in energy and no analysis chores such as background removal or Fourier transform can be performed on it.

Information about the peak fitting parameters is saved with the data group and will be restored the next time the peak fitting dialog is viewed. This information is also saved in a project file.

Future improvements to the peak fitting might include the ability to use Cromer−Liberman calculations as the background shape and pseudo−Voight or other shapes as the peak functions.

NAME

ATHENA − Log−ratio/phase−difference analysis

  −−− not yet written −−−
  −−− Explain the log−ratio dialog.... −−−

Note that kmin kmax kw dk rmin rmax dr parameters for standard and unknown will be reset to the values indicated, but not if either group is frozen.

NAME

ATHENA − Principle Components Analysis

  −− Athena does not yet have this feature −−

NAME

ATHENA − Setting preferences

Athena allows for extensive customization of many aspects of its behavior, including default values for analysis parameters, colors used in plots, colors used to decorate the program, and other things. All of these customization parameters can be found by selecting "Edit preferences" from the "Settings" menu.

The normal, parameter view will be replaced by a dialog for setting the parameters. This dialog consists of a tree of parameters displayed on the left, an area on the right for displaying and setting indicidual parameters on the left, and a number of buttons for using new parameetr values at the bottom.

The list of parameters is divided in several sections. To see a description of the broad purpose of the parameters in a section, select that section by clicking on it line in the tree. To view the parameters in a section, click on the little + button next to the section name. This will expand that branch of the tree. To view an individual parameter, click on its line.

When you select a parameter, it will be displayed on the right side of the preferecnes dialog. It’s name, parameter type, and the as−shipped default value are displayed along with a widget for setting the parameter tosome other value. The type of widget offered for resetting the parameter depends on the parameter type. It will be a text entry box, a menu, a button, or a checkbutton depending on the parameter type. Below the value widget is a text box which contains a description of the parameetr, its possible values, and the function it serves in Athena. If the parameter has units (e.g. if it takes a value in energy), the units will be explained at the end of the description. These descriptions are actually quite useful as documentation for Athena −− that is, many features of Athena are explained in these descriptions.

To change a parameter, use the value widget to choose its new value. If a value has been changed from its as−shipped default, you can restore the default by pressing the button labeled Athena’s default.

When you change a parameter value, the button labeled Apply changes for this session and Save changes for future sessions activate. Clicking the Apply button will cause Athena to use the modified parameter values as long as your current session continues. The Save button applies the modifications for the current session and writes an initialization file to disk for future sessions. If you ever get confused playing with the preferences and want to return to the as−shipped default values, click the button labeled Set ALL parameters to Athena’s defaults.

Many of the parameters in Athena determine what color some object presented on the screen uses. Clicking the value widget for a color parameter causes a color selection dialog to pop up. You can scroll through the various named colors or use the sliders to choose a custom color.

When you are done, click the Return to the main window button. Before actually returning, you will be prompted for applying or saving your parameters if you have not already done so.

The parameters in the "bkg", "fft", and "bft" sections are used to determine the default values for the parameters controlling background removal, forward Fourier transforming, and backward Fourier transforming. That is, they determine what values are assigned to a group when the data is first imported. Some parameters, such as the end value for normalization or the spline range, which nominally must be positive numbers, can take negative values as their defaults. For those parameters, a negative number is measured from the end of the data set rather than from E0.

Fonts cannot currently be configured interactively. The parameters in the "Colors" section can be changed interactively, but, with the exception of the "current" color, will only take effect the next time Athena is started.

The parameters used by Athena to recognize detector columns in raw data take values that are used as regular expressions by Athena. If you are not familiar with the syntax of Perl’s regular expressions, you probably should not later those parameters. However, if much of your data comes from a particular beamline, these regular expressions can be used to add significant intelligence to Athena’s column selection dialog. The "i" switch is always used with these regular expressions, thus the match to the expressions is always done case−insensitively.

The groups list and the plot buttons remain active when the preferences dialog is displayed. This is very handy when configuring certain parameters, such as those that determine how plots are drawn. It allows you to try out new parameter values in new plots without leaving the preferences dialog.

For those who are curious, the user interface for the preferences dialog was inspired by and operates similarly to the editor for the /etc/sysconfig/* files in SuSE Linux.

ATHENA: Filetype Plugins

ATHENA Filetype plugins and the plugin registry

Overview

Athena’s notion of what constitutes a data file is somewhat limited. It assumes that the header and the data are easily distinguished and the data is in the form of columns. It assumes one of the columns is energy and that the other columns are scalars that can somehow be formed in mu(E) data. This simple model works suprisingly well. When it doesn’t, we need something else.

Athena provides a system of filetype plugins for dealing with data that falls outside the model described above. These plugins are bits of perl code that get placed in a special location and that modify how Athena interprets data as it gets imported. Athena comes with several plugins, including
X10C

A plugin for data from NSLS beamline X10C, which is formatted in a way that Athena cannot normally interpret.

X15B

A plugin for data from NSLS beamline X15B, which is in a binary format.

BESSRC

A plugin for old-style data file from APS beamline 12BM, which has a header that confuses Athena.

Encoder

A plugin for data in which encoder values rather than energy values were recorded.

Lambda

A plugin for data recorded as a function of wavelength rather than energy.

Additional plugins can be placed in a special location where Athena will find them. On unix-like systems (including linux and Mac OSX ) this location is "$HOME/.horae/Ifeffit/Plugins/Filetype/Athena/". On Windows, this location is "C:Program Files\Ifeffit\horae\Ifeffit\Plugins\Filetype\Athena\". Just drop a properly formed plugin in place and Athena will find it.

Format of the filetype plugin

A filetype plugin follows a few simple rules:

1

The plugin must be in the "Ifeffit::Plugins::Filetype::Athena::XYZ" namespace, where "XYZ" is the name that you give to the plugin. This is declared in the first line of the plugin.

2

The variables $is_binary and $description must be set. If the original data file is ascii, the $is_binary flag should be set to 0. $description is used in Athena’s plugin registry display to provide a brief description of the plugin. I really mean "brief" -- the description should be about 40 characters or less.

3

The plugin must provide a method called "is" that takes one argument -- the fully resolved file name of the original data. "is" returns true if it recognizes the file and false if it does not. This method should be fast. It is possible that a large number of plugins are registered by a user. The user has to wait while all the plugins test the data file. If "is" is slow, data import is slow.

4

The plugin must provide a method called "fix" that takes four arguments. The first is the fully resolved path to the data file. The second is the location of the stash directory used by Athena. The data converted into an Athena−readable format must end up in the stash directory. The third argument is Athena’s main window object. This is needed for plugins that consist of GUI elements. The final argument is a reference to a hash which is used to provide persistence for the plugin parameters, should that be desired.

The "fix" method is the workhorse of each plugin. It somehow makes a copy of the original data file and places it in Athena’s stash directory without changing the original data file. The resulting copy, then, is in a form that Athena can happily import.

Example of a filetype plugin

Here is the Lambda plugin, in its entirety. The "is" method identifies this kind of data by checking to see if the first 10 points are small and monotonically descending. The "fix" method uses Ifefift to modify the wavelength array and write the modified data into Athena’s stash directory. It’s that simple.

  package Ifeffit::Plugins::Filetype::Athena::Lambda;
  use vars qw(@ISA @EXPORT @EXPORT_OK);
  use Exporter;
  use Ifeffit;
  use File::Basename;  # exports fileparse
  use File::Copy;      # exports copy
  @ISA = qw(Exporter AutoLoader);
  @EXPORT_OK = qw();
  use vars qw($is_binary $description);
  $is_binary = 0;
  $description = "Import data recorded by photon wavelength.";
  sub is {
    shift;
    my $data = shift;           # use Ifeffit to query first column
    Ifeffit::ifeffit("read_data(file=\"$data\", group=l___am)\n");
    my $suff = (split(" ", Ifeffit::get_string('$column_label')))[0];
    my @e = Ifeffit::get_array("l___am.$suff");
    my ($small, $descending) = (1,1);
    foreach my $i (0 .. 9) {    # check first 10 data points
      $small &&= ($e[$i] < 10);
      $descending &&= ($e[$i] > $e[$i+1]);
    };
    Ifeffit::ifeffit("erase \@group l___am\n");
    return ($small and $descending);
  };
  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 Encoder)\n";
    copy($data, $new);
    ## use Ifeffit to read in the encoder data, perform the
    ## conversion, and write the data back out
    my $prefactor = 2 * 3.14159265358979323844 * 1973.27053324;
    my $command = "read_data(file=\"$new\", group=l___am)\n";
    my @labels = split(" ", Ifeffit::get_string('$column_label'));
    $command .= "set l___am.energy = $prefactor/l___am.$labels[0]\n";
    $labels[0] = "energy";
    $command .= "write_data(file=\"$new\", l___am." . join(", l___am.", @labels) . ")\n";
    $command .= "erase \@group l___am\n";
    Ifeffit::ifeffit($command);
    return $new;
  }
  1;
  __END__

See the Encoder plugin for an example of using GUI elements and persistence. See the X10C plugin for an example of a plugin that does not use Ifeffit. See the X15b plugin for an example of importing data from a binary format.

The plugin registry

Because testing data files against plugins can be time consuming, plugins must be registered for use by the user. Un-registered plugins are not considered when importing data. If you know that your data can be read normally, it is best to un-register all plugins as that will speed up data import.

The plugin registry is found in the Help menu. It is very simple to use. You will be presented with a list of all possible plugins. Simply select the check button on the left for any plugin you need to use. Or unselect the check button for a plugin you wish to disable.

By default, the standard plugins are not registered for use but any plugins found in "$HOME/.horae/Ifeffit/Plugins/Filetype/Athena/" (unix) of "C:Program Files\Ifeffit\horae\Ifeffit\Plugins\Filetype\Athena\" (windows) will be.

You can read the documentation for the selected plugin (assuming the plugin author wrote it!) by hitting return.

Note that the order in which the plugins appear on the registry page is the order in which their "is" methods are applied to imported data. When an "is" matches, the remaining plugins are ignored. The user’s plugins come before the standard plugins in the list and are in alphabetical order. The order of the standard plugins was decided (in a rather ad hoc manner) by Bruce. The best way to over-ride a standard plugin is to give it a new name, put it in your user space, and make whatever modification you would like.

Other uses of plugins

It may be useful to write plugins for data files that Athena actually can interpret normally. Some examples might include performance of deadtime corrections, rebinning quick scan data prior to import, or summing multi-element data prior to import. Any chore for which you would like to use pure perl or an interface to something other than Ifeffit would be well done by a plugin. Rebinning is a fine example. The large data arrays of the un-rebinned data might consume a lot of Ifeffit’s memory. For the sake of having room for more data groups in the group’s list, one might choose to rebin via a plugin.

A note about the namespace

I acknowledge that the namespace is absurdly long. There’s a reason. I want the namespace and directory layout of plugin architecture not to have to change in the future should I implement other plugin types. My choice of namespace allows me to easily add other kinds of plugins ad well as plugins for Artemis or any program I might write in the future.

ATHENA: Standard key bindings

ATHENA Interactive EXAFS data alignment

The following are the keyboard shortcuts which are hard-wired into Athena. The shortcuts shown with capital letters require that the control and shift keys be pressed simultaneously or that the caps lock key is pressed. The two shortcuts that involve the semicolon (;) prompt for an additional keystroke to specify the plotting space.

Keyboard shortcuts related to the basic operation of Athena

  Control−q        quit Athena
  Control−w        close project
  Control−m        show document
  Control−h        show hint
  Control−/        swap panels
  Control−1        show Ifeffit buffer
  Control−2        show titles buffer
  Control−3        show data file buffer
  Control−4        show echo buffer
  Control−5        show macro utility
  Control−6        show journal

Keyboard shortcuts related to file input/output

  Control−o        open single file
  Alt−o            open many files
  Control−s        save project

Keyboard shortcuts related to viewing data groups

  Control−y        copy group
  Control−b        about current group
  Control−B        about marked groups
  Control−l        change group label
  Control−j        make next group current
  Control−k        make previous group current
  Alt−k            move group up in list
  Alt−j            move group down in list

Keyboard shortcuts related to plotting

  Control−.        show point in plot
  Control−−        unzoom plot
  Control−=        zoom plot
  Control−;        plot current group
  Alt−;            plot marked groups
  Control−p        print last plot

Keyboard shortcuts related to marking groups

  Control−t        toggle current group's mark
  Control−a        mark all groups
  Control−u        unmark all groups
  Control−i        toggle all group markings
  Control−r        mark groups matching a regular expression

Keyboard shortcuts related to freezing groups

  Control−f        freeze this group
  Control−F        freeze all groups
  Control−U        unfreeze all groups
  Control−M        freeze marked groups
  Control−R        freeze groups matching a regular expression

NAME

ATHENA − Binding key sequences to functions

Graphical programs are wonderful because they allow the user to control their operations by clicking the mouse on buttons and menus instead of having to remember complicated commands and keystrokes. However graphical programs can be cumbersome to use for common and repeated operations because they require use of the mouse rather than convenient commands and keystrokes. Athena aspires to be useful both to the novice and the expert user and to be as adept at processing large quantities of data as it is at processing a single data set. To this end, Athena allows the user to bind almost every function available in the program to special key sequences which begin with either control−comma or alt−comma.

The key binding interface is found by selecting "Edit key bindings" from the Settings menu. The normal view is then replaced by the key bindings dialog. The large text box at the top of the screen contains a tree of nearly all the functions available in Athena roughly organized as they appear in the menus at the top of the Athena window. To see a group of functions, just click on the little boxed plus to open that branch of the tree. For features of Athena which open up their own dialogs as views replacing the normal view, the functions associated with those features appear in sub−branches of the tree.

To bind a function, select it by clicking on its entry in the tree. Select either "Ctrl−," or "Alt−," from the menu, then enter a letter, number, or other symbol in the box labeled "Key:". Clicking the button labeled "Bind it!" then associates the selected function with the bound key.

To activate the key binding, simply type Control−comma (or Alt−comma) and then the key. That is, type the comma key while holding down the control (alt) key. You will be prompted for the bound key in the echo area. Typing the bound key will then execute the associated function.

Performing a function via the Control−comma (Alt−comma) key sequence is the same in every way as performing it by clicking a button with the mouse or selecting it from a menu with the mouse. The only difference is that the mouse need not be involved.

As soon as you bind a key, it will be available for use in the current session of Athena. If you wish your key bindings to be available to you in future sessions of Athena, click the button labeled "Save key bindings for future sessions." This will save the key bindings to your preferences file.

You can unset individual all bound keys by clicking the buttons labeled "Clear all key bindings" and you can unset a particular key by entering that letter in to the key entry box and clicking The "Unbind" button. This unsets them only in the current sessions. If these key bindings have previously been saved to your preferences file, you must click the "Save key bindings" button to unset them for future sessions as well.

Some functions can only be performed when Athena is in a particular state. For example, you can only deglitch data when the deglitching dialog is showing. Should you attempt to perform a function when Athena is in a state that does not allow it, an error message will be written to the echo area.

The key binding mechanism is case sensitive. That is "C−, a" is different from "C−, A". However, the mechanism that captures the key stroke after Control−comma will capture the shift key and not wait for the following key sequence. Thus key bindings that involve capital letters require the use of the caps lock key. Because of this, any characters which are found using the shift key (such as most punctuation on United States keyboards or numbers on French keyboards) cannot be used as key sequences.

The hash character (#) can be set as a key binding on keyboard layouts on which is accessed without the shift key, but it cannot be saved to or recovered from the configuration file. The same is true of space, tab, and the equals sign.

Non−printing characters such as return or the function keys cannot be bound in this way.

ATHENA: Understanding Fourier transforms

ATHENA − Understanding Fourier transforms

The Fourier transform is one of the central concepts in EXAFS analysis. This short document will provide an overview of the FT , but is by no means a complete reference. There are many topics not covered either by this document page nor by Athena’s FT tool. The FT is discussed in all its details in many mathemetaics and mathematical physics textbooks. Wikipedia (http://www.wikipedia.com) has a fine set of pages on the FT .

The purpose of the Fourier transform is to deconstruct a signal into its frequency components. The transform can also be reversed to reconstruct part or all of a signal from its frequency components. In the context of the EXAFS measurement, the signal is the oscillatory chi(k) function and its components are the signals from each of the back scattering atoms. We understand chi(k) as a sum of the contributions from all the scattering atoms in the vicinity of the absorber, thus the FT is the tool we use to (partially) deconstruct chi(k) into the contributions from the scatterers.

This deconstruction of chi(k) leads to the common termonology of "scattering shells". Imagine that scatterers exist at two well defined distances. Application of the FT will separate the two portions of the signal into components that can be examine individually. When the chi(k) spectrum is transformed, we have a signal called chi(R) which is related to a radial distribution function and which will have two peaks corresponding to the two kinds of scatterers in our imagined example.

The purpose of the FT tool in Athena is to illustrate some of the basic concepts of the FT in a way that can be related (with only a small bit of imagination) to actual data. This tool allows you to define up to three sine waves. These sine waves are suggestive of the contributions from the scatterers in EXAFS . The EXAFS equation shows us that each scatterer contributes to chi(k) like a phase−shifted, damped sine wave. To keep this pedagogical tool a bit simpler, we ignore the phase shift and damping terms and simply examine the effect of the FT on pure sine waves. This tool also allows you to define FT parameters in a way that is analogous to the parameters on Athena’s front page.

When this tool starts, it displays two sine waves along with their sum. Note that the signals from these two sine waves becomes completely entangled in the sum. Hitting the "Plot in R" button shows the result of the FT of the sum of sine waves. An amazing thing happens -- the two signals which are entangled in k become reasonably well-separated in R. Indeed, they are completely distinct peaks. This is the sense in which the FT allows us to deconstruct the signal in k.

Fourier transforms in EXAFS are typically perfomed using a windowing function. This function is equal to 1 within the window and 0 outside the window. The "window sills" go from 0 to 1 in some smooth fashion. In practice the windowing function is used to distinguish the signal-rich portion of the measured chi(k) spectrum from the noisy part.

We can also window the chi(R) spectrum and perform the backwards transfrom. This allows us to reconstruct the original signal, but only using that part of the chi(R) spectrum under the window. Clicking the "Plot BFT " button will show the result of the backwards transform along with the original, windowed chi(k) data. Note that the backtransformed signal looks very much like one of the original sine waves.

Finally, the last two buttons display simulated data -- a broadened edge step plus a pure sine wave, and the Fourier transform of that simulated data. The point here is to show what the Fourier transform of an edge step looks like and how it swamps the signal of interest. This should help clarify how the Autobk algorithm works.

You should play around with the various parameters. Doing so will provide a lot of insight into how FTs work and how they interact with EXAFS data. Here is a list of "experiments" to try:

1.

Add a third sine wave and examine the signal in k, R, and backtransformed k.

2.

Examine the effect of changing the k−range (i.e. the values of kmin and kmax) on the FT . What happens to the separation of the peaks as the k−range gets quite small?

3.

Examine the effect of making the dk parameter smaller and larger. What happens at dk=0? The effect in R is called truncation ripple and is discussed in all textbook explanations of FTs. Do you see how reducing truncation ripple requires discarding data via the windowing function? Do you see how truncation ripple could be mistaken for a peak in your EXAFS data?

4.

At some value of k−range, how close together can you make the frequencies of the sine waves and still distinguish their peaks in R? What does this tell you about the spatial resolution of an EXAFS experiment?

5.

Change the k extent to a large number -- say 200. Set kmax to something like 190 and look at the FT . See how sharp the peaks have become? Again, what does this tell you about the spatial resolution?

6.

Change the R range to cover more than 1 of the peaks and examine the effect on the backtransform.

7.

Using just one sine wave and putting the R range around the peak in R, examine the back transform. Play around with the various FT parameters and examine the differences in the original and backtransformed waves. What impact might these parameters have on a signle shell analysis of real EXAFS data?

NAME

ATHENA’s help menu

You can access this document via the Help menu. Perhaps you already knew that and are reading this from within Athena! Several of the things in this menu write one−line informational messages to the echo area. The About Athena and About Ifeffit options do that and are the easiest way to figure out what version of Athena and Ifeffit you are running.

Hints

Hints are randomly selected one−liners explaining some feature of Athena that you may not already know about. The hints get displayed one at a time in the echo area. A hint is always displayed soon after starting Athena.

Demo projects

Demos are normal project files that have been specially prepared to demonstrate some feature of Athena. You should be able to tell from the file name which feature the demo is intended to demonstrate. The demo projects have data and parameters already set to values chosen for their practical or pedagogical purpose. The project journal, which contains an explanation of the feature demonstrated by the demo and a number of suggestions of things to try to enhance your understanding, will be displayed as soon as you open the demo project. The demos are probably the best way to learn about the many features of Athena.

Checking memory usage

Athena has a very crude of checking to see if you are getting close to using up the limitted amount of memory that Ifeffit can access. This crude check is made every time a data file is imported and a warning is issued if you are getting close to running out of memory. If you have already imported lots of files and you are worried that you might run up against this limit, you can have Athena issue a report on Ifeffit’s memory usage by selecting the last item in the Help menu. This reports how much memory is available and how much has been used. It also predicts how many more groups can be imported. Be warned, however, that is prediction is often quite wrong and should be treated with a grain of salt.

Unless your data was measured on a very fine grid or over a very long energy range, you can probably import at least 3 or 4 dozen data files before running into the memory limit and possibly many more. If you really need to process many dozens or hundreds of files, you can segregate them into groups of 40 or 50. You might also consider writing batch scripts rather than processing all those data interactively.

The reason that a memory limit exsts is that the Ifeffit library is written in Fortran 77, which does not have dynamic memory allocation. Matt understands that the lack of dynamic memory allocation is both quaint and silly in the 21st century. Someday he may get around to writing Ifeffit 2.0 in a language that supports memory allocation.

NAME

ATHENA − other features

Here are a bunch of other features in Athena that don’t fit in other sections.

Counting spline knots

The Autobk algorithm always uses as many spline knots as possible. It determines this number by the formula

    Nknots = 2 * delta_k * Rbkg / pi

That is, it uses all the information contained in the band determined by the extent of the Fourier transform and the width of the background region in Fourier space −− 0 to "Rbkg". You can see how many spline knots this is by selecting the last item in the Data menu. The number of knots is written to the echo area.

Phase corrected Fourier transforms

Athena provides an option for correcting Fourier transforms by the phase of the central atom. The central atoms phase shifts are provided by Ifeffit in the form of tables computed using Feff8. The Feff8 calculations are slightly non−physical, but yield reasonable results. See the relevant URL in the REFERENCES section of the main document for details of these calculations.

Doing phase corrected transforms tends to shift the peaks in the chi(R) spectrum to higher values. The first shell peak of such a transform tends to be somewhat closer to the expected centroid of the first coordination shell. For high−Z absorbers, removing the central atom phase shift may diminish or eliminate a split peak in the first shell due to the k−dependence of the central atom phase shift.

Are phase corrected transforms really useful? That is a matter of opinion. Athena’s author does not put too much stock in them. A couple of his colleagues, both expert practitioners of EXAFS analysis, find that phase corrections make interpretation of EXAFS spectra more confusing. At least one of his other colleagues, a world renown theorist, is of the exact opposite opinion. Go figure.

Athena is pretty good at guessing the species of the absorber and the edge of the data, but its algorithm is by no means fool−proof. When data is first imported, Athena guesses the absorber species by comparing E0 to a table of atomic edge energies. Athena does not always get this right, however, in which case you will need to select the absorber species using the Z menu near the top of the screen.

To see the effect of phase correction, import some data and make a copy of the data using the copy group function in the Group menu. For one copy of the data leave phase corrections turned off, for the other turn phase correction on. Mark both groups and plot them both in R space with the purple R button.

Only central atom phase corrections are available in Athena. Doing a phase correction which includes the effect of a scattering atom requires the use of a Feff calculation (or, I suppose, careful precessing of an empirical standard, something that is not done by Athena). The fitting program Artemis allows phase correction using a Feff calculation.

Keyboard shortcuts

Many of the most commonly used functions in Athena can be accessed by keyboard shortcuts. These functions have their associated shortcuts indicated in the menubar menus.

Some very useful shortcuts are not listed in the menus. These are:

     Control−k         select the group above
     Control−j         select the group below
     Control−t         toggle marking of the current group
     Control−; e       plot the current group in energy
     Control−; k       plot the current group in k−space
     Control−; r       plot the current group in R−space
     Control−; q       plot the current group in q−space

     Meta−; e          plot the marked groups in energy
     Meta−; k          plot the marked groups in k−space
     Meta−; r          plot the marked groups in R−space
     Meta−; q          plot the marked groups in q−space

"Control−k" and "Control−j" are the equivalent of clicking on the group in the group list above or below the current group.

The "Control−;" and "Meta−;" key sequences are equivalent to clicking on the red or the purple plot buttons. Note that the phrase "Control−; e" means to press "Control−semicolon" then press the "e" key.

In a future version of Athena, there will be a set of key sequences that the user will be able to bind to any operation normally accessed in any of the menus. This will be helpful to those who like to keep their fingers as close to the keyboard as possible!

REFERENCES

Here are the relevant URLs:
IFEFFIT

http://cars.uchicago.edu/ifeffit

PGPLOT

http://www.astro.caltech.edu/~tjp/pgplot/

Perl

http://www.perl.com

perl/Tk

http://www.lehigh.edu/~sol0/ptk/

Central atom phase shifts

http://leonardo.phys.washington.edu/~ravel/software/feff_tables/

MISSING FEATURES

You betcha! Lots! Here’s a partial list:

Principle Component Analysis on the set of marked groups

Data pages -- a way of organizing data in a project by having more than one groups list in a project

Change record types

item *

SPEC filetype plugin. This will need an independent perl module would be ideal.

item *

R and q space records, that is to be able to read and write data in R and q space just as easily as E or k space.

Internationalization. That is, build a framework for having text strings read from external files and for the language to be a configuration option.

Documentation, documentation, documentation

Improved data import from the web (mini browser?)

Generic data viewer and arbitrary cominations of data columns beyond what’s available in the column selection dialog.

Dead-time corrections (perhaps this is better done at the beamline...)

Documentation, documentation, documentation

WHAT’S IN A NAME?

Athena was the goddess of wisdom and is also associated with skill and justice. Those are all good qualities for a data analysis program!

AUTHOR

  Bruce Ravel <bravel AT anl DOT gov> (c) 2001 − 2006
  http://cars9.uchicago.edu/~ravel/software/exafs/

  Ifeffit is copyright (c) 1992 − 2006 Matt Newville
  newville AT cars DOT uchicago DOT edu
  http://cars9.uchicago.edu/~newville/ifeffit/
pdf