Link to NIST Center for Neutron Research home page Link to National Institute of Standards & Technology home page
Link to Tcl/Tk information

Next page

A Graphical User Interface for GSAS

EXPGUI is a graphical interface for the GSAS package. It allows two types of actions: it can be used to directly modify the GSAS experiment file with a graphical user interface (GUI) and it can be used to invoke the programs inside the GSAS package such as EXPEDT, GENLES, FOURIER... These programs can be run from a menu or in many cases by pressing buttons.

This documentation describes the different actions that can be accomplished with the different panes and the contents of the menus. Other documents about EXPGUI are: Installation notes for Windows, and for UNIX, Customization notes, a list of warning, error and informational messages and two example tutorials: for TOF and constant-wavelength neutron. Note that screen images in this document are not updated as frequently as the text.

A. Experiment file editing

When an experiment (.EXP) file is read, a copy is made in local computer memory. The values in memory can then be edited by selecting different panes ("pages" or "panels") from the tabbed list, where each pane is reserved for a different section of the .EXP file. The changes values are written back out to the .EXP file when the "File/Save" or "File/Save as" menu bar options are used. The .EXP file is also automatically written before running any GSAS programs, such as GENLES or EXPEDT.

The notebook pane tabs.
EXPGUI Screen snapshot
More information about each pane can be found using the links below.

A.1 Least Squares (LS) Controls Pane

A.2 Phase Pane

A.3 Histogram pane

A.4 Scaling pane

A.5 Profile pane

A.6 Constraints pane

A.7 Preferential Orientation Pane

EXPGUI Screen snapshot New! Values changed in the entry boxes in these panes are immediately transferred to the "in memory" copy of the .EXP file, unless there is an error in the typed value, (for example if "1..0" is typed, or "1.5" is typed where an integer is expected.) When a value is invalid, it is not saved. In this case, the text is turned red, to indicate that an error is present, as shown in the figure to the left, where "90.000x" has been entered for alpha.

B. Shortcuts

B.1 Multiple Histogram Selection

This mode allows parameters to be changed for groups of histograms. When the "Multiple Histogram Selection" mode is off, it is possible to modify parameters and refinement flags for only a single histogram, but the other settings allow groups of histograms to be selected and modified. (see Mouse Actions).

It does not make sense, however, to globally modify instrument-related parameters and flags for different histogram types. So global actions can be limited to a single class of histogram types (e.g. TOF, CW Neutron,...), which allows these parameters to be set for groups of similar histograms. Thus, if this mode is set to "All" the Histogram and Profile panes are disabled.

The setting for "Multiple Histogram Selection" mode is displayed above each histogram selection box and is selected using the "Multiple Hist. Selection" item on the Options menu to create a submenu or by clicking on the display. Note that another option in this "Multiple Hist. Selection" submenu is an option "Group Phases Together" that controls how EXPGUI treats phases having the same profile type that is used when multiple histograms are selected. If the "Group Phases Together" option is on, then the refinement flags for all phases with the same histogram types are grouped together, when possible. If this option is off, phases are treated separately. New! If the left mouse button is used to click on the selection mode display, the mode is cycled between the available modes. If the right mouse button is used, the mode is reset, to disable multiple histogram selection.

B.2 Mouse Actions

A range of atoms or (in multiple selection mode) histograms may be selected by dragging (holding down) the left mouse button. It is also possible to select a range by using the Shift key with the left mouse button. To select or deselect individual entries, use the Control key with the left mouse button. Pressing the right mouse button selects all entries in a list.

C. Menu Commands and Programs

GSAS programs are invoked either through use of the menu bar

The menu bar.
EXPGUI Screen snapshot
or by "pressing" a button on the button bar. The button bar simply provides an easy way to access commonly used actions on the menu bar. Users can configure the menu bar to include their own preferred actions and, with some knowledge of the program and Tcl/Tk, add their own commands to the menu bar or button bar.

The button bar.
EXPGUI Screen snapshot
A description of the EXPGUI menus follows. Use the links to obtain more information, including a very brief description of the function of each menu option. Note that an option may appear under more than one menu.

C.1 File Menu

The options on the File menu as is the custom contains the commands for reading and writing experiment files, as well as starting and ending the program.

C.2 Options Menu

This menu contains options that determine how EXPGUI runs.

C.3 Powder Menu

This menu contains links to GSAS programs used for powder diffraction analysis.

C.4 Single Crystal Menu

This menu contains links to GSAS programs used for single-crystal diffraction analysis.

C.5 Graphics Menu

This menu contains links to several GSAS and two non-GSAS (liveplot and widplt) programs used for graphical display of data and results.

C.6 Results Menu

This menu contains links to several GSAS and one non-GSAS (lstview) programs used for analysis of results.

C.7 Calculations Menu

This menu contains programs for useful crystallographic computations.

C.8 Import/Export Menu

This menu contains utilities for importing information into GSAS and exporting.

D. EXPGUI Utility Programs


lstview is used to browse through the GSAS output listing. It is invoked by the "lstview" command in the GUI.
EXPGUI Screen snapshot


