Go to the first, previous, next, last section, table of contents.


Using FUSE

Key Sequences, Menus, and Toolbars

As with most packages in Emacs, there are a number of different ways of accessing all of the functions in @fuse{}. The most primitive manner of accessing functions is to type M-x followed by the name of the function. Additionally, most user functions are bound to key sequences. Most of these involve typing C-c followed by another control character and then followed by a single character. These are lengthy key sequences. Major modes typically use C-c sequences. To have enough options available, I felt it necessary to have all of the @fuse{} functions use a second control prefix.

C- means to strike the control key while striking the following character. M- means to strike the esc key before striking the following key. Alternatively, you can hold down the alt or meta key while striking the following key.

The list of key sequences is rather lengthy and has been excluded from this document. The tutorial, see section `Introduction' in The Fuse Tutorial, demonstrates the use of many functions. All of the key sequences recognized by @fuse{} are listed in the quick reference card.

Virtually all of the functions in @fuse{} are bound to either the Input menu or to one of the program menus. Whenever you edit and input file with @fuse{} there will be a pull down menu labels Input and one labelled with the name of the program corresponding to that input file.

@fuse{} makes use of the ability of XEmacs to display a toolbar. By default, a toolbar appears at the left side of the screen when a buffer in input-mode is displayed. The toolbar has a several of the most commonly used functions bound to it, including functions for making templates, running programs, plotting output, and examining log files.

Program Execution

As discussed in the introduction, one of the fundamental purposed of a user interface to a set of programs is providing an environment in which to run the programs. @fuse{} allows you to run any of the programs with a key or mouse sequence. When a program is run, a second window is opened to display all of the run-time messages written to standard output and standard error by the program. This allows you to follow the progress of the program and to see when the program has finished.

The programs are always invoked using the shell's `time' command. Upon completion of the program, this causes a summary of the time consumed by the program to be written to the run-time display window. Generally this summary is rather cryptic but usually includes the real time elapsed and the amount of CPU time used. It would be nice to parse this string into a more readable form, but unfortunately its format is different under different shells and operating systems. Even so, it is sufficiently useful to know this information that I offer the unparsed string despite its crypticness.

The advantages of having the run-time messages written to a buffer in the manner described above is that it records a running log of work done during the @fuse{} session. This log can be saved to a file using `input-save-run-log' (normally bound to C-c C-b l and found in the `Input:miscellaneous' menu). This runtime log is also written whenever Emacs is exited so that your last session can be reviewed.

If you are working in a windowing environment, the run-time messages buffer will be displayed in a separate frame from the frame containing the input files. This frame is only about 20 lines tall and lacks much of the normal decoration of an emacs frame. The idea is that it is a display-only frame which takes up only a small amount of screen real estate. This frame may be shared with the gnuplot script buffer, but typically is not. This is controlled with the variable `input-use-frames-flag'.

Basic run command

Several functions and features are used by @fuse{} to control program execution.

Batch processing

@fuse{} is able to batch process input files by sequentially running the appropriate program on any number of input files. This is accomplished using a dired buffer. See the Emacs documentation for details about dired.

To enable @fuse{}'s batch processing capabilities, you must have this lines somewhere in your `.emacs' file

     (add-hook 'dired-load-hook '(lambda () (load "fuse-dired")))

Once that is done, any time you are in a dired buffer you will be able to run any of the programs covered by @fuse{}. First mark some number of input files using the `m' command (or any other marking command) in dired. Then invoke `fuse-dired-run-marked' by typing C-c r. @fuse{} will then load each marked file and run the program appropriate to that file. Just sit back and watch.

Note that the batch run may require some interactive response in certain situations. For example, if @fuse{} cannot figure out the program associated with the input file (see section Automatic configuration), @fuse{} will query you for it.

Plotting

Using FUSE's Plotting Utilities

@fuse{} plots the output of FEFF and the UWXAFS programs by parsing for the input file for information about the data that needs to be plotted and constructing a GNUPLOT script based on what it finds. It then pipes the contents of this script to GNUPLOT. The scripts can be saved by moving the cursor to the script buffer and typing C-x C-s.

When one of the plotting options is chosen, a second window or a separate frame opens up showing the contents of the GNUPLOT script. Assuming there are no problems, the plot will be displayed and control of the cursor will return to the window containing the input file.

