source: trunk/doc/expgui_cfg.html @ 38

Last change on this file since 38 was 36, checked in by toby, 12 years ago

# on 1999/01/20 21:33:38, toby did:
Initial revision

  • Property rcs:author set to toby
  • Property rcs:date set to 1999/01/20 21:33:38
  • Property rcs:rev set to 1.1
  • Property rcs:state set to Exp
  • Property svn:keywords set to Author Date Revision Id
File size: 11.6 KB
Line 
1<HTML>
2<TITLE>
3Customizing EXPGUI and Associated Programs
4</TITLE>
5<HEAD>
6</HEAD>
7<BODY>
8
9<CENTER>
10<H2>
11Customizing EXPGUI and Associated Programs</H2></CENTER>
12
13The EXPGUI GSAS graphical user interface can be modified in many
14ways quite easily.
15This document describes how the GUI works and how to modify the menus without
16significant reprogramming.
17<P>
18<H3>expgui</H3>
19The main GUI is created by file expgui, which in turn uses the following files
20sequentially:
21<UL>
22<LI><TT>readexp.tcl</TT>
23<LI><TT>gsascmds.tcl</TT>
24<LI><TT>gsasmenu.tcl</TT>
25</UL>
26Two additional files are read if they are found:
27<UL>
28<LI><TT>localconfig</TT>
29<LI><TT>.gsas_config</TT>
30</UL>
31<P>The first three files,
32(<TT>readexp.tcl</TT>, <TT>gsascmds.tcl</TT>, <TT>gsasmenu.tcl</TT>)
33must be located in the same directory where the <TT>expgui</TT> file is found.
34The <TT>localconfig</TT> file also is read from this directory, if it exists.
35The final file, <TT>.gsas_config</TT>, is read from the user's login directory (UNIX) or <TT>C:\</TT> (Windows).
36No error occurs if either <TT>localconfig</TT> or <TT>.gsas_config</TT> is
37not present.
38<P>
39The <TT>readexp.tcl</TT> and <TT>gsascmds.tcl</TT> files contain
40tcl procedures that are
41used for more than one application, so it is convenient to place them
42in separate files. They are only of interest to someone trying to debug
43or add new functionality to expgui.
44<P>
45The <TT>gsasmenu.tcl</TT> file defines the contents of the
46menu bar, the contents of the
47button bar and definitions for each command. The contents of this file
48are designed to be modified and extended by users, either by editing the file,
49or by overridding definitions in the <TT>localconfig</TT> or
50<TT>.gsas_config</TT> files.
51
52The variables in the <TT>gsasmenu.tcl</TT> are:
53<DL><DL>
54<DT>expgui(menunames)<DD>
55This list defines the menu bar headings other than File, Options & Help
56<DT>expgui_menulist<DD>
57Each array element, e.g. expgui_menulist(file) and expgui_menulist(powder),
58defines commands to be added to a menu heading. Each command will appear
59as an array element in expgui_cmdlist.
60<DT>expgui_cmdlist<DD>
61Each array element, e.g. expgui_cmdlist(Save) or expgui_cmdlist(expnam)
62contains two items. The first defines a tcl procedure to be executed
63when the command is invoked, or "-" if no command will be invoked and
64the second contains help information describing what the command does.
65Note that when menu item is selected the variable cmd is set to the
66name of the command, so
67<PRE>
68    expgui_cmdlist(powpref) {{runGSASwEXP $cmd} {Powder data preparation}}
69</PRE>
70means that "runGSASwEXP powpref" will be invoked when powpref is invoked.
71. For example, when powpref is selected, the tcl command
72"runGSASwEXP $cmd" is invoked, where variable cmd is set to "powpref".
73<DT>expgui(buttonlist)<DD>
74This list defines the commands that will appear on the button bar where
75each item that appears on the button bar must have a matching pair of entries
76in expgui_cmdlist.
77Thus if the command
78<PRE>
79   set expgui(buttonlist) {expnam expedt genles ortep fourier forsrh forplot lstview}
80</PRE>
81is placed in the <TT>localconfig</TT> or <TT>.gsas_config</TT> files this will
82redefine the contents of the button bar.
83</DL></DL>
84
85In addition to the variables defined in the previous file, expgui, uses
86a small number of array for other configuration options. They are:
87<DL><DL>
88<DT>expgui(archive)<DD>
89set expgui(coordfont) "-*-courier-bold-r-normal--12-*"
90set expgui(histfont) "-*-courier-bold-r-normal--12-*"
91set liveplot(hst) 1
92set liveplot(legend) 1
93set expgui(filesort) 1
94set expgui(scriptdir) [file dirname $expgui(script) ]
95set expgui(gsasdir) [file dirname $expgui(scriptdir)]
96set expgui(gsasexe) [file join $expgui(gsasdir) exe]
97set expgui(asorttype) $expgui(asorttype)"
98set expgui(hsorttype) $expgui(hsorttype)"
99set expgui(filesort) $expgui(filesort)"
100set env(GSASBACKSPACE) $env(GSASBACKSPACE)"
101
102This determines where files menulist, cmdlist, helplist
103and buttonlist, as well as widplt and lstview are located.
104Rarely needs to be changed.
105<LI><B>gsasexe</B>:
106This determines where the GSAS executable files are located.
107You might want to change this is you keep multiple versions of GSAS
108around or if you keep the GSAS files in a different location than
109the default or want to keep the tcl files somewhere other than
110in a subdirectory of the GSAS files.
111<LI><B>env(GSASEXE)</B>: This sets an environment variable which is
112probably not used.
113<LI><B>env(ATOMDATA)</B>: This sets an environment variable which
114defines the location of a data file (.../gsas/data/atomdata.dat)
115needed by EXPEDT and probably other programs.
116<LI><B>env(ATMXSECT)</B>: This sets an environment variable which
117defines the location of a data file (.../gsas/data/atmxsect.dat)
118needed by program FPRIME.
119<LI><B>env(LENPAGE)</B>: This sets an environment variable which defines
120the number of lines per page used in the .LST file. You may want to
121change this to match your favorite print format to save paper.
122<LI><B>env(PGPLOT_DIR)</B>: This sets an environment variable needed by the
123<A HREF="http://www.nist.gov/cgi-bin/exit_nist.cgi?url=http://astro.caltech.edu/~tjp/pgplot/" target=_top>PGPLOT</A> 
124graphics library.
125<LI><B>env(GSASBACKSPACE)</B>: This determines if the default definition
126for the backspace key is overridden; some UNIX systems need this so that
127expedt and other terminal-oriented programs work correctly and
128other systems do not. You can toggle this option using the "sets an environment variable needed by the "Override Backspace" option on the file menu. To
129set the variable to default as "off" use
130<PRE>
131        setenv GSASBACKSPACE 0
132</PRE>
133in your <tt>~/.cshrc</tt> file or include
134<PRE>
135        set env(GSASBACKSPACE) 0
136</PRE>
137in your <tt>~/.gsas_config</tt> or <tt>localconfig</tt> file.
138<LI><B>archive</B>: This defines the default state for the archive flag,
139where 0 is off and 1 is on. When archive is on, a copy of the .EXP file
140is saved as <expnam>.EXP.nnn and compressed before EXPEDT is run.
141<LI><B>compressprog</B>: This defines a compression program used to
142reduce the size of archived .EXP files.
143<LI><B>debug</B>: Setting debug to 1 turns on a number of annoying
144warning messages.
145</LI></UL>
146
147<H3>lstview</H3>
148The following options are available for customization
149<UL>
150<LI><B>txtvw(followcycle)</B>: This sets the initial value for the
151"Auto Advance" button in the "Go To" menu. When this is true,
152the program will show the last cycle in the file. As new cycles are
153added, the "view" is advanced.
154<LI><B>txtvw(menulength)</B>: This limits the number of entries that can
155exist in a menu. For example, the default is 25, so when more than 25 cycles
156are found in a .LST file, only the last 25 are listed in the
157"Go To"/cycle submenu.
158<LI><B>txtvw(maxchars)</B>: This limits the maximum number of
159characters that will be read from an existing .LST file to speed
160the start of the program. The default for txtvw(maxchars) is ~1Mb
161for UNIX systems and ~200K for Windows.
162</LI></UL>
163One additional variable is present that I don't suggest using:
164<UL>
165<LI><B>plotvars</B>: I am in the process of developing code that tracks
166and plots shifts and R values as a function cycle number. Setting plotvars to 1
167allows this code to be tested.
168</LI></UL>
169<A NAME="notroot"></A>
170<H3>liveplot</H3>
171This program can be customized by overriding definitions for the
172following variables in file <tt> ~/.liveplotrc</tt>.
173<UL>
174<LI><B>graph(printout)</B>: This is set to 1 if PostScript files
175will be printed and 0 if they will be written to disk.
176<LI><B>graph(outname)</B>: This is the default for the file name used
177when PostScript files will be written to disk.
178<LI><B>graph(outcmd)</B>: This is the default for the command used
179to print PostScript files.
180<LI><B>peakinfo(color</B><i>n</i><B>)</B>: These variables define the default colors for
181reflections in phase "<i>n</i>"
182</LI></UL>
183<P>
184If you have <A HREF="http://rrdjazz.nist.gov/~toby/cmpr.html">CMPR</A>
185installed on your computer, you can use superimpose on liveplot the peaks
186for an arbitrary unit cell with space group extinctions show, if desired.
187This is pretty neat! To enable this feature, you must have a version of the
188GSAS GUI routines downloaded after 4 May 1998 and have installed
189a version of CMPR downloaded after 4 May 1998
190<A HREF="http://rrdjazz.nist.gov/~toby/cmpr.html">
191(see the CMPR installation instructions.)</A>
192Then create a link from in the GSAS GUI
193directory to file cellgen.tcl in the CMPR directory. For example:
194<PRE>
195         ln -s /usr/local/cmpr/cellgen.tcl /usr/local/gsas/tcl/cellgen.tcl
196</PRE>
197
198<P>
199If you have <A HREF="http://rrdjazz.nist.gov/~toby/logic.html">LOGIC</A>
200installed on your computer, you can use superimpose peaks
201for a entry from the ICDD/JCPDS database on a pattern in LIVEPLOT.
202This is also pretty neat!
203To enable this feature, you must have a version of the
204GSAS GUI routines downloaded after 4 May 1998 and have installed
205a version of LOGIC downloaded after 4 May 1998
206<A HREF="http://rrdjazz.nist.gov/~toby/logic.html">
207(see the LOGIC installation instructions.)</A>
208Then create a link from in the GSAS GUI
209directory to file icddcmd.tcl in the LOGIC directory. For example:
210<PRE>
211         ln -s /usr/local/powdersuite/icddcmd.tcl /usr/local/gsas/tcl/icddcmd.tcl
212</PRE>
213
214<H3>widplt</H3>
215The widplt script is used to display the FWHM for one or more histograms
216from a .EXP file. It is often convenient to add for reference the expected
217instrumental curves as options to the menu. This can be done by creating a
218file called widplot_<i>name</i>. For example, renaming the
219<tt>example_widplt_BT1</tt> file supplied with the distribution to
220<tt>widplt_BT1</tt> will cause the FWHM curves for the NIST BT-1 instrument
221to be added to the menu of defined FWHM values.
222<P>
223Creating such a file is easy. To add a entry define the following
224five array elements using a single, unique element name and then append that
225element name to variable datalist.
226Define
227<PRE>
228    set UVWP(Ge15) {398.5 -343.2  163.0 0}
229    set XY(Ge15) {0 0}
230    set wave(Ge15) 2.0775
231    set lblarr(Ge15) "BT-1 Ge(311) 15'"
232    set ttrange(Ge15) "5 160"
233    lappend datalist Ge15
234</PRE>
235Array element UVWP(item) contains the (Gaussian) GU, GV, GW and GP values,
236while XY(item) contains the (Lorentzian) LX and Ly terms. Array element
237wave(item) contains a wavelength, array element lblarr(item) contains
238the text to be shown on the "Plot Contents" menu and ttrange(item)
239defines the range the function is valid.
240<P>
241Note that this script will
242probably need some work to be used with TOF diffraction.
243
244<HR>GSAS is written by: Allen C. Larson and Robert B. Von Dreele MS-H805,
245Los Alamos National Laboratory, Los Alamos, NM 87545. Problems, questions
246or kudos concerning GSAS should be sent to Robert B. Von Dreele at <A HREF="MAILTO:vondreele@lanl.gov">vondreele@lanl.gov</A>
247
248<P>The GUI is written by Brian H. Toby of the NIST Center for Neutron Research,
249<A HREF="MAILTO:Brian.Toby@NIST.GOV">Brian.Toby@NIST.GOV</A>.
250
251<P>GSAS is Copyright, 1984-1997, The Regents of the University of California.
252The GSAS software was produced under a U.S. Government contract (W-7405-ENG-36)
253by the Los Alamos National Laboratory, which is operated by the University
254of California for the U.S. Department of Energy. The U.S. Government is
255licensed to use, reproduce, and distribute this software. Permission is
256granted to the public to copy and use this software without charge, provided
257that this notice and any statement of authorship are reproduced on all
258copies. Neither the Government nor the University makes any warranty, express
259or implied, or assumes any liability or responsibility for the use of this
260software.
261
262<P>The GUI is not subject to copyright. Have fun.
263
264<P>Brian Toby (<A HREF="MAILTO:Brian.Toby@NIST.GOV">Brian.Toby@NIST.GOV)</A>
265<BR>
266$Revision: 36 $ $Date: 2009-12-04 22:59:18 +0000 (Fri, 04 Dec 2009) $
267</BODY>
268</HTML>
Note: See TracBrowser for help on using the repository browser.