Using IFEFFIT in GUI applications
The programs ATHENA, ARTEMIS, and (to a lesser extent) HEPHAESTUS rely upon Matt Newville's IFEFFIT for much of their functionality. The purpose of this web page is to explain the relationship between IFEFFIT and the programs that use it.
IFEFFIT is a library that provides numerical functionality and an interface to a plotting utility. It is written with particular attention to the numerical needs of EXAFS analysis. For example, IFEFFIT provides special functions for fitting splines to data, doing Fourier transforms, and fitting EXAFS data using theory from FEFF as the fitting standards. IFEFFIT also provides special functionality that is more broadly useful, such as an infix math language, file input/output, array manipulation, and minimization of arbitrary functions.
ATHENA and ARTEMIS rely upon IFEFFIT for almost everything numerical. If you find that these programs do a good job of removing background splines from mu(E) data or fitting FEFF theory to your data, it is because of the exceptional library written by Matt. The math language capabilities of the IFEFFIT library deserve particular attention. The powerful modeling capabilities available in ARTEMIS for describing your data are handled entirely by the IFEFFIT library.
ATHENA and ARTEMIS were written to provide a friendly and functional interface to the powerful capabilities of the IFEFFIT library. In it's native form, IFEFFIT accepts textual commands as it's input. That is, the user provides typewritten instructions for how to read in data files, manipulate the data, perform data analysis, and plot the results. While all the capabilities of IFEFFIT are available via this command line interface, it is useful to provide some kind of graphical structure for interacting with IFEFFIT.
This, then, is the purpose of ATHENA and ARTEMIS. They provide a graphical way of organizing large quantities of data and of generating sequences of IFEFFIT commands which may be quite long and complicated. In essence, ATHENA and ARTEMIS are highly specialized bookkeeping programs which rely almost entirely upon IFEFFIT to do real work.
As good as GUIs might be, they are always limited to doing only the things for which there are buttons or menu items. If you need to do something beyond the scope of the GUI, usually you are sunk. Fortunately, that is not quite the case with ATHENA and ARTEMIS. Each program provides a way of interacting directly with IFEFFIT via a command line implemented as a text entry box. Any arbitrary IFEFFIT command can then be interspersed with the commands generated by the GUI.
You, the user, may also find it useful to interact with IFEFFIT without using ATHENA and ARTEMIS. This can be done in a variety of ways:
- You can run the IFEFFIT program (for you Windows users, that is what the icon that says "Ifeffit Shell" does) and interact directly by typing in commands.
- You can write IFEFFIT scripts using a text editor. These are extended sequences of IFEFFIT commands which can be read using the "load" command.
- You can use the perl, python, or tcl wrappers thoughtfully provided by Matt with the IFEFFIT distribution to write you own high level programs which combine the best features of those excellent languages with the EXAFS and numerical functionality of IFEFFIT.
In a recent paper, Appl. Phys. Lett. 81:15 p. 2812, all of the analysis I show was performed using IFEFFIT without using ATHENA or ARTEMIS in any capacity. I wrote a variety of scripts which made extensive use of IFEFFIT's splendid minimize command. The Lorentzian fit in Figure 2 and the fit to the energy dependent diffraction data in Figure 4a both involved IFEFFIT's minimize command.
Matt provides extensive documentation on how to use IFEFFIT directly. Check out Matt's documentation page. The Reference Manual, in particular, is my constant companion when I am coding up new stuff for my codes.


![[Created by XEmacs!]](http://cars9.uchicago.edu/~ravel/images/z_logo_xemacs.jpg)
![[Created with the Template Toolkit!]](http://cars9.uchicago.edu/~ravel/images/TT.gif)




