1 | <HTML> |
---|
2 | <TITLE> |
---|
3 | Customizing EXPGUI and Associated Programs |
---|
4 | </TITLE> |
---|
5 | <HEAD> |
---|
6 | </HEAD> |
---|
7 | <BODY> |
---|
8 | |
---|
9 | <CENTER> |
---|
10 | <H2> |
---|
11 | Customizing EXPGUI and Associated Programs</H2></CENTER> |
---|
12 | |
---|
13 | The EXPGUI GSAS graphical user interface can be modified in many |
---|
14 | ways quite easily. |
---|
15 | This document describes how the GUI works and how to modify the menus without |
---|
16 | significant reprogramming. |
---|
17 | <P> |
---|
18 | <H3>expgui</H3> |
---|
19 | The main GUI is created by file expgui, which in turn uses the following files |
---|
20 | sequentially: |
---|
21 | <UL> |
---|
22 | <LI><TT>readexp.tcl</TT> |
---|
23 | <LI><TT>gsascmds.tcl</TT> |
---|
24 | <LI><TT>gsasmenu.tcl</TT> |
---|
25 | </UL> |
---|
26 | Two 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>) |
---|
33 | must be located in the same directory where the <TT>expgui</TT> file is found. |
---|
34 | The <TT>localconfig</TT> file also is read from this directory, if it exists. |
---|
35 | The final file, <TT>.gsas_config</TT>, is read from the user's login directory (UNIX) or <TT>C:\</TT> (Windows). |
---|
36 | No error occurs if either <TT>localconfig</TT> or <TT>.gsas_config</TT> is |
---|
37 | not present. |
---|
38 | <P> |
---|
39 | The <TT>readexp.tcl</TT> and <TT>gsascmds.tcl</TT> files contain |
---|
40 | tcl procedures that are |
---|
41 | used for more than one application, so it is convenient to place them |
---|
42 | in separate files. They are only of interest to someone trying to debug |
---|
43 | or add new functionality to expgui. |
---|
44 | <P> |
---|
45 | The <TT>gsasmenu.tcl</TT> file defines the contents of the |
---|
46 | menu bar, the contents of the |
---|
47 | button bar and definitions for each command. The contents of this file |
---|
48 | are designed to be modified and extended by users, either by editing the file, |
---|
49 | or by overridding definitions in the <TT>localconfig</TT> or |
---|
50 | <TT>.gsas_config</TT> files. |
---|
51 | |
---|
52 | The variables in the <TT>gsasmenu.tcl</TT> are: |
---|
53 | <DL><DL> |
---|
54 | <DT>expgui(menunames)<DD> |
---|
55 | This list defines the menu bar headings other than File, Options & Help |
---|
56 | <DT>expgui_menulist<DD> |
---|
57 | Each array element, e.g. expgui_menulist(file) and expgui_menulist(powder), |
---|
58 | defines commands to be added to a menu heading. Each command will appear |
---|
59 | as an array element in expgui_cmdlist. |
---|
60 | <DT>expgui_cmdlist<DD> |
---|
61 | Each array element, e.g. expgui_cmdlist(Save) or expgui_cmdlist(expnam) |
---|
62 | contains two items. The first defines a tcl procedure to be executed |
---|
63 | when the command is invoked, or "-" if no command will be invoked and |
---|
64 | the second contains help information describing what the command does. |
---|
65 | Note that when menu item is selected the variable cmd is set to the |
---|
66 | name of the command, so |
---|
67 | <PRE> |
---|
68 | expgui_cmdlist(powpref) {{runGSASwEXP $cmd} {Powder data preparation}} |
---|
69 | </PRE> |
---|
70 | means 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> |
---|
74 | This list defines the commands that will appear on the button bar where |
---|
75 | each item that appears on the button bar must have a matching pair of entries |
---|
76 | in expgui_cmdlist. |
---|
77 | Thus if the command |
---|
78 | <PRE> |
---|
79 | set expgui(buttonlist) {expnam expedt genles ortep fourier forsrh forplot lstview} |
---|
80 | </PRE> |
---|
81 | is placed in the <TT>localconfig</TT> or <TT>.gsas_config</TT> files this will |
---|
82 | redefine the contents of the button bar. |
---|
83 | </DL></DL> |
---|
84 | |
---|
85 | In addition to the variables defined in the previous file, expgui, uses |
---|
86 | a small number of array for other configuration options. They are: |
---|
87 | <DL><DL> |
---|
88 | <DT>expgui(archive)<DD> |
---|
89 | set expgui(coordfont) "-*-courier-bold-r-normal--12-*" |
---|
90 | set expgui(histfont) "-*-courier-bold-r-normal--12-*" |
---|
91 | set liveplot(hst) 1 |
---|
92 | set liveplot(legend) 1 |
---|
93 | set expgui(filesort) 1 |
---|
94 | set expgui(scriptdir) [file dirname $expgui(script) ] |
---|
95 | set expgui(gsasdir) [file dirname $expgui(scriptdir)] |
---|
96 | set expgui(gsasexe) [file join $expgui(gsasdir) exe] |
---|
97 | set expgui(asorttype) $expgui(asorttype)" |
---|
98 | set expgui(hsorttype) $expgui(hsorttype)" |
---|
99 | set expgui(filesort) $expgui(filesort)" |
---|
100 | set env(GSASBACKSPACE) $env(GSASBACKSPACE)" |
---|
101 | |
---|
102 | This determines where files menulist, cmdlist, helplist |
---|
103 | and buttonlist, as well as widplt and lstview are located. |
---|
104 | Rarely needs to be changed. |
---|
105 | <LI><B>gsasexe</B>: |
---|
106 | This determines where the GSAS executable files are located. |
---|
107 | You might want to change this is you keep multiple versions of GSAS |
---|
108 | around or if you keep the GSAS files in a different location than |
---|
109 | the default or want to keep the tcl files somewhere other than |
---|
110 | in a subdirectory of the GSAS files. |
---|
111 | <LI><B>env(GSASEXE)</B>: This sets an environment variable which is |
---|
112 | probably not used. |
---|
113 | <LI><B>env(ATOMDATA)</B>: This sets an environment variable which |
---|
114 | defines the location of a data file (.../gsas/data/atomdata.dat) |
---|
115 | needed by EXPEDT and probably other programs. |
---|
116 | <LI><B>env(ATMXSECT)</B>: This sets an environment variable which |
---|
117 | defines the location of a data file (.../gsas/data/atmxsect.dat) |
---|
118 | needed by program FPRIME. |
---|
119 | <LI><B>env(LENPAGE)</B>: This sets an environment variable which defines |
---|
120 | the number of lines per page used in the .LST file. You may want to |
---|
121 | change 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> |
---|
124 | graphics library. |
---|
125 | <LI><B>env(GSASBACKSPACE)</B>: This determines if the default definition |
---|
126 | for the backspace key is overridden; some UNIX systems need this so that |
---|
127 | expedt and other terminal-oriented programs work correctly and |
---|
128 | other 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 |
---|
129 | set the variable to default as "off" use |
---|
130 | <PRE> |
---|
131 | setenv GSASBACKSPACE 0 |
---|
132 | </PRE> |
---|
133 | in your <tt>~/.cshrc</tt> file or include |
---|
134 | <PRE> |
---|
135 | set env(GSASBACKSPACE) 0 |
---|
136 | </PRE> |
---|
137 | in your <tt>~/.gsas_config</tt> or <tt>localconfig</tt> file. |
---|
138 | <LI><B>archive</B>: This defines the default state for the archive flag, |
---|
139 | where 0 is off and 1 is on. When archive is on, a copy of the .EXP file |
---|
140 | is saved as <expnam>.EXP.nnn and compressed before EXPEDT is run. |
---|
141 | <LI><B>compressprog</B>: This defines a compression program used to |
---|
142 | reduce the size of archived .EXP files. |
---|
143 | <LI><B>debug</B>: Setting debug to 1 turns on a number of annoying |
---|
144 | warning messages. |
---|
145 | </LI></UL> |
---|
146 | |
---|
147 | <H3>lstview</H3> |
---|
148 | The 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, |
---|
152 | the program will show the last cycle in the file. As new cycles are |
---|
153 | added, the "view" is advanced. |
---|
154 | <LI><B>txtvw(menulength)</B>: This limits the number of entries that can |
---|
155 | exist in a menu. For example, the default is 25, so when more than 25 cycles |
---|
156 | are 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 |
---|
159 | characters that will be read from an existing .LST file to speed |
---|
160 | the start of the program. The default for txtvw(maxchars) is ~1Mb |
---|
161 | for UNIX systems and ~200K for Windows. |
---|
162 | </LI></UL> |
---|
163 | One 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 |
---|
166 | and plots shifts and R values as a function cycle number. Setting plotvars to 1 |
---|
167 | allows this code to be tested. |
---|
168 | </LI></UL> |
---|
169 | <A NAME="notroot"></A> |
---|
170 | <H3>liveplot</H3> |
---|
171 | This program can be customized by overriding definitions for the |
---|
172 | following variables in file <tt> ~/.liveplotrc</tt>. |
---|
173 | <UL> |
---|
174 | <LI><B>graph(printout)</B>: This is set to 1 if PostScript files |
---|
175 | will 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 |
---|
177 | when PostScript files will be written to disk. |
---|
178 | <LI><B>graph(outcmd)</B>: This is the default for the command used |
---|
179 | to print PostScript files. |
---|
180 | <LI><B>peakinfo(color</B><i>n</i><B>)</B>: These variables define the default colors for |
---|
181 | reflections in phase "<i>n</i>" |
---|
182 | </LI></UL> |
---|
183 | <P> |
---|
184 | If you have <A HREF="http://rrdjazz.nist.gov/~toby/cmpr.html">CMPR</A> |
---|
185 | installed on your computer, you can use superimpose on liveplot the peaks |
---|
186 | for an arbitrary unit cell with space group extinctions show, if desired. |
---|
187 | This is pretty neat! To enable this feature, you must have a version of the |
---|
188 | GSAS GUI routines downloaded after 4 May 1998 and have installed |
---|
189 | a 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> |
---|
192 | Then create a link from in the GSAS GUI |
---|
193 | directory 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> |
---|
199 | If you have <A HREF="http://rrdjazz.nist.gov/~toby/logic.html">LOGIC</A> |
---|
200 | installed on your computer, you can use superimpose peaks |
---|
201 | for a entry from the ICDD/JCPDS database on a pattern in LIVEPLOT. |
---|
202 | This is also pretty neat! |
---|
203 | To enable this feature, you must have a version of the |
---|
204 | GSAS GUI routines downloaded after 4 May 1998 and have installed |
---|
205 | a 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> |
---|
208 | Then create a link from in the GSAS GUI |
---|
209 | directory 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> |
---|
215 | The widplt script is used to display the FWHM for one or more histograms |
---|
216 | from a .EXP file. It is often convenient to add for reference the expected |
---|
217 | instrumental curves as options to the menu. This can be done by creating a |
---|
218 | file 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 |
---|
221 | to be added to the menu of defined FWHM values. |
---|
222 | <P> |
---|
223 | Creating such a file is easy. To add a entry define the following |
---|
224 | five array elements using a single, unique element name and then append that |
---|
225 | element name to variable datalist. |
---|
226 | Define |
---|
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> |
---|
235 | Array element UVWP(item) contains the (Gaussian) GU, GV, GW and GP values, |
---|
236 | while XY(item) contains the (Lorentzian) LX and Ly terms. Array element |
---|
237 | wave(item) contains a wavelength, array element lblarr(item) contains |
---|
238 | the text to be shown on the "Plot Contents" menu and ttrange(item) |
---|
239 | defines the range the function is valid. |
---|
240 | <P> |
---|
241 | Note that this script will |
---|
242 | probably 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, |
---|
245 | Los Alamos National Laboratory, Los Alamos, NM 87545. Problems, questions |
---|
246 | or 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. |
---|
252 | The GSAS software was produced under a U.S. Government contract (W-7405-ENG-36) |
---|
253 | by the Los Alamos National Laboratory, which is operated by the University |
---|
254 | of California for the U.S. Department of Energy. The U.S. Government is |
---|
255 | licensed to use, reproduce, and distribute this software. Permission is |
---|
256 | granted to the public to copy and use this software without charge, provided |
---|
257 | that this notice and any statement of authorship are reproduced on all |
---|
258 | copies. Neither the Government nor the University makes any warranty, express |
---|
259 | or implied, or assumes any liability or responsibility for the use of this |
---|
260 | software. |
---|
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> |
---|