- Timestamp:
- Dec 4, 2009 5:05:38 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/liveplot.html
- Property rcs:date changed from 2001/05/11 04:15:34 to 2001/06/29 18:34:32
- Property rcs:rev changed from 1.1 to 1.2
- Property rcs:lines set to +234 -45
r386 r406 2 2 <head> 3 3 <META NAME="Author" CONTENT="Brian H. Toby"> 4 <title>EXPGUI -- LIVEPLOT </title>4 <title>EXPGUI -- LIVEPLOT/BKGEDIT</title> 5 5 </head> 6 6 <BODY BGCOLOR="#FFFFFF"> … … 26 26 27 27 <center><h1> 28 LIVEPLOT 28 LIVEPLOT and BKGEDIT 29 29 </h1></center> 30 This page documents the LIVEPLOT utility in the EXPGUI package. 31 <P> 32 LIVEPLOT gets the current diffraction information by running the TCLDUMP program, if installed, or 30 This page documents the LIVEPLOT and BKGEDIT utility programs 31 in the EXPGUI package. 32 LIVEPLOT and BKGEDIT are actually the same program, but perform 33 different functions, depending on how they are invoked. 34 LIVEPLOT is used to display the quality of the diffraction fit, while 35 BKGEDIT is used to fit a background function to fixed background points 36 that have been input by the user. 37 <P> 38 Both LIVEPLOT and BKGEDIT get the current diffraction information 39 by running the TCLDUMP program, if installed, or 33 40 HSTDUMP otherwise. The TCLDUMP program has been optimized for use 34 41 with LIVEPLOT and offers a number of extra … … 36 43 included in GSAS since April of 2000, it is assumed that this is now the case. 37 44 45 <a name="liveplot"></a> 46 <H3>LIVEPLOT</H3> 47 LIVEPLOT is started by pressing the LIVEPLOT button on the toolbar 48 or via the Graphs/liveplot menu item. 49 <P> 38 50 Some of the features available in LIVEPLOT are: 39 51 <UL> … … 45 57 native units (2Theta/TOF/KeV); d-space (A) or Q (A<sup>-1</sup>) 46 58 <LI> 47 The background (fixed plus fitted) can be plotted or can be sub racted.59 The background (fixed plus fitted) can be plotted or can be subtracted. 48 60 <LI> 49 61 Reflection tickmarks can be displayed in a variety of formats … … 60 72 </UL> 61 73 62 <hr><h2>LIVEPLOT Menu Contents</h2> 63 <DL><DL> 74 <a name="bkgedit"></a> 75 <H3>BKGEDIT</H3> 76 <IMG SRC="new.gif" HEIGHT=13 WIDTH=36 alt="New!"> 77 For most refinements, it is possible to simply select a background 78 function (I find that the type 1 function, 79 shifted Chebyschev polynomials, work well) 80 and then refine, adding terms until a good fit is obtained. 81 On occasion, poor initial fits are obtained in this manner. This is 82 most common in cases where large numbers of peaks are poorly fit. Since 83 significant sections of the data are not well fit, the refinement results in 84 an unreasonable background function, because this yields better agreement 85 with the observed data. 86 In these cases, 87 it may be best to fix the background to follow a "reasonable" curve in the 88 initial stages and then refine the background in the final stages of 89 refinement, when a good model has been obtained. 90 <P> 91 The BKGEDIT program, as shown below, is used to input a set a background 92 points via the mouse. The points are then used to determine a type 1 93 (Chebyschev) background function that fits the input background points. These 94 terms can then be saved in the experiment file creating a background that 95 is good enough for the initial stages of refinement and that can be 96 refined once the model is adequate for the task. 97 <P> 98 <IMG SRC="b1.gif" align=TEXTOP alt="BKGEDIT screen image"> 99 <H4>Steps in fitting a background function</H4> 100 The BKGEDIT program is started from 101 via the Powder/bkgedit menu item or by pressing the 102 "Fit Background Graphically" button on the 103 <A href="http:expgui3.html#EditBackground">"Edit Background"</A> 104 dialog box (invoked from the "Edit Background" button on the 105 <A href="http:expgui3.html">Histogram pane</A>.) 106 toolbar 107 or 108 <OL> 109 <LI><a href="http:#zoom">Zoom in</a> on the lower intensity section of the 110 plot, so that the background is clearly discernible. In some cases, the 111 data will need to be handled in sections. 112 <LI>Press the "Add" button to add background points. 113 Note the cursor changes from cross-hairs to an arrow, 114 when the "Add" button is pressed. 115 <LI>Move the mouse to the first location 116 where a background point will be added and click with the left 117 mouse button. A magenta triangle will appear at the location. 118 Points can be added in any order. It is best to make sure that the fixed points 119 are placed over the entire range of the data, e.g. near the maximum and minimum 120 data points in TOF, 2theta, etc. 121 <DL><DL> 122 Note that it is advisable to place many background points in areas where 123 the background varies greatly. 124 </DL></DL> 125 As background points are entered, they are saved in a file named 126 <I>EXPNAM</I><tt>.bkg</tt><I>N</I>, where 127 <I>EXPNAM</I> is the experiment name and <I>N</I> is the histogram number. 128 If BKGEDIT is restarted at some later time, these points are reread. 129 <LI>If any points are placed in incorrect positions, they can be deleted by 130 pressing the "Delete" button. The mouse cursor changes to a circle. When 131 the mouse left clicked, the fixed background point closest to the mouse 132 position (which may be outside the zoom range) is deleted. 133 <LI>Background points can also be edited by entering numbers into the 134 "Background points" area. 135 <LI>After enough background points have been entered, the 136 "Start Fit" button turns from gray to black. When pressed, the Chebyschev 137 polynomial is fitted and the resulting curve is shown as a blue dashed line. 138 <DL><DL> 139 It is suggested that you start with relatively few 140 terms and add terms and background points as needed. 141 Note that the maximum number of Chebyschev terms increases as 142 more background points are entered. 143 </DL></DL> 144 The "Improve Fit" button is black when the fit did not 145 converge or the number of terms has been changed. "Improve Fit" causes the 146 fit to be refined starting from the previous values. 147 <LI>Editing the Chebyschev terms is possible. The curve is reevaluated as 148 changes are made. 149 <LI>Once a good background function is determined, it can be saved in the 150 experiment file by pressing the "Save in EXP file & Exit" button. This will 151 set the background type to 1, and save the Chebyschev terms. 152 It will also turn off 153 the background refinement flag for the appropriate histogram so that the 154 terms are not refined inadvertently. 155 </OL> 156 157 <P> 158 Note that POWPREF must be run at least once before BKGEDIT can be used, 159 however, use of 160 GENLES before BKGEDIT is optional. If the data range is changed, for example 161 by excluding a section of the data at the lower end, or changing tmax (dmin), 162 the Chebyschev polynomial terms must change to generate the same 163 background values, so both POWPREF and BKGEDIT should be rerun to 164 regenerate the Chebyschev terms. 165 166 <H4>Why not use fixed background points?</H4> 167 I personally feel that 168 a refined background function is preferrable to use of a fixed model, 169 if at all possible. 170 One reason for this is that Rietveld refinements usually achieve better fits 171 when the background is optimized. A second reason refining the background 172 provides a 173 feel for the interaction between background values and displacement 174 (thermal) parameters. 175 Usually, background and displacement parameters are fairly independent, but 176 for some materials, where the high Q (high 2theta) portion of the pattern 177 has many completely overlapped peaks, it is impossible to uniquely 178 determine where the 179 background should be placed, either by refinement or by manual placement. 180 Under these circumstances, the background should be refined with the 181 displacement parameters fixed at an appropriate value for the material. The 182 background should then be fixed for all future refinements 183 and the displacement parameters can then be refined. <I>Of course this 184 means you have predjudiced the refinement to result in the expected 185 average displacement parameter and this </I><B>must</B><I> be noted 186 any publication. However, if this is necessary, the data simply do not 187 contain sufficient information to independently determine 188 background and displacement parameters. Use of fixed background points 189 would not demonstrate this and would lead the researcher to a false 190 sense of security (or fear, if the values are unreasonable) 191 that the displacement parameters actually mean something.</I> 192 <P> 193 If you still want to use fixed background points, despite this tirade, 194 be sure to set the estimated 195 error on those points to be 0.0. Use of non-zero estimated errors, can 196 result in artificially lowered R-factors and chi-squared values. 197 In one test, I was able to lower the R<sub>wp</sub> and 198 reduced chi<sup>2</sup> values, 199 from the correct values of 0.042 and 3.0, respectively, to misleading 200 values of 0.036 and 0.8, 201 respectively. [As expected, the R(F<sup>2</sup>) stayed constant at 0.045; 202 FYI, refining the background caused R(F<sup>2</sup>) to drop to 0.036.] 203 <P> 204 If the background is so truly irregular that only use of fixed background 205 points will do, 206 BKGEDIT can be used to generate these fixed background points. 207 The file used by BKGEDIT to save these points, 208 <I>EXPNAM</I><tt>.bkg</tt><I>N</I>, 209 can be read into EXPEDT by typing "@R" at the initial prompt 210 in EXPEDT: 211 <PRE> 212 Is this the file you wish to use? (<?>,D,K,Q,R,Y) ><u>@r</u> 213 </PRE> 214 prompt and then supplying the name of the file, in response to the next prompt: 215 <PRE> 216 Enter the name of your macro file: <u>GARNET.bkg1</u> 217 </PRE> 218 And this will enter the background points entered into BKGEDIT as GSAS 219 fixed background points. If you do this you do not want to fit and enter 220 Note that you are allowed to use both fixed and a refined background together, 221 though this is seldom done. 222 223 <hr><h2>LIVEPLOT/BKGEDIT Features</h2> 224 <a name="zoom"></a> 225 <B>Plot zooming</B> 226 When the left (usual) mouse button is pressed, this defines one corner 227 of a region to be magnified, as is shown to the right. 228 If the mouse is then moved, the diagonal 229 corner of this magnification region is defined. When the left mouse button 230 is pressed a second time, the selected section of the plot is magnified to 231 fill the entire plot. 232 <P> 233 Zoom settings are saved. 234 If the right mouse button is pressed, the previous zoom setting is used, 235 so that the left mouse button is used to "zoom in" and the right mouse 236 button is used to "zoom out." 237 238 <P> 239 <h2>Features in LIVEPLOT only</h2> 240 <img SRC="lz.gif" BORDER=3 align=RIGHT alt="EXPGUI Screen snapshot"> 241 <B>The cumulative chi<sup>2</sup></B> 242 function was first suggested by 243 Bill David as a way to see which reflections have the greatest influence on 244 chi<sup>2</sup> [W.I.F. David, <I>Accuracy in Powder Diffraction-III</I>, 2001]. 245 It is defined for point j as 246 <IMG SRC="cchi2.gif" alt="equation for cumulative chi2 function" ALIGN=TOP> 247 where y<sub>obs,i</sub> and y<sub>calc,i</sub> are the observed and computed 248 data points and sigma<sub>i</sub> is the expected error. Thus, the statistically 249 expected value for 250 [(y<sub>obs,i</sub>-y<sub>calc,i</sub>)/sigma<sub>i</sub>]<sup>2</sup> is 1 251 and this function should rise in a smooth line if all points are fitted as 252 statistically expected. 253 <P> 254 In the plot to the right, the cumulative chi<sup>2</sup> function is shown in 255 purple. Note that first peak is not well fit, but the low angle "shoulder" is 256 as important as the peak misfitting, with respect to the chi<sup>2</sup>. 257 <br clear=all> 258 <P> 259 <img SRC="lind.gif" BORDER=3 align=RIGHT alt="EXPGUI Screen snapshot"> 260 <B>Reflection indices</B> 261 are be displayed by pressing "H" or "h" while the 262 mouse is near a reflection (holding the shift key while 263 pressing the left mouse button also works). The indices are shown 264 on the screen for phases with tick marks (as shown to the right). 265 Indices are listed in the "Separate window for <I>hkl</I> labels" 266 (as seen below) for all phases, regardless of the tickmark settings. 267 Displayed indices will remain on the screen for a preset time and 268 then will be deleted, unless the labeling options are changed. 269 <img SRC="lind1.gif" align=LEFT alt="EXPGUI Screen snapshot"> 270 <P> 271 <br clear=all> 272 273 <hr><h2>LIVEPLOT/BKGEDIT Menu Contents</h2> 274 A few of these options are omitted from BKGEDIT. 275 <DL><DL> 276 <img SRC="lm1.gif" align=RIGHT alt="EXPGUI Screen snapshot"> 64 277 <H3>File Menu</H3> 65 278 <DT>Tickmarks … … 77 290 <DT>Quit 78 291 </DL></DL> 79 <DL><DL> 292 <br clear=all> 293 <DL><DL> 294 <img SRC="lm2.gif" align=RIGHT alt="EXPGUI Screen snapshot"> 80 295 <H3>File Menu</H3> 81 296 <DT>Configure Tickmarks … … 119 334 <DD>Causes many of the options set in this menu to be saved in the <TT>.gsas_config</TT> file. 120 335 </DL></DL> 121 122 <P> 123 <hr><h2>LIVEPLOT Features</h2> 124 <B>Plot zooming</B> 125 When the left (usual) mouse button is pressed, this defines one corner 126 of a region to be magnified. If the mouse is then moved, the diagonal 127 corner of this magnification region is defined. When the left mouse button 128 is pressed a second time, the selected section of the plot is magnified to 129 fill the entire plot. 130 <P> 131 Zoom settings are saved. 132 If the right mouse button is pressed, the previous zoom setting is used, 133 so that the left mouse button is used to "zoom in" and the right mouse 134 button is used to "zoom out." 135 136 <P> 137 <B>Reflection indices</B> 138 are be displayed by pressing "H" or "h" while the 139 mouse is near a reflection (holding the shift key while 140 pressing the left mouse button also works). 141 <P> 142 <B>The cumulative chi<sup>2</sup></B> 143 function was first suggested by 144 Bill (W.I.F.) David [Accuracy in Powder Diffraction-III, 2001] 145 as a way to see which reflections have the greatest influence on 146 chi<sup>2</sup>. It is defined for point j as 147 <IMG SRC="cchi2.gif" alt="equation for cumulative chi2 function" ALIGN=TOP>. 148 149 150 <hr><H2>Customization of LIVEPLOT</H2><A NAME="customize"></A> 336 <br clear=all> 337 338 <P> 339 <hr><H2>Customization of LIVEPLOT & BKGEDIT</H2><A NAME="customize"></A> 151 340 The <TT>localconfig</TT> and <TT>.gsas_config</TT> files are read, if present. 341 The following variables control how LIVEPLOT, and in most cases BKGEDIT, 342 function and can be 343 customized by changing their values in the 344 <TT>localconfig</TT> and <TT>.gsas_config</TT> files. 152 345 Note that some of these options are relevant only if the tcldump program is 153 present. 154 <P> 155 The following variables control how LIVEPLOT functions and can be 156 customized by changing their values in the 157 <TT>localconfig</TT> and <TT>.gsas_config</TT> files: 346 present. 158 347 <DL><DL> 159 348 <DT><TT>peakinfo(flag<i>n</i>)</TT><DD> … … 196 385 197 386 <DT><TT>graph(legend)</TT><DD> 198 Sets the default value for display of the legend in liveplotand widplt.387 Sets the default value for display of the legend in LIVEPLOT and widplt. 199 388 200 389 <DT><TT>graph(autoraise)</TT><DD> 201 390 This option shows up in the options menu item as "Raise on update." 202 When set to non-zero, the liveplotwindow is raised391 When set to non-zero, the LIVEPLOT window is raised 203 392 (placed on top of any other overlapping) windows 204 393 each time it is updated. … … 257 446 (see the CMPR installation instructions.)</A> 258 447 <UL><LI> 259 For UNIX, create a link from in the expgui448 For UNIX, create a link from in the EXPGUI 260 449 directory to file cellgen.tcl in the CMPR directory. For example: 261 450 <PRE> … … 263 452 </PRE> 264 453 <LI>For Windows, copy all the .tcl and .exe files from the CMPR directory 265 into the expguidirectory.454 into the EXPGUI directory. 266 455 </UL> 267 456 <P> … … 282 471 ln -s /usr/local/powdersuite/icddcmd.tcl /usr/local/gsas/expgui/icddcmd.tcl 283 472 </PRE> 284 <LI>For Windows, copy all the LOGIC files into the expguidirectory.473 <LI>For Windows, copy all the LOGIC files into the EXPGUI directory. 285 474 </UL> 286 475 <hr>
Note: See TracChangeset
for help on using the changeset viewer.