liveplot shows the observed, calculated and difference plots for powder refinements. The plot is updated as the refinement progresses. The mouse can be used to zoom in on sections of the plot. Liveplot uses the BLT graphics package.
EXPGUI Screen snapshot
New! LIVEPLOT can now be enhanced to superimpose peak locations for input unit cells or peaks from JCPDS/ICDD entries. See the LIVEPLOT customization information or read file expgui_cfg.html in the gsas/tcl/doc directory.

LIVEPLOT gets the current diffraction information by running the TCLDUMP program, if installed, or HSTDUMP otherwise. The TCLDUMP program has been optimized for use with LIVEPLOT and offers a number of extra options that are not available when HSTDUMP is used: plots can be displayed in the native units (2Theta/TOF/KeV), or in d-space or Q; fixed plus fitted background curves are shown in green; if reflection tickmarks are displayed, New! reflection tickmarks can be displayed by pressing "H" or "h" while the mouse is near a reflection (holding the shift key while pressing the left mouse button also works). See the installation instructions for installing TCLDUMP.


WIDPLT can be used to plot the actual peak widths generated by the profile parameters used in GSAS. It is possible to define reference curves that are loaded automatically. WIDPLT uses the BLT graphics package.
EXPGUI Screen snapshot

Unix File Conversions

In UNIX, GSAS data, experiment and instrument parameter files are expected to have a format with exactly 80 characters per line and no line separators (no carriage returns or linefeeds). Files in this format are called "Direct Access". Normal UNIX files may have any number of characters per line and every line is terminated by a line feed character. These files are called "sequential". EXPGUI uses the convention that all uppercase is used for Direct Access files while all lowercase is used for sequential files.

The Unix File Conversion menu is used to convert sequential files to direct access for use in GSAS or to convert direct access files to sequential, for use in standard UNIX programs, such as editors or e-mail.

Windows File Conversions

In Windows, GSAS data, experiment and instrument parameter files are expected to have a format with exactly 80 characters per line followed by a carriage returns and a linefeed (82 characters total per line). Files in this format can be read in "Direct Access" mode. The Convert menu in windows can be used to convert files into this format (it can also convert UNIX direct access files correctly). The original version of the file is retained and renamed.

Compute Composition

The composition box shows the unit cell and asymmetric unit composition for all phases in a material. Site multiplicities and occupancies are taken into account.

Export coordinates in MSI .xtl format

The Export/exp2xtl routine writes a .xtl file, as is used in Insight-II and Cerius2 (Molecular Simulations, Inc.). Note that spacegroups are not named exactly the same in the two programs and the origin may need to be specified as "origin 2", for spacegroups where the center of symmetry is not at the origin. It is up to the user to get things right.

Delete History Records

Every time a GSAS program (including EXPGUI) is run, an entry is added to the "history records" in the .EXP file. After 999 entries have been written, no more can be added to the file. Further, reading large numbers of history records can slow the GSAS programs (this is less of a problem on faster computers). For these reasons, it may be a good idea to prune the older history records from the file. If more than 100 history records are found in an experiment file, EXPGUI suggests that the older history entries be deleted. Alternately the File/EraseHistory command can be used to invoke the this option.

On the dialog the number of history records to be retained is specified. Also, after records have been deleted, the remaining records can be renumbered starting with 1, so that the 999 record limit is not reached.


The BLT graphics package is used by the WIDPLT and LIVEPLOT routines. If the package can not be loaded these routines, an error message, "Error -- Unable to load the BLT package", will be displayed. A frequent problem is the package is installed, but not configured so that common support routines are loaded automatically. If this is the case, a message, "BLT Setup Error: could not access a Blt_ routine...", will be displayed. Please see for more information on installation of BLT.


Praise to Larson and Von Dreele for GSAS, Ousterhout for Tcl/Tk, Przemek Klosowski for convincing me to learn Tcl/Tk and Jonathan Wasserman for helping get this project started. Large sections of the Preferred Orientation GUI were written by Pamela Whitfield of the NRC (Canada).

GSAS is written by Allen C. Larson and Robert B. Von Dreele, MS-H805, Los Alamos National Laboratory, Los Alamos, NM 87545. Problems, questions or kudos concerning GSAS should be sent to Robert B. Von Dreele at EXPGUI is written by Brian H. Toby of the NIST Center for Neutron Research, Brian.Toby@NIST.GOV with help from Jonathan Wasserman.

GSAS is Copyright, 1984-2000, by the Regents of the University of California. The GSAS software was produced under a U.S. Government contract (W-7405-ENG-36) by the Los Alamos National Laboratory, which is operated by the University of California for the U.S. Department of Energy. The U.S. Government is licensed to use, reproduce, and distribute this software. Permission is granted to the public to copy and use this software without charge, provided that this notice and any statement of authorship are reproduced on all copies. Neither the Government nor the University makes any warranty, express or implied, or assumes any liability or responsibility for the use of this software.

EXPGUI is not subject to copyright. Have fun with it. Modify it. Write new sections and make them available to the rest of the world.

Neither the U.S. Government nor any author makes any warranty, expressed or implied, or assumes any liability or responsibility for the use of this information or the software described here. Brand names cited here are used for identification purposes and do not consitute an endorsement by NIST.
Next page

Brian Toby (Brian.Toby@NIST.GOV)
$Revision: 329 $ $Date: 2009-12-04 23:04:14 +0000 (Fri, 04 Dec 2009) $