If you are working in a windowing environment, the run-time messages buffer will be displayed in a separate frame from the frame containing the input files. This frame is only about 20 lines tall and lacks much of the normal decoration of an emacs frame. I assume that you only rarely will edit the gnuplot script, so displaying it in a separate and rather small frame seems preferable. This frame may shared with the run-time messages buffer, but typically is not. This behavior is controlled by the variable `input-use-frames-flag'.

Plotting in ATOMS mode
There is nothing to plot in ATOMS, so there are no plotting functions. An interface to a ball-and-stick plotter such as RASMOL or XMOL would sure be nice.
Plotting in FEFF mode
In FEFF minor mode there are two plotting options. One is to plot chi(k) from `chi.dat' and the other is to plot mu and mu0 from `xmu.dat'. The scripts GNUFIX and KW are used. Both of these files are written by the fourth module of FEFF. `xmu.dat' is only written if the XANES calculation is enabled by having the `xanes' keyword in in the input file.
Plotting in AUTOBK mode
In AUTOBK minor mode there are four plotting options, (1) plot chi(k) as specified in the stanza currently occupied by the cursor, (2) plot the data and AUTOBK's estimation of mu0 from the current stanza along, (3) plot chi(k) together with the fitting standard from the current stanza, (4) over-plot all chi(k) functions from all stanzas in the input file. The KW script is used to apply k-weight to the chi(k).
Plotting in FEFFIT mode
In FEFFIT minor mode there are options to plot fit results in any of k, R, and back-transformed k spaces. The data and the full fit in the chosen space are always plotted. Plotting in any of the spaces requires that the appropriate control keyword (`kspout', `rspout', or `qspout') be set to true. By default only the data at full fit are shown. If FEFFIT's background fitting option is selected by setting `bkgout' to true, then the background function will be added to the plot. The individual paths can also be plotted by marking path paragraphs that you want to plot. This is done with the C-c C-p m command. When a path is marked, the `path' keyword will be highlighted and when any of the three plotting functions is called, the marked paths will be added to the GNUPLOT script. Hitting C-c C-p m again clears the mark. S-mouse-2 marks and unmarks the paragraph under the mouse cursor. C-c C-p a marks all paths in the current data set and C-c C-p c clears all marks.
Using GNUPLOT mode
The GNUPLOT script is written in two parts to a buffer which is, by default, called `input-mode.gp'. The first part initially has no GNUPLOT commands in it and is never deleted in subsequent plots. The second part contains all of the commands for the requested plot. The second part of the script is deleted for each subsequent plot. These two parts are separated by a line beginning with these characters: `#-#-#-'. Any GNUPLOT commands that you wish to issue with each plot can be typed into the first part of the script. The automatically generated scripts are always plotted when one of the plotting options is chosen by key or mouse sequence. You can interact with GNUPLOT directly by moving the cursor to the buffer containing the script. You can then edit the script as you wish and re-send it to GNUPLOT. There are three key sequences for communicating commands to GNUPLOT. `send-buffer-to-gnuplot', bound to C-c C-b and in the `gnuplot' menu, sends all commands in the buffer to GNUPLOT. `send-region-to-gnuplot', bound to C-c C-r and in the `gnuplot' menu, sends all commands in a selected region to GNUPLOT. Finally, `send-line-to-gnuplot', bound to C-c C-l and in the `gnuplot' menu, sends all commands on the line occupied by the cursor to GNUPLOT. @fuse{} adds a specialized history list to gnuplot-mode. Every time and entire script is sent to GNUPLOT, that script gets pushed onto a history list. You can navigate up and down the script history list, thus revisiting previous plots, by using C-c C-p and C-c C-n in the gnuplot-mode buffer or by hitting the up and down arrow icons in the XEmacs toolbar. The depth of the history list is determined by the value of fuse-gnuplot-history. Hitting C-c C-f k will terminate the GNUPLOT process and close the frame containing the gnuplot script. For more details about using gnuplot-mode, see the reference card `gpelcard.ps' which comes with @fuse{}.
Scripts used in plotting
Several scripts external to Emacs are used in the @fuse{} plotting utilities, KW, GNUFIX, and MR. With Unix, GNUPLOT is able to pipe data through external scripts using the system `popen' function. This is the purpose of the `<' character that appears in several of @fuse{}'s plotting scripts. KW is a simple AWK script for k-weighting chi(k) data. It simply multiplies each y-value in the data file by some power of the x-value. GNUFIX is a Bourne shell script containing a single SED command. It prepends a comment character (`#') to each line in the header of `chi.dat' or `xmu.dat' so that these files may be properly plotted using GNUPLOT. MR is a Bourne shell script used as an interface to a Fortran program for reading a record from a UWXAFS binary file. Another script, ESHIFT, comes with @fuse{} although it is not used in any of the built-in script generating functions. The purpose of this script is to e0-shift mu(E) data. In GNUPLOT it works in a manner analogous to KW. The following GNUPLOT command plots some data with a 5 volt e0 shift:
	pl '<eshift esh=5 data.xmu'
Note that any of these scripts can be used at the command line by redirecting their output to a file. For example:
	# kw w=5 data.chi > data.chi.weighted
	# gnufix esh=5 xmu.dat > xmu.data.fixed
	# eshift esh=5 data.xmu > data.xmu.shifted
	# mr data.xmu, 1 > data.xmu.ascii
These scripts are all in the `scripts' directory in the distribution. The directory containing these scripts is the value of fuse-bin-location. This directory is added to the exec-path when @fuse{} is started.

Limitations to FUSE's Plotting Utilities

@fuse{} is supposed to have a mechanism for detecting problems with the commands sent to GNUPLOT. In truth, I never got this to work properly and found that it was not entirely necessary. If something goes wrong with the plot, look at the `gnuplot-program' buffer by simply switching to that buffer or by using the `gnuplot-jump-to-gnuplot-buffer' function, normally bound to C-c C-e and in the `Gnuplot' menu in the gnuplot-buffer.

@fuse{}'s plotting functions are able to interact with either ASCII data or data in the UWXAFS binary format. Because of certain features of the UWXAFS binary format, the GNUPLOT scripts generated by @fuse{} may not be what you want. For example, a script for a FEFFIT fit is written assuming that the output data was written to a new file rather than appended to a pre-existing file. Thus the fit script uses numeric keys (`nkeys') beginning with 1.

Interaction with the UWXAFS binary files is one of the weaker areas in @fuse{}. In truth, I rarely use the binary files and my memory of how the programs read and write them is a bit fuzzy. In particular, I don't recall how AUTOBK writes its many possible output files when binary output is used. I have a few ideas about how to improve plotting from the binary files. It could be possible to set an nkey offset variable to handle pre-existing files. Another possibility would be something like Dired mode in Emacs, where the contents of the binary file are displayed to a buffer and records could be marked and subsequently plotted.


Go to the first, previous, next, last section, table of contents.