Changeset 1225


Ignore:
Timestamp:
11/08/2012 01:42:25 PM (4 months ago)
Author:
toby
Message:

update to latest, with Fourier & f'/f

Location:
trunk
Files:
24 edited

Legend:

Unmodified
Added
Removed
  • trunk/anomal.tcl

    r1219 r1225  
    1515     set ::anom_wave [histinfo $histlbl lam1] 
    1616     foreach test $::expmap(powderlist) { 
    17              puts "[histinfo $test lam1] versus $::anom_wave" 
     17             #puts "[histinfo $test lam1] versus $::anom_wave" 
    1818             if {[histinfo $test lam1] == $::anom_wave} { 
    1919                lappend ::anom_list $test 
     
    4242             set ::anom_fp($::anom_atomcount) [lindex $temp 1] 
    4343             set ::anom_f2p($::anom_atomcount) [lindex $temp 2] 
    44              puts "$::anom_lbl($::anom_atomcount) $::anom_fp($::anom_atomcount) $::anom_f2p($::anom_atomcount)" 
     44             #puts "$::anom_lbl($::anom_atomcount) $::anom_fp($::anom_atomcount) $::anom_f2p($::anom_atomcount)" 
    4545     } 
    4646} 
     
    5656 
    5757     grid [frame $anomal.list -bd 2 -relief groove] -row 0 -column 0 -sticky news 
    58      grid [label $anomal.list.lbl1 -text "The anomalous dispersion terms will be set for the following histograms\n with wavelength $::anom_wave angstroms:"] -row 0 -column 0 
     58     grid [label $anomal.list.lbl1 -text "The anomalous dispersion terms will be set for x-ray histograms\n with wavelength $::anom_wave angstroms:"] -row 0 -column 0 
    5959     grid [label $anomal.list.lbl1a -text "$::anom_list"] -row 1 -column 0 
    6060 
    6161     grid [frame $anomal.con -bd 2 -relief groove] -row 5  -column 0 -sticky news 
    6262     grid [button $anomal.con.save  -width 8 -text "Save"  -command {anomalous_save}] -column 0 -row 4 -padx 3 
    63      grid [button $anomal.con.abort -width 8 -text "abort" -command {anomalous_abort}] -column 1 -row 4 -padx 3 
     63     grid [button $anomal.con.abort -width 8 -text "Cancel" -command {anomalous_abort}] -column 1 -row 4 -padx 3 
    6464 
    6565     grid [frame $anomal.warning -bd 2 -relief groove] -row 7 -column 0 -sticky news 
     
    8686proc anomalous_save {args} { 
    8787     set histnum $::expgui(curhist) 
    88      puts $histnum 
     88     #puts $histnum 
    8989     set histlbl [lindex $::expmap(powderlist) $histnum] 
    90      puts $histlbl 
     90     #puts $histlbl 
    9191     set x "" 
    9292     set atomcount 0 
     
    9595             lappend x "$::anom_lbl($atomcount) $::anom_fp($atomcount) $::anom_f2p($atomcount)" 
    9696     } 
    97      puts $x 
     97     #puts $x 
    9898     foreach test $::anom_list { 
    9999          histinfo $test anomff set $x 
  • trunk/chemrest.tcl

    r1219 r1225  
    293293# show a box as yellow, if an invalid number is entered 
    294294proc ChemUpdateRow {var index mode} { 
     295    if $::expcons(DisableChemWeightsTrace) return 
    295296    set num $index 
    296     if $::expcons(DisableChemWeightsTrace) return 
    297297    set weight [string trim $::ChemWeights($num)] 
    298298    set box $::expcons(ChemConstBox) 
     
    363363} 
    364364 
    365 foreach item [trace vinfo ChemWeights] { 
    366     eval trace vdelete ChemWeights $item 
    367 } 
    368 trace variable ChemWeights w ChemUpdateRow  
    369  
     365set ::ChemWeights(0) "" 
     366foreach item [trace vinfo ::ChemWeights] { 
     367    eval trace vdelete ::ChemWeights $item 
     368} 
     369trace variable ::ChemWeights w ChemUpdateRow  
     370 
     371set ::expcons(ChemSum) "" 
     372set ::expcons(ChemSumESD) "" 
    370373foreach item [trace vinfo expcons(ChemSum)] { 
    371374    eval trace vdelete expcons(ChemSum) $item 
  • trunk/doc/expgui.html

    r1218 r1225  
    1616EXPGUI<BR> 
    1717A Graphical User Interface for  
    18 <A Href="https://subversion.xor.aps.anl.gov/trac/EXPGUI/wiki/GSASIntro"> 
     18<A Href="https://subversion.xray.aps.anl.gov/trac/EXPGUI/wiki/GSASIntro"> 
    1919GSAS</A> 
    2020<HR noshade width="75%" size="2" align="center"> 
     
    2424<blockquote> 
    2525For the impatient, see download/installation instructions for: 
    26 <A HREF="https://subversion.xor.aps.anl.gov/trac/EXPGUI/wiki/InstallWindows"> 
     26<A HREF="https://subversion.xray.aps.anl.gov/trac/EXPGUI/wiki/InstallWindows"> 
    2727Windows</A>, 
    28 <A HREF="https://subversion.xor.aps.anl.gov/trac/EXPGUI/wiki/InstallOSX"> 
     28<A HREF="https://subversion.xray.aps.anl.gov/trac/EXPGUI/wiki/InstallOSX"> 
    2929Mac (OS X)</A>, or  
    30 <A HREF="https://subversion.xor.aps.anl.gov/trac/EXPGUI/wiki/InstallLinux"> 
     30<A HREF="https://subversion.xray.aps.anl.gov/trac/EXPGUI/wiki/InstallLinux"> 
    3131Linux</A> 
    3232</blockquote> 
     
    3434<P><P> 
    3535EXPGUI is a graphical interface for the  
    36 <A Href="https://subversion.xor.aps.anl.gov/trac/EXPGUI/wiki/GSASIntro">GSAS</A> 
     36<A Href="https://subversion.xray.aps.anl.gov/trac/EXPGUI/wiki/GSASIntro">GSAS</A> 
    3737package, developed at Los Alamos and maintained now at Argonne.  
    3838EXPGUI does two things:  
     
    9696<TH>&nbsp;</TH> 
    9797</TR> 
    98 <TR><TH BGCOLOR="#F0F0F0">Tutorials:</TH> 
    99 <TH><A Href="https://subversion.xor.aps.anl.gov/EXPGUI/tutorials/tutorial3/index.html"> 
     98<TR><TH BGCOLOR="#F0F0F0" rowspan=2>Tutorials:</TH> 
     99<TH><A Href="https://subversion.xray.aps.anl.gov/EXPGUI/tutorials/tutorial3/index.html"> 
    100100NIST<BR>Neutron data</A></TH> 
    101 <TH><A Href="https://subversion.xor.aps.anl.gov/EXPGUI/tutorials/tutorial1/index.html">GSAS Manual<BR>Example #1 (TOF)</A></TH> 
    102 <TH><A Href="https://subversion.xor.aps.anl.gov/EXPGUI/tutorials/tutorial2/index.html">GSAS Manual<BR>Example #2 (Garnet)</A></TH> 
     101<TH><A Href="https://subversion.xray.aps.anl.gov/EXPGUI/tutorials/tutorial1/index.html">GSAS Manual<BR>Example #1 (TOF)</A></TH> 
     102<TH><A Href="https://subversion.xray.aps.anl.gov/EXPGUI/tutorials/tutorial2/index.html">GSAS Manual<BR>Example #2 (Garnet)</A></TH> 
     103</TR> 
     104<TR> 
     105<TH><A Href="https://subversion.xray.aps.anl.gov/EXPGUI/tutorials/tutorial4/FapatitleExample.htm"> 
     106Lab x-ray data<BR>(Fluoroapatite)</A></TH> 
     107<TH>&nbsp;</TH> 
     108<TH>&nbsp;</TH> 
    103109</TR> 
    104110<TR><TH BGCOLOR="#F0F0F0">Messages:</TH> 
     
    122128Los Alamos National Laboratory Report LAUR 86-748 (2000). 
    123129<A 
    124   HREF="https://subversion.xor.aps.anl.gov/EXPGUI/gsas/all/GSAS%20Manual.pdf"> 
     130  HREF="https://subversion.xray.aps.anl.gov/EXPGUI/gsas/all/GSAS%20Manual.pdf"> 
    125131[link to PDF copy of manual] 
    126132</A> 
     
    782788code and to John Cowgill for the "Export to GRACE" code. 
    783789<P> 
    784 <A Href="https://subversion.xor.aps.anl.gov/trac/EXPGUI/wiki/GSASIntro"> 
     790<A Href="https://subversion.xray.aps.anl.gov/trac/EXPGUI/wiki/GSASIntro"> 
    785791GSAS</A> 
    786792is written by Allen C. Larson and Robert B. Von Dreele while at  
  • trunk/doc/expgui3.html

    r1166 r1225  
    3333<h3>A.3 Powder panel</h3>  
    3434<DL><DL> 
    35 The Powder (was histogram) panel is used to edit background 
     35The Powder panel (previously called the Histogram panel) is used to edit background 
    3636and diffractometer constants for powder histogram(s), as well as  
    3737set damping and refinement flags for these parameters. 
     
    280280<img SRC="3a.gif" align=TEXTTOP alt="EXPGUI Screen snapshot"> 
    281281<blockquote> 
    282 <br clear=all> 
     282 
     283<h3>A.3.8 Setting Resonant Scattering (Anomolous Dispersion) terms</h3>  
     284<DL><DL> 
     285<IMG SRC="new.gif" HEIGHT=13 WIDTH=36 alt="New!"> 
     286The button on the lower left of the Powder Panel, labeled "Edit 
     287  (Delta) f' and f''" is used to enter the anomolous dispersion 
     288  terms for x-rays. 
     289  These terms are automatically defined for elements near 
     290  standard x-ray tube wavelengths (Cu Kalpha, etc), but need to be 
     291  entered for synchrotron datasets when significant. 
     292<P> 
     293  They can be estimated from <A HREF="http://it.iucr.org/C/"> 
     294  Volume C of the International Tables</A>. Alternately, 
     295  a Python program, 
     296  <A HREF="https://subversion.xray.aps.anl.gov/trac/pyFprime/"> 
     297  pyFPRIME</A>, for estimating 
     298  these terms at arbitrary wavelengths can be run with a <A 
     299  href="http://11bm.xray.aps.anl.gov/absorb/absorb.php">web 
     300  interface</A> or can be downloaded and installed. 
     301<img SRC="3g1.png" align=TEXTTOP alt="EXPGUI Screen snapshot"> 
     302</DL></DL> 
     303 
    283304<hr> 
    284305<TABLE BORDER BGCOLOR="#FFFF40" ALIGN=RIGHT> 
  • trunk/doc/expgui6.html

    r1218 r1225  
    4646by grouping parameters so that a single shift (possibly scaled) is  
    4747applied to each parameter in the group. 
    48 At this time the only constraints that can be set in EXPGUI are on atomic 
    49 and profile profile (others can be set in EXPEDT). 
    50   EXPEDT offers many 
    51   other types of restraints as well. 
    52 <P> 
    53 Note that these constraints are only applied to shifts, but not to the 
     48At this time the only constraints that can be set in EXPGUI are on 
     49<a href="#AtomConstraints"><B>Atom Constraints</B></A> for normal phases, 
     50<a href="#MMConstraints"><B>Macromolecular Atom Constraints</B></A> 
     51  when a macromolecular phase is present, or 
     52<a href="#ProfileConstraints"><B>Peak Profile Constraints</B></A>. 
     53GSAS offers many other types of restraints, but these must be 
     54  accessed in EXPEDT. 
     55<P> 
     56Note that in GSAS these constraints are only applied to shifts, but not to the 
    5457actual values. This means that, for example,  
    5558if two atoms  
     
    7073</DL></DL> 
    7174<a name="AtomConstraints"></a> 
    72 <H4>Atom Constraints</H4> 
     75<H4>A.6.1 Atom Constraints</H4> 
    7376<DL><DL> 
    7477The atom constraints editing panel appears below. Note that constraints can  
     
    141144 
    142145<a name="MMConstraints"></a> 
    143 <H4>Macromolecular Constraints</H4> 
     146<H4>A.6.2 Macromolecular Constraints</H4> 
    144147<DL><DL> 
    145148Constraints for a macromolecular phase can be entered on a  
     
    154157 
    155158<a name="ProfileConstraints"></a> 
    156 <H4>Profile Constraints</H4> 
     159<H4>A.6.3 Profile Constraints</H4> 
    157160<DL><DL> 
    158161The profile constraints editing panel appears below. Profile constraints 
  • trunk/doc/expgui6R.html

    r1218 r1225  
    6060applied to each parameter in the group. 
    6161<P> 
    62   The Restraints panel at present can be used to set up restraints on 
    63 interatomic distances and atomic composition.  EXPEDT offers many 
    64   other types of restraints as well. 
     62  The Restraints panel can be used to set up restraints on 
     63  <a href="#DistanceRestraints"><B>Interatomic Distances</B></A> and 
     64  on <a href="#Chemical Restraints"><B>Atomic Composition</B></A>. Note 
     65  that the atomic composition constraints can be used to establish 
     66  quite complex constraints that account for charge balance or even 
     67  segregation of elements between phases. GSAS offers many other types 
     68  of restraints, but EXPEDT must be used to access them. 
    6569</DL></DL> 
    6670 
    6771<a name="DistanceRestraints"></a> 
    68 <H4>Distance Restraints</H4> 
     72<H4>A.7.1 Distance Restraints</H4> 
    6973<DL><DL> 
    7074 When the distance restraints tab is first selected, the active 
     
    130134</DL></DL> 
    131135<a name="Chemical Restraints"></a> 
    132 <H4>Chemical (or Compositional) Restraints</H4> 
     136<H4>A.7.2 Chemical (or Compositional) Restraints</H4> 
    133137<DL><DL> 
    134138  Chemical constraints allow a model to be penalized if it moves away 
  • trunk/doc/expgui_Unix_readme.html

    r973 r1225  
    2929<B>Please note:</B> 
    3030A new mechanism for installing GSAS & EXPGUI is now recommended. See 
    31 <A HREF="https://subversion.xor.aps.anl.gov/trac/EXPGUI/wiki/InstallLinux"> 
     31<A HREF="https://subversion.xray.aps.anl.gov/trac/EXPGUI/wiki/InstallLinux"> 
    3232this link</a>. If this method is used, EXPGUI or a python script can 
    3333be used to update GSAS & EXPGUI quickly and easily. The information 
  • trunk/doc/expgui_Win_readme.html

    r973 r1225  
    3636<B>Please note:</B> 
    3737A new mechanism for installing GSAS & EXPGUI is now recommended. See 
    38 <A HREF="https://subversion.xor.aps.anl.gov/trac/EXPGUI/wiki/InstallWindows"> 
     38<A HREF="https://subversion.xray.aps.anl.gov/trac/EXPGUI/wiki/InstallWindows"> 
    3939this link</a>. If this method is used, EXPGUI or a batch file can 
    4040be used to update GSAS & EXPGUI quickly and easily. 
     
    5757<a href="http://www.ncnr.nist.gov/xtal/software/gsas.html">GSAS (General Structure Analysis System)</a> 
    5858and  
    59 <a href="https://subversion.xor.aps.anl.gov/EXPGUI/trunk/doc/expgui.html">EXPGUI</a> 
     59<a href="https://subversion.xray.aps.anl.gov/EXPGUI/trunk/doc/expgui.html">EXPGUI</a> 
    6060will do so by downloading a single file that installs the GSAS programs,  
    6161the Tcl/Tk package (with some extensions), the EXPGUI scripts, as well as 
     
    9393gsas+expgui.exe 
    9494from  
    95 <a href="http://11bm.xor.aps.anl.gov/downloads/gsas/windows/">Argonne</a> 
    96 (http://11bm.xor.aps.anl.gov/downloads/gsas/windows/) 
     95<a href="http://11bm.xray.aps.anl.gov/downloads/gsas/windows/">Argonne</a> 
     96(http://11bm.xray.aps.anl.gov/downloads/gsas/windows/) 
    9797or  
    9898<a href="http://www.ccp14.ac.uk/ccp/ccp14/ftp-mirror/gsas/public/gsas/windows/"> 
     
    162162a lot of testing) 
    163163is found as a .tar or .zip file in  
    164 <A HREF="http://11bm.xor.aps.anl.gov/downloads/gsas/"> 
    165   http://11bm.xor.aps.anl.gov/downloads/gsas/</A>. 
     164<A HREF="http://11bm.xray.aps.anl.gov/downloads/gsas/"> 
     165  http://11bm.xray.aps.anl.gov/downloads/gsas/</A>. 
    166166On the newest versions of Windows, support for .zip files is built in, but 
    167167for older versions, you will need an unzip program, such as WinZip or pkZip. 
     
    176176is distributed as 
    177177<DL> 
    178 <A HREF="http://11bm.xor.aps.anl.gov/downloads/gsas/"> 
    179   http://11bm.xor.aps.anl.gov/downloads/gsas/</A>. 
     178<A HREF="http://11bm.xray.aps.anl.gov/downloads/gsas/"> 
     179  http://11bm.xray.aps.anl.gov/downloads/gsas/</A>. 
    180180</DL><P> 
    181181 and unpack it to subdirectory <tt>...\gsas\expgui\</tt>. 
  • trunk/doc/expgui_intro.html

    r1166 r1225  
    7070Customization notes</A> 
    7171<LI> 
    72 <A HREF="https://subversion.xor.aps.anl.gov/EXPGUI/tutorials/tutorial3/index.html"> 
     72<A HREF="https://subversion.xray.aps.anl.gov/EXPGUI/tutorials/tutorial3/index.html"> 
    7373A well-annotated CW neutron tutorial (Alumina).</A> 
    7474<B><I>A very good place to start!</I></B> 
    7575<LI> 
    76 <A HREF="https://subversion.xor.aps.anl.gov/EXPGUI/tutorials/tutorial1/index.html"> 
     76<A HREF="https://subversion.xray.aps.anl.gov/EXPGUI/tutorials/tutorial4/FapatitleExample.htm"> 
     77A well-annotated Lab data tutorial (Fluoroapatite).</A> 
     78<B><I>Also a good place to start!</I></B> 
     79<LI> 
     80<A HREF="https://subversion.xray.aps.anl.gov/EXPGUI/tutorials/tutorial1/index.html"> 
    7781A TOF Tutorial Example (Nickel)</A> 
    7882<LI> 
    79 <A HREF="https://subversion.xor.aps.anl.gov/EXPGUI/tutorials/tutorial2/index.html"> 
     83<A HREF="https://subversion.xray.aps.anl.gov/EXPGUI/tutorials/tutorial2/index.html"> 
    8084A CW Neutron Tutorial Example (Garnet)</A> 
    8185</UL> 
  • trunk/doc/expguic.html

    r1166 r1225  
    273273programs used for graphical display of data and results. 
    274274<DL> 
     275<DT>Fourier<DD>Provides an interface to set up computation of 
     276  Fourier maps and compute them using program Fourier. 
     277  Also see the <A HREF="#DRAWxtl">Export to DRAWxtl</A> interface, 
     278  which can be used to set up, compute, export and display Fourier 
     279  maps. Note that a Fourier map can be set up for only one phase 
     280  at a time.  
     281<DT>forsrh<DD>Search Fourier map for peaks 
    275282<DT>forplot<DD>Display Fourier maps (set Fourier options in EXPEDT  
    276283        and then compute with FOURIER 
     
    279286<DT>ortep<DD>Draw crystal structure 
    280287<DT>rawplot<DD>Plot powder data 
    281 <DT>fourier<DD>Generate Fourier map 
    282 <DT>forsrh<DD>Search Fourier map for peaks 
    283288<DT>gsas2map<DD>Exports a Fourier map in formats used by other 
    284289  programs (for example Fox and DRAWxtl). 
     
    421426program, CIF can be a useful exchange format. This routine provides a 
    422427CIF with the current coordinates from one phase and not much else. 
    423 <DT>export to DRAWxtl<DD>This writes a .STR file used in the DRAWxtl 
    424 program and optionally launches DRAWxtl.  
     428<a name="DRAWxtl"></a> 
     429<DT>export to DRAWxtl<DD> 
     430  <A HREF="http://www.lwfinger.net/drawxtl/">DRAWxtl</A> 
     431  is a very useful free program for display of structures and 
     432maps. This writes a .STR input file used in the DRAWxtl 
     433program and optionally launches DRAWxtl, if installed. 
     434While the control options offered by EXPGUI are relatively 
     435modest (display of polyhedra, 
     436selection for bonds to be drawn, display of Fourier contours),  
     437once the DRAWxtl program is launched, the full range of DRAWxtl 
     438options can be accessed from that program's GUI. When a Fourier map 
     439contour is included, the Fourier parameters are set, the map is 
     440computed (program fourier) and is converted to the format needed by 
     441DRAWxtl (program gsas2map) automatically.  
    425442<DT>export to SHELX<DD>This writes coordinates for a selected phase in 
    426443the .INS format used by SHELX and several other programs. 
  • trunk/doc/gsas+expgui.html

    r973 r1225  
    2121<B>Please note:</B> 
    2222A new mechanism for installing GSAS & EXPGUI is now recommended. See 
    23 <A HREF="https://subversion.xor.aps.anl.gov/trac/EXPGUI/wiki/InstallWindows"> 
     23<A HREF="https://subversion.xray.aps.anl.gov/trac/EXPGUI/wiki/InstallWindows"> 
    2424this link</a>. If this method is used, EXPGUI or a batch file can 
    2525be used to update GSAS & EXPGUI quickly and easily. 
     
    3333<a href="http://www.ncnr.nist.gov/xtal/software/gsas.html">GSAS (General Structure Analysis System)</a> 
    3434and  
    35 <a href="https://subversion.xor.aps.anl.gov/EXPGUI/trunk/doc/expgui.html">EXPGUI</a> 
     35<a href="https://subversion.xray.aps.anl.gov/EXPGUI/trunk/doc/expgui.html">EXPGUI</a> 
    3636is available. This program uncompresses itself, copies the required files 
    3737(including the Tcl/Tk files used in EXPGUI) 
     
    4242<P> 
    4343The self-installer can be downloaded as file gsas+expgui.exe from  
    44 <a href="http://11bm.xor.aps.anl.gov/downloads/gsas/windows/">Argonne</a> 
    45 (http://11bm.xor.aps.anl.gov/downloads/gsas/windows/) 
     44<a href="http://11bm.xray.aps.anl.gov/downloads/gsas/windows/">Argonne</a> 
     45(http://11bm.xray.aps.anl.gov/downloads/gsas/windows/) 
    4646or  
    4747<a href="http://www.ccp14.ac.uk/ccp/ccp14/ftp-mirror/gsas/public/gsas/windows/"> 
  • trunk/doc/gsas2cif.html

    r1166 r1225  
    3333<BR> 
    3434to export 
    35 <A Href="https://subversion.xor.aps.anl.gov/trac/EXPGUI/wiki/GSASIntro">GSAS</A> 
     35<A Href="https://subversion.xray.aps.anl.gov/trac/EXPGUI/wiki/GSASIntro">GSAS</A> 
    3636results 
    3737<HR noshade width="75%" size="2" align="center"> 
  • trunk/doc/liveplot.html

    r1181 r1225  
    455455can be done in Windows by following these  
    456456<A 
    457 HREF="https://subversion.xor.aps.anl.gov/trac/EXPGUI/wiki/InstallWindows#shortcut">instructions 
     457HREF="https://subversion.xray.aps.anl.gov/trac/EXPGUI/wiki/InstallWindows#shortcut">instructions 
    458458to make a short cut</A>, but reference file <tt>.../expgui/liveplot</tt> 
    459459rather than file <tt>.../expgui/expgui</tt>. Similar things can be 
     
    755755<B>Combining LIVEPLOT with CMPR & LOGIC</B> 
    756756If you have the  
    757 <A HREF="https://subversion.xor.aps.anl.gov/trac/CMPR">CMPR</A> 
     757<A HREF="https://subversion.xray.aps.anl.gov/trac/CMPR">CMPR</A> 
    758758program installed on your computer, you can use superimpose on the  
    759759GSAS results the peaks for an arbitrary unit cell. 
     
    787787software is located. The 
    788788"Display a cell" option produces a window similar to the 
    789 <A href="https://subversion.xor.aps.anl.gov/CMPR/trunk/doc/cmprdoc.html#editcell"> 
     789<A href="https://subversion.xray.aps.anl.gov/CMPR/trunk/doc/cmprdoc.html#editcell"> 
    790790Edit Cell feature in CMPR</A> 
    791791where allowed reflection positions are displayed for a set of unit cell  
  • trunk/doc/osx.html

    r973 r1225  
    2727  <B>Please note:</B> 
    2828A new mechanism for installing GSAS & EXPGUI is now recommended. See 
    29 <A HREF="https://subversion.xor.aps.anl.gov/trac/EXPGUI/wiki/InstallOSX"> 
     29<A HREF="https://subversion.xray.aps.anl.gov/trac/EXPGUI/wiki/InstallOSX"> 
    3030this link</a>. If this method is used, EXPGUI or a python script can 
    3131be used to update GSAS & EXPGUI quickly and easily. 
     
    8484for the CPU type of your computer (to find out what you have  
    8585click on the "About This Mac" item in the Apple menu) from  
    86 <a href="http://11bm.xor.aps.anl.gov/downloads/gsas/macOSX/"> 
    87   http://11bm.xor.aps.anl.gov/downloads/gsas/macOSX/</A> 
     86<a href="http://11bm.xray.aps.anl.gov/downloads/gsas/macOSX/"> 
     87  http://11bm.xray.aps.anl.gov/downloads/gsas/macOSX/</A> 
    8888<P> 
    8989<DL><UL> 
  • trunk/doc/revlog.html

    r1166 r1225  
    3333    <P> 
    3434    This page has been superceeded by the Trac registry, see 
    35     <A HREF="https://subversion.xor.aps.anl.gov/trac/EXPGUI/timeline"> 
    36     https://subversion.xor.aps.anl.gov/trac/EXPGUI/timeline</A>. 
     35    <A HREF="https://subversion.xray.aps.anl.gov/trac/EXPGUI/timeline"> 
     36    https://subversion.xray.aps.anl.gov/trac/EXPGUI/timeline</A>. 
    3737    <HR><HR> 
    3838    Below is information on older revisions logged for changes to the EXPGUI source 
    3939    files, sorted by date.  
    4040    See the 
    41     <A HREF="https://subversion.xor.aps.anl.gov/trac/EXPGUI/report"> 
     41    <A HREF="https://subversion.xray.aps.anl.gov/trac/EXPGUI/report"> 
    4242    View Tickets</A> section of the Trac site for active and closed 
    4343    projects. There is some older information on the  
  • trunk/doc/win_old_notes.html

    r1166 r1225  
    11<HTML> 
    22<HEAD> 
    3    <TITLE>Windows Installation Notes for EXPGUI</TITLE> 
     3   <TITLE>OLD Windows Installation Notes for EXPGUI</TITLE> 
    44   <meta name="keywords" content="crystallography, Rietveld, diffraction, 
    55   GSAS, EXPGUI, Windows"> 
     
    2626<CENTER><H1> 
    2727<HR noshade width="75%" size="2" align="center"> 
    28 Windows installation notes for  
     28Old, out of date, Windows installation notes for  
    2929<A HREF="expgui.html">EXPGUI</A> 
    3030<HR noshade width="75%" size="2" align="center"> 
     
    5757<P> 
    5858<LI>Get  
    59 <A Href="https://subversion.xor.aps.anl.gov/trac/EXPGUI/wiki/GSASIntro">GSAS</A> 
     59<A Href="https://subversion.xray.aps.anl.gov/trac/EXPGUI/wiki/GSASIntro">GSAS</A> 
    6060from one of the following sites: 
    6161<DL><P> 
  • trunk/doc/wishlist.html

    r1166 r1225  
    3434Information on desired (and completed) development tasks for EXPGUI 
    3535are now captured as "Tickets" in the 
    36     <A HREF="https://subversion.xor.aps.anl.gov/trac/EXPGUI/"> 
     36    <A HREF="https://subversion.xray.aps.anl.gov/trac/EXPGUI/"> 
    3737EXPGUI Trac system</A>. In particular, see the 
    38     <A HREF="https://subversion.xor.aps.anl.gov/trac/EXPGUI/timeline"> 
     38    <A HREF="https://subversion.xray.aps.anl.gov/trac/EXPGUI/timeline"> 
    3939    timeline of changes</A> and the  
    40    <A HREF="https://subversion.xor.aps.anl.gov/trac/EXPGUI/report"> 
     40   <A HREF="https://subversion.xray.aps.anl.gov/trac/EXPGUI/report"> 
    4141    reports on Tickets</A>. Any other information on this page is no 
    4242longer being updated -- though there are still some good ideas for 
  • trunk/expgui

    r1219 r1225  
    7070set expgui(HistSelectList) {} 
    7171# location for web pages, if not found locally 
    72 set expgui(website) 11bm.xor.aps.anl.gov/expguidoc/ 
     72set expgui(website) subversion.xray.aps.anl.gov/EXPGUI/trunk/doc/ 
    7373# default for archive mode = on 
    7474set expgui(archive) 1 
     
    767767# utility export routines for the export_*.tcl files: 
    768768# make a box for export 
    769 proc MakeExportBox {win title webref} { 
     769proc MakeExportBox {win title webref {bookmark ""}} { 
    770770    global expmap expgui 
    771771    catch {destroy $win} 
     
    783783    } 
    784784    # leave a place for format-specific items 
    785     pack [frame $win.special] -side top 
    786     pack [frame $win.but] -side top -fill x -expand yes 
     785    pack [frame $win.special] -side top -fill both -expand yes 
     786    pack [frame $win.but] -side top -fill x -expand no 
    787787    pack [button $win.but.1 -text Write -command "destroy $win"] -side left 
    788788    SetExportPhase [lindex $expmap(phaselist) 0] $win 
     
    790790            -command "set expgui(export_phase) 0;destroy $win"] -side left 
    791791    pack [button $win.but.help -text Help -bg yellow \ 
    792             -command "MakeWWWHelp expgui.html ExportMSI"] \ 
     792            -command "MakeWWWHelp expgui.html $bookmark"] \ 
    793793            -side right 
    794794} 
     
    33443344            "source [file join $expgui(scriptdir) atomcons.tcl]; MakeRestraintsPane" \ 
    33453345            DisplayRestraintsPane \ 
    3346             0  expgui6.html ""} 
     3346            0  expgui6R.html ""} 
    33473347    {rbFrame   "Rigid Body" \ 
    33483348            "source  [file join $expgui(scriptdir) rigid.tcl]; MakeRBPane" \ 
     
    44524452        CIFselect $expgui(expfile) 
    44534453    } 
     4454    $expgui(fm).graphs.menu add cascade \ 
     4455        -menu  $expgui(fm).graphs.menu.fourier \ 
     4456        -label "Fourier" 
     4457    menu $expgui(fm).graphs.menu.fourier 
     4458    foreach num {1 2 3 4 5 6 7 8 9} { 
     4459        $expgui(fm).graphs.menu.fourier add command -label "Setup phase $num" \ 
     4460            -command "EditFourier $num" 
     4461    } 
     4462    $expgui(fm).graphs.menu.fourier add command -label "run fourier prog" \ 
     4463        -command {runGSASwEXP fourier} 
     4464 
    44544465    # add the commands in expgui_menulist  
    44554466    foreach menu [array names expgui_menulist ] { 
  • trunk/export_drawxtl.tcl

    r930 r1225  
    55set label "export to DRAWXTL (.str) file" 
    66set action export_drawxtl 
     7set ::DXTLcolorlist "White Red Green Blue Yellow Cyan Magenta Black Orange Brown Grey Silver White" 
     8set ::DXTL(bonds) 0 
     9set ::DXTL(coords) 1 
     10set ::DXTL(blackarrow) Green 
     11set ::DXTL(redarrow) Red 
     12foreach a {X Y Z} { 
     13    set ::DXTL(${a}dispMin) 0.0 
     14    set ::DXTL(${a}dispMax) 1.0 
     15} 
     16set ::DXTL(mtype) "" 
     17set ::DXTL(mfil) "" 
     18set ::DXTL(FourierRange) "" 
     19 
    720proc export_drawxtl {} { 
    821    global expmap expgui 
     
    1427        return 
    1528    } 
    16     foreach t [trace vinfo expgui(export_phase)] { 
    17         eval trace vdelete expgui(export_phase) $t 
    18     } 
    19      MakeExportBox .export "Export coordinates to program DRAWXTL" "" 
     29    foreach t [trace vinfo ::expgui(export_phase)] { 
     30        eval trace vdelete ::expgui(export_phase) $t 
     31    } 
     32    MakeExportBox .export "Export coordinates to program DRAWXTL" "" 
    2033#           "MakeWWWHelp expgui.html export" 
    2134 
    22     # force the window to stay on top 
    23     putontop .export 
    2435    # trigger a quit on window delete 
    2536    wm protocol .export WM_DELETE_WINDOW {set expgui(export_phase) 0; destroy .export } 
    2637    set bx .export.special 
    27     global DXTL 
    28     if {[info global DXTL] == ""} { 
    29         set DXTL(bonds) 0 
    30         set DXTL(coords) 1 
    31         set DXTL(blackarrow) Green 
    32         set DXTL(redarrow) Red 
    33     } 
    3438    set row 1 
    3539    grid [label $bx.1 -text "Title:"] -column 1 -row $row -sticky e 
    36     grid [entry $bx.2 -textvariable DXTL(title) -width 40] \ 
     40    grid [entry $bx.2 -textvariable ::DXTL(title) -width 40] \ 
    3741        -row $row -column 2 -columnspan 5 -sticky w 
    38     set DXTL(title) [expinfo title] 
     42    set ::DXTL(title) [expinfo title] 
    3943    incr row 
    4044    grid [checkbutton $bx.3 -text "Include coordinates in .str file" \ 
    41               -variable DXTL(coords)] \ 
     45              -variable ::DXTL(coords)] \ 
    4246        -row $row -column 1 -columnspan 5 -sticky w 
    4347    incr row 
    44     set DXTL(arrowbox) $bx.4 
     48    set ::DXTL(arrowbox) $bx.4 
    4549    grid [checkbutton $bx.4 -text "Display arrows for magnetic atoms" \ 
    46               -variable DXTL(genarrows) -state disabled] \ 
     50              -variable ::DXTL(genarrows) -state disabled] \ 
    4751        -row $row -column 1 -columnspan 5 -sticky w 
    4852    incr row 
    49     set colorlist "White Red Green Blue Yellow Cyan Magenta Black Orange Brown Grey Silver White" 
    50     set DXTL(arrowcolorbox) $bx.4a 
    51     set DXTL(arrowcolorbox_row) $row 
    52     grid [frame $bx.4a] -sticky ew -row $DXTL(arrowcolorbox_row) \ 
     53    set ::DXTL(arrowcolorbox) $bx.4a 
     54    set ::DXTL(arrowcolorbox_row) $row 
     55    grid [frame $bx.4a] -sticky ew -row $::DXTL(arrowcolorbox_row) \ 
    5356        -column 1 -columnspan 5  
    5457    grid [label $bx.4a.h -text "Arrow colors: "] -column 0 -row 1 -sticky w 
    5558    grid [label $bx.4a.bll -text "   generated by Black operator "] -column 0 -row 2 
    56     eval tk_optionMenu $bx.4a.bl DXTL(blackarrow) $colorlist 
     59    eval tk_optionMenu $bx.4a.bl ::DXTL(blackarrow) $::DXTLcolorlist 
    5760    grid $bx.4a.bl -column 2 -row 2 
    5861    grid [label $bx.4a.redl -text "  generated by Red operator "] -column 0 -row 3 
    59     eval tk_optionMenu $bx.4a.red DXTL(redarrow) $colorlist 
     62    eval tk_optionMenu $bx.4a.red ::DXTL(redarrow) $::DXTLcolorlist 
    6063    grid $bx.4a.red -column 2 -row 3 
    6164    incr row 
     
    7477    if {$app != ""} { 
    7578        set show normal 
    76         set DXTL(app) $appname 
    77         set DXTL(launch) 1 
     79        set ::DXTL(app) $appname 
     80        set ::DXTL(launch) 1 
    7881    } else { 
    7982        set show disabled 
    80         set DXTL(launch) 0 
     83        set ::DXTL(launch) 0 
    8184    } 
    8285    grid [checkbutton $bx.l -text "Launch DRAWxtl" \ 
    83               -variable DXTL(launch) -state $show] \ 
     86              -variable ::DXTL(launch) -state $show] \ 
    8487        -row $row -column 1 -columnspan 5 -sticky w 
    8588    incr row 
     
    9093        incr row 
    9194        grid [label $bx.c.${v}1 -text "${V} min:"] -column 1 -row $row 
    92         grid [entry $bx.c.${v}2 -textvariable DXTL(${v}min) -width 4] -column 2 -row $row 
    93         grid [scale $bx.c.${v}3 -resolution 0.1 -variable DXTL(${v}min) \ 
     95        grid [entry $bx.c.${v}2 -textvariable ::DXTL(${v}min) -width 4] -column 2 -row $row 
     96        grid [scale $bx.c.${v}3 -resolution 0.1 -variable ::DXTL(${v}min) \ 
    9497                  -showvalue 0 -orient h -from -2 -to 1] -column 3 -row $row 
    95         set DXTL(${v}min) -0.1 
     98        set ::DXTL(${v}min) -0.1 
    9699        grid [label $bx.c.${v}4 -text " max:"] -column 4 -row $row 
    97         grid [entry $bx.c.${v}5 -textvariable DXTL(${v}max) -width 4] -column 5 -row $row 
    98         grid [scale $bx.c.${v}6 -resolution 0.1 -variable DXTL(${v}max) \ 
     100        grid [entry $bx.c.${v}5 -textvariable ::DXTL(${v}max) -width 4] -column 5 -row $row 
     101        grid [scale $bx.c.${v}6 -resolution 0.1 -variable ::DXTL(${v}max) \ 
    99102                  -showvalue 0 -orient h -from 0 -to 3] -column 6 -row $row 
    100         set DXTL(${v}max) 1.1 
     103        set ::DXTL(${v}max) 1.1 
    101104    } 
    102105    # atom type box 
    103106    grid [frame $bx.s -relief groove -bd 4] -row $row -column 0 -columnspan 5 -sticky nsew 
     107    grid rowconfigure $bx $row -weight 1 
    104108    grid [label $bx.s.0 -text "Atom representation" \ 
    105109              -anchor w] -row 0 -column 0 -sticky w 
     
    108112              -yscrollcommand "$bx.s.scroll set" ] \ 
    109113        -column 0 -row [incr row] -sticky nsew 
     114    grid rowconfigure $bx.s $row -weight 1 
    110115    grid columnconfig $bx.s 0 -weight 1 
    111     frame [set DXTL(lb) $bx.s.canvas.fr] 
    112     $bx.s.canvas create window 0 0 -anchor nw -window $DXTL(lb) 
     116    frame [set ::DXTL(lb) $bx.s.canvas.fr] 
     117    $bx.s.canvas create window 0 0 -anchor nw -window $::DXTL(lb) 
    113118    grid [scrollbar $bx.s.scroll \ 
    114119              -command "$bx.s.canvas yview"] -sticky ns -row $row -column 1 
     
    116121    incr row 
    117122    grid [frame $bx.b -relief groove -bd 4] -row $row -column 0 -columnspan 5 -sticky ew 
     123    grid rowconfigure $bx $row -weight 1 
    118124    grid [frame $bx.b.0] -row 0 -column 0 -columnspan 7 -sticky ew 
    119125    grid [label $bx.b.0.1 -text "Bond List" \ 
     
    126132              -yscrollcommand "$bx.b.scroll set" ] \ 
    127133        -column 0 -row [incr row] -sticky nsew 
     134    grid rowconfigure $bx.b $row -weight 1 
    128135    grid columnconfig $bx.b 0 -weight 1 
    129     frame [set DXTL(Blst) $bx.b.canvas.fr] 
    130     $bx.b.canvas create window 0 0 -anchor nw -window $DXTL(Blst) 
     136    frame [set ::DXTL(Blst) $bx.b.canvas.fr] 
     137    $bx.b.canvas create window 0 0 -anchor nw -window $::DXTL(Blst) 
    131138    grid [scrollbar $bx.b.scroll \ 
    132139              -command "$bx.b.canvas yview"] -sticky ns -row $row -column 1 
    133  
    134     trace variable expgui(export_phase) w SetDXTLatoms 
    135     SetDXTLatoms 
     140    # Fourier Box 
     141    incr row 
     142    grid [frame $bx.f -relief groove -bd 4] -row $row -column 0 -columnspan 5 -sticky nsew 
     143    grid [frame $bx.f.0] -column 0 -columnspan 3 -row 0 -sticky news 
     144    grid columnconfig $bx.f.0 0 -weight 1 
     145    grid [label $bx.f.0.l1 -text "Fourier display" \ 
     146              -anchor w] -row 0 -column 0 -sticky w 
     147    set ::DXTL(FourierRange) "Range: unknown" 
     148    grid [label $bx.f.0.l2 -textvariable ::DXTL(FourierRange) \ 
     149              -anchor w] -row 0 -column 1 -sticky e 
     150    grid [frame $bx.f.1] -column 0 -columnspan 3 -row 1 -sticky news 
     151    grid [frame $bx.f.2] -column 0 -columnspan 3 -row 2 -sticky news 
     152    grid [canvas $bx.f.canvas -relief sunk -bd 2 \ 
     153              -scrollregion {0 0 5000 500} -width 250 -height 70 \ 
     154              -yscrollcommand "$bx.f.scroll set" ] \ 
     155        -column 0 -row 3 -sticky nsew 
     156    grid rowconfigure $bx $row -weight 1 
     157    grid rowconfigure $bx.f 3 -weight 1 
     158    grid columnconfig $bx.f 0 -weight 1 
     159    frame [set ::DXTL(fb) $bx.f.canvas.fr] 
     160    $bx.f.canvas create window 0 0 -anchor nw -window $::DXTL(fb) 
     161    grid [scrollbar $bx.f.scroll \ 
     162              -command "$bx.f.canvas yview"] -sticky ns -row 3 -column 2 
     163    grid [button $bx.f.1.1 -text "Setup\nFourier" \ 
     164              -command {EditFourier $::expgui(export_phase); SetupFourierButtons} \ 
     165             ] -column 0 -row 0 
     166    grid [button [set ::DXTL(FourCompute) $bx.f.1.2] -text "Compute\nFourier" \ 
     167              -command {DXTLwritegrd $expgui(export_phase)}] -column 1 -row 0 
     168    grid [label $bx.f.1.3 -text "Select\nMap"] -column 3 -row 0 
     169    set ::DXTL(fmenu) [tk_optionMenu $bx.f.1.4 ::DXTL(mtype) test] 
     170    grid $bx.f.1.4 -column 4 -row 0 
     171    grid [button [set ::DXTL(AddContour) $bx.f.1.5] -text "Add\nContour" \ 
     172              -command AddContour] -column 5 -row 0 
     173    grid [frame $bx.f.1.f] -column 0 -columnspan 9 -row 1 
     174    grid [label $bx.f.1.f.0 -text "display\nlimits"] -column 0 -row 0 
     175    set col 0 
     176    foreach a {X Y Z} { 
     177        incr col 
     178        grid [label $bx.f.1.f.$col -text $a] -column $col -row 0 
     179        incr col 
     180        grid [entry $bx.f.1.f.$col -textvariable ::DXTL(${a}dispMin) \ 
     181                  -width 6] -column $col -row 0 
     182        incr col 
     183        grid [entry $bx.f.1.f.$col -textvariable ::DXTL(${a}dispMax) \ 
     184                  -width 6] -column $col -row 0 
     185    } 
     186    set ::DXTL(contours) 0 
     187    trace variable ::expgui(export_phase) w OnNewFourierPhase 
     188    OnNewFourierPhase 
    136189    # this appears to be needed by OSX 
    137190    ResizeWin .export 
     191    # force the window to stay on top 
     192    putontop .export 
     193    SetDXTLatoms 
    138194 
    139195    # Wait for the Write or Quit button to be pressed 
     
    161217        # title info from GSAS title & phase title 
    162218        puts $fp "REM  created by EXPGUI from $expgui(expfile) on [clock format [clock seconds]]" 
    163         puts $fp "title \"$DXTL(title)\"" 
    164         puts $fp "pack $DXTL(xmin) $DXTL(xmax) $DXTL(ymin) $DXTL(ymax) $DXTL(zmin) $DXTL(zmax)" 
     219        puts $fp "title \"$::DXTL(title)\"" 
     220        puts $fp "pack $::DXTL(xmin) $::DXTL(xmax) $::DXTL(ymin) $::DXTL(ymax) $::DXTL(zmin) $::DXTL(zmax)" 
    165221        puts $fp "edges 0.02 Black" 
    166222        puts $fp "phong 1.0 30." 
    167223        foreach type [array names typelist] { 
    168             if {$DXTL(display_$type) == "sphere"} { 
    169                 puts $fp "sphere $type $DXTL(radius_$type) $DXTL(color_$type)" 
    170             } elseif {$DXTL(display_$type) == "polyhedron"} { 
    171                 puts $fp "polysz $type $DXTL(radius_$type) $DXTL(color_$type)" 
    172             } elseif {$DXTL(display_$type) == "ellipsoid"} { 
    173                 puts $fp "ellipcolor $type * $DXTL(color_$type)" 
     224            if {$::DXTL(display_$type) == "sphere"} { 
     225                puts $fp "sphere $type $::DXTL(radius_$type) $::DXTL(color_$type)" 
     226            } elseif {$::DXTL(display_$type) == "polyhedron"} { 
     227                puts $fp "polysz $type $::DXTL(radius_$type) $::DXTL(color_$type)" 
     228            } elseif {$::DXTL(display_$type) == "ellipsoid"} { 
     229                puts $fp "ellipcolor $type * $::DXTL(color_$type)" 
    174230            } 
    175231        } 
    176         if {$DXTL(coords)} { 
     232        if {$::DXTL(coords)} { 
    177233            # write out cell parameters 
    178234            puts -nonewline $fp "cell" 
     
    204260            puts $fp "import gsas [file tail $expgui(expfile)] $phase" 
    205261        } 
    206         for {set i 1} {$i <= $DXTL(bonds)} {incr i} { 
    207             puts $fp "bond $DXTL(ba_$i) $DXTL(bb_$i) $DXTL(bw_$i) $DXTL(bmin_$i) $DXTL(bmax_$i) $DXTL(bc_$i)" 
     262        for {set i 1} {$i <= $::DXTL(bonds)} {incr i} { 
     263            puts $fp "bond $::DXTL(ba_$i) $::DXTL(bb_$i) $::DXTL(bw_$i) $::DXTL(bmin_$i) $::DXTL(bmax_$i) $::DXTL(bc_$i)" 
    208264        } 
    209265        # list arrows, when requested 
    210266        if {[lindex $expmap(phasetype) [expr {$phase - 1}]] != 1 && \ 
    211                 $DXTL(genarrows)} { 
     267                $::DXTL(genarrows)} { 
    212268            DXTLwriteArrows $fp $phase 
    213269        } 
     270        DXTLwriteFourierCommands $fp 
    214271        puts $fp "END" 
    215272        close $fp 
    216         if {$DXTL(launch)} { 
    217             exec $DXTL(app) $filnam & 
     273        if {$::DXTL(launch)} { 
     274            exec $::DXTL(app) $filnam & 
    218275        } 
    219276    } errmsg] { 
     
    224281                -message "File [file tail $filnam] was written" 
    225282    } 
    226     catch {unset DXTL} 
     283    #catch {unset DXTL} 
    227284    foreach t [trace vinfo expgui(export_phase)] { 
    228285        eval trace vdelete expgui(export_phase) $t 
     
    245302# add atoms to atom representation list 
    246303proc SetDXTLatoms {args} { 
    247     global DXTL expgui expmap 
    248     set colorlist "White Red Green Blue Yellow Cyan Magenta Black Orange Brown Grey Silver White" 
    249     eval destroy [winfo children $DXTL(lb)] 
    250     eval destroy [winfo children $DXTL(Blst)] 
    251     set DXTL(bonds) 0 
     304    global expgui expmap 
     305    eval destroy [winfo children $::DXTL(lb)] 
     306    eval destroy [winfo children $::DXTL(Blst)] 
     307    set ::DXTL(bonds) 0 
    252308    if {$expgui(export_phase) == 0} {return} 
    253309    set phase $expgui(export_phase) 
     
    259315    } 
    260316    if {[lindex $expmap(phasetype) [expr {$phase - 1}]] == 1} { 
    261         set DXTL(genarrows) 0 
    262         $DXTL(arrowbox) configure -state disabled 
    263         grid forget $DXTL(arrowcolorbox)  
     317        set ::DXTL(genarrows) 0 
     318        $::DXTL(arrowbox) configure -state disabled 
     319        grid forget $::DXTL(arrowcolorbox)  
    264320    } else { 
    265         set DXTL(genarrows) 1 
    266         $DXTL(arrowbox) configure -state normal 
    267         grid $DXTL(arrowcolorbox) -sticky ew -row $DXTL(arrowcolorbox_row) \ 
     321        set ::DXTL(genarrows) 1 
     322        $::DXTL(arrowbox) configure -state normal 
     323        grid $::DXTL(arrowcolorbox) -sticky ew -row $::DXTL(arrowcolorbox_row) \ 
    268324            -column 1 -columnspan 5 
    269325    } 
    270326    catch {unset typelist} 
    271     set DXTL(title)  [phaseinfo $phase name] 
     327    set ::DXTL(title)  [phaseinfo $phase name] 
    272328    foreach atom $expmap(atomlist_$phase) { 
    273329        set typelist([atominfo $phase $atom type]) 1 
    274330    } 
    275     set DXTL(typelist) [array names typelist] 
     331    set ::DXTL(typelist) [array names typelist] 
    276332    set row 0 
    277     grid [label $DXTL(lb).l$row -text "type " -bg yellow\ 
     333    grid [label $::DXTL(lb).l$row -text "type " -bg yellow\ 
    278334             ] -column 0 -row $row  -sticky ew 
    279     grid [label $DXTL(lb).d$row -text " representation " -bg yellow 
     335    grid [label $::DXTL(lb).d$row -text " representation " -bg yellow 
    280336         ] -column 1 -row $row -sticky ew 
    281     grid [label $DXTL(lb).e$row -text " radius " -bg yellow\ 
     337    grid [label $::DXTL(lb).e$row -text " radius " -bg yellow\ 
    282338             ] -column 2 -row $row -sticky ew 
    283     grid [label $DXTL(lb).c$row -text " color " -bg yellow\ 
     339    grid [label $::DXTL(lb).c$row -text " color " -bg yellow\ 
    284340             ] -column 3 -row $row -sticky ew 
    285341    foreach type [array names typelist] { 
    286342        incr row 
    287         grid [label $DXTL(lb).l$row -text $type] -column 0 -row $row 
    288         tk_optionMenu $DXTL(lb).d$row DXTL(display_$type) sphere polyhedron ellipsoid none 
    289         grid $DXTL(lb).d$row -column 1 -row $row 
    290         grid [entry $DXTL(lb).e$row -textvariable DXTL(radius_$type) \ 
     343        grid [label $::DXTL(lb).l$row -text $type] -column 0 -row $row 
     344        tk_optionMenu $::DXTL(lb).d$row ::DXTL(display_$type) sphere polyhedron ellipsoid none 
     345        grid $::DXTL(lb).d$row -column 1 -row $row 
     346        grid [entry $::DXTL(lb).e$row -textvariable ::DXTL(radius_$type) \ 
    291347                -width 5] -column 2 -row $row 
    292         eval tk_optionMenu $DXTL(lb).c$row DXTL(color_$type) $colorlist 
    293         grid $DXTL(lb).c$row -column 3 -row $row 
    294         set DXTL(display_$type) sphere 
    295         set DXTL(radius_$type) 0.2 
    296         set DXTL(color_$type) [lindex $colorlist $row] 
    297     } 
     348        eval tk_optionMenu $::DXTL(lb).c$row ::DXTL(color_$type) $::DXTLcolorlist 
     349        grid $::DXTL(lb).c$row -column 3 -row $row 
     350        set ::DXTL(display_$type) sphere 
     351        set ::DXTL(radius_$type) 0.2 
     352        set ::DXTL(color_$type) [lindex $::DXTLcolorlist $row] 
     353    } 
     354    # Resize the list 
     355    update idletasks 
     356    foreach i {lb Blst fb} { 
     357        set sizes [grid bbox $::DXTL($i)] 
     358        [winfo parent $::DXTL($i)] config -scrollregion $sizes  \ 
     359            -width [lindex $sizes 2] 
     360    } 
     361    wm geom [winfo toplevel $::DXTL(Blst)] {} 
     362} 
     363 
     364# add bonds to bond list 
     365proc DXTLaddBond {} { 
     366    if {$::DXTL(bonds) == 0} { 
     367        # insert header 
     368        set row 0 
     369        grid [label $::DXTL(Blst).a$row -text "from " -bg yellow\ 
     370                 ] -column 1 -row $row  -sticky ew 
     371        grid [label $::DXTL(Blst).b$row -text " to " -bg yellow\ 
     372                 ] -column 2 -row $row  -sticky ew 
     373        grid [label $::DXTL(Blst).c$row -text " width " -bg yellow\ 
     374                 ] -column 3 -row $row  -sticky ew 
     375        grid [label $::DXTL(Blst).d$row -text " min " -bg yellow\ 
     376             ] -column 4 -row $row  -sticky ew 
     377        grid [label $::DXTL(Blst).e$row -text " max " -bg yellow\ 
     378                 ] -column 5 -row $row  -sticky ew 
     379        grid [label $::DXTL(Blst).f$row -text " color " -bg yellow\ 
     380                 ] -column 6 -row $row  -sticky ew 
     381    } 
     382    set row [incr ::DXTL(bonds)] 
     383    eval tk_optionMenu $::DXTL(Blst).ta$row ::DXTL(ba_$row) $::DXTL(typelist) 
     384    grid $::DXTL(Blst).ta$row -column 1 -row $row 
     385    eval tk_optionMenu $::DXTL(Blst).tb$row ::DXTL(bb_$row) $::DXTL(typelist) 
     386    grid $::DXTL(Blst).tb$row -column 2 -row $row 
     387    grid [entry $::DXTL(Blst).w$row -textvariable ::DXTL(bw_$row) \ 
     388              -width 5] -column 3 -row $row 
     389    grid [entry $::DXTL(Blst).mi$row -textvariable ::DXTL(bmin_$row) \ 
     390              -width 5] -column 4 -row $row 
     391    grid [entry $::DXTL(Blst).mx$row -textvariable ::DXTL(bmax_$row) \ 
     392              -width 5] -column 5 -row $row 
     393    eval tk_optionMenu $::DXTL(Blst).c$row ::DXTL(bc_$row) $::DXTLcolorlist 
     394    grid $::DXTL(Blst).c$row -column 6 -row $row 
     395    set ::DXTL(bw_$row) 0.02 
     396    set ::DXTL(bmin_$row) 1.0 
     397    set ::DXTL(bmax_$row) 2.0 
     398    set ::DXTL(bc_$row) [lindex $::DXTLcolorlist $row] 
    298399    # Resize the list 
    299400    update 
    300     set sizes [grid bbox $DXTL(lb)] 
    301     [winfo parent $DXTL(lb)] config -scrollregion $sizes \ 
     401    set sizes [grid bbox $::DXTL(Blst)] 
     402    [winfo parent $::DXTL(Blst)] config -scrollregion $sizes \ 
    302403        -width [lindex $sizes 2] 
    303     set sizes [grid bbox $DXTL(Blst)] 
    304     [winfo parent $DXTL(Blst)] config -scrollregion $sizes \ 
    305         -width [lindex $sizes 2] 
    306     wm geom [winfo toplevel $DXTL(Blst)] {} 
    307 } 
    308  
    309 # add bonds to bond list 
    310 proc DXTLaddBond {} { 
    311     global DXTL 
    312     set colorlist "White Red Green Blue Yellow Cyan Magenta Black Orange Brown Grey Silver White" 
    313  
    314     if {$DXTL(bonds) == 0} { 
    315         # insert header 
    316         set row 0 
    317         grid [label $DXTL(Blst).a$row -text "from " -bg yellow\ 
    318                  ] -column 1 -row $row  -sticky ew 
    319         grid [label $DXTL(Blst).b$row -text " to " -bg yellow\ 
    320                  ] -column 2 -row $row  -sticky ew 
    321         grid [label $DXTL(Blst).c$row -text " width " -bg yellow\ 
    322                  ] -column 3 -row $row  -sticky ew 
    323         grid [label $DXTL(Blst).d$row -text " min " -bg yellow\ 
    324              ] -column 4 -row $row  -sticky ew 
    325         grid [label $DXTL(Blst).e$row -text " max " -bg yellow\ 
    326                  ] -column 5 -row $row  -sticky ew 
    327         grid [label $DXTL(Blst).f$row -text " color " -bg yellow\ 
    328                  ] -column 6 -row $row  -sticky ew 
    329     } 
    330     set row [incr DXTL(bonds)] 
    331     eval tk_optionMenu $DXTL(Blst).ta$row DXTL(ba_$row) $DXTL(typelist) 
    332     grid $DXTL(Blst).ta$row -column 1 -row $row 
    333     eval tk_optionMenu $DXTL(Blst).tb$row DXTL(bb_$row) $DXTL(typelist) 
    334     grid $DXTL(Blst).tb$row -column 2 -row $row 
    335     grid [entry $DXTL(Blst).w$row -textvariable DXTL(bw_$row) \ 
    336               -width 5] -column 3 -row $row 
    337     grid [entry $DXTL(Blst).mi$row -textvariable DXTL(bmin_$row) \ 
    338               -width 5] -column 4 -row $row 
    339     grid [entry $DXTL(Blst).mx$row -textvariable DXTL(bmax_$row) \ 
    340               -width 5] -column 5 -row $row 
    341     eval tk_optionMenu $DXTL(Blst).c$row DXTL(bc_$row) $colorlist 
    342     grid $DXTL(Blst).c$row -column 6 -row $row 
    343     set DXTL(bw_$row) 0.02 
    344     set DXTL(bmin_$row) 1.0 
    345     set DXTL(bmax_$row) 2.0 
    346     set DXTL(bc_$row) [lindex $colorlist $row] 
    347     # Resize the list 
    348     update 
    349     set sizes [grid bbox $DXTL(Blst)] 
    350     [winfo parent $DXTL(Blst)] config -scrollregion $sizes \ 
    351         -width [lindex $sizes 2] 
     404    #set can [winfo parent $::DXTL($i)] 
     405    #set scroll [winfo parent $can].scroll 
     406    #[winfo parent $::DXTL($i)] config -scrollregion $sizes  
    352407} 
    353408 
    354409proc DXTLwriteArrows {out phase} { 
    355     global expgui expmap DXTL 
     410    global expgui expmap 
    356411    set fp [open geom.in w] 
    357412    puts $fp "N" 
     
    399454                puts $out "rem spin for atom $name # $k ($spin)" 
    400455                if {$spin == "Red"} { 
    401                     puts $out "arrow $pos     $vec    1. 0.15 $DXTL(redarrow)" 
     456                    puts $out "arrow $pos     $vec    1. 0.15 $::DXTL(redarrow)" 
    402457                } else { 
    403                     puts $out "arrow $pos     $vec    1. 0.15 $DXTL(blackarrow)" 
     458                    puts $out "arrow $pos     $vec    1. 0.15 $::DXTL(blackarrow)" 
    404459                } 
    405460            } elseif {$i == 6} { 
     
    412467    puts $out "mag_trans 1. 0 0  0 1. 0  0 0 1." 
    413468} 
     469 
     470# Computes a Fourier map(s) and converts the maps from binary to ascii 
     471#   returns a list of Fourier map types 
     472proc DXTLwritegrd {phase} { 
     473    global expgui expmap 
     474    set lst [listFourier] 
     475    if {[llength $lst] < 1} { 
     476        MyMessageBox -parent . -title "No Fourier" \ 
     477            -message "You have not set up to compute a Fourier map." \ 
     478            -icon warning 
     479        return 
     480    } 
     481    set typelist {} 
     482    foreach l $lst { 
     483        lappend typelist [Fourierinfo $l type] 
     484    } 
     485    set hists [FourierHists $phase] 
     486    # make sure we have default limits 
     487    getFourierLimits $phase 
     488    if {[llength $hists] < 1} { 
     489        MyMessageBox -parent . -title "No Fourier" \ 
     490            -message "You have not set up to compute a Fourier map for phase $phase." \ 
     491            -icon warning 
     492        return 
     493    } 
     494    if {$::tcl_platform(platform) == "windows"} { 
     495        set map [file join $expgui(gsasexe) gsas2map.exe] 
     496        set fourier [file join $expgui(gsasexe) fourier.exe] 
     497    } else { 
     498        set map [file join $expgui(gsasexe) gsas2map] 
     499        set fourier [file join $expgui(gsasexe) fourier] 
     500    } 
     501    if {![file exists $map]} { 
     502        MyMessageBox -parent . -title "No Map Converter prog" \ 
     503            -message "Error Fourier map converter program ($map) not found." \ 
     504            -icon warning 
     505        return 
     506    } 
     507    if {![file exists $fourier]} { 
     508        MyMessageBox -parent . -title "No Fourier prog" \ 
     509            -message "Error Fourier program ($fourier) not found." \ 
     510            -icon warning 
     511        return 
     512    } 
     513    set fp [open f.in w] 
     514    if {[OutputFourierType]} { 
     515        puts $fp [lindex $typelist 0] 
     516    } 
     517    puts $fp "E" 
     518    foreach t [lrange $typelist 1 end] { 
     519        puts $fp "F $t" 
     520        puts $fp "E" 
     521    } 
     522    puts $fp "q" 
     523    close $fp 
     524    # delete any old grd files 
     525    foreach f [glob -nocomplain "[file root $expgui(expfile)]*.grd"] { 
     526        catch {file delete -force $f} 
     527    } 
     528    set deleteerror 0 
     529    if {[llength [glob -nocomplain "[file root $expgui(expfile)]*.grd"]] >0} { 
     530        MyMessageBox -parent . -title "Old grd files?" \ 
     531            -message "Warning: Could not delete old .grd files; it will probably not be possible to overwrite them either. Be aware that map results may be out of date." \ 
     532            -icon warning 
     533        set deleteerror 1 
     534    } 
     535    # Save the current exp file 
     536    savearchiveexp 
     537    # disable the file changed monitor 
     538    set expgui(expModifiedLast) 0 
     539    catch { 
     540        exec $fourier [file root $expgui(expfile)] >& f.out 
     541        exec $map [file root $expgui(expfile)] < f.in >>& f.out 
     542    } 
     543    # reset the file changed monitor 
     544    #loadexp $expgui(expfile) 
     545    set expgui(expModifiedLast) [file mtime $expgui(expfile)] 
     546 
     547    if {[llength [glob -nocomplain "[file root $expgui(expfile)]*.grd"]] == 0} { 
     548        set fp [open f.out r] 
     549        set lines {} 
     550        while {[gets $fp line] >= 0} { 
     551            append lines $line "\n" 
     552        } 
     553        close $fp 
     554        MyMessageBox -parent . -title "No grd files" \ 
     555            -message "Error: no .grd files were created. See log file below\n\n$lines" \ 
     556            -icon error 
     557        return {} 
     558    } else { 
     559        catch {close $fp} 
     560        catch {file delete -force f.in f.out} 
     561        SetupFourierButtons 
     562        return $typelist 
     563    } 
     564} 
     565 
     566# called when the phase # is set or changed 
     567# clean up old Fourier maps 
     568proc OnNewFourierPhase {args} { 
     569    SetDXTLatoms 
     570    if {[llength $::expmap(phaselist)] > 1} { 
     571        # there is more than one phase; delete any .grd files to make sure  
     572        # generate ones for the current phase 
     573        foreach f [glob -nocomplain "[file root $::expgui(expfile)]*.grd"] { 
     574            catch {file delete -force $f} 
     575        } 
     576    } 
     577    SetupFourierButtons 
     578    eval destroy [winfo children $::DXTL(fb)] 
     579    set ::DXTL(contours) 0 
     580} 
     581 
     582# this enables/disables Fourier buttons based on the Fourier setup  
     583# and the files that are present 
     584proc SetupFourierButtons {} { 
     585    if {[catch { 
     586        set phase $::expgui(export_phase) 
     587        $::DXTL(FourCompute) config -state disabled 
     588        $::DXTL(AddContour) config -state disabled 
     589        $::DXTL(fmenu) delete 0 end 
     590    }]} return 
     591    set ::DXTL(mtype) "" 
     592    set ::DXTL(mfil) "" 
     593    set ::DXTL(FourierRange) "" 
     594    # if the Fourier is not set up; return here 
     595    if {[llength [set nF [listFourier]]] < 1} return 
     596    # check that all phases are set to current phase 
     597    foreach i $nF { 
     598        set ph [Fourierinfo $i phase] 
     599        if {$ph != $phase} return 
     600    } 
     601    if {[llength [FourierHists $phase]] < 1} return 
     602    # make sure we have default limits 
     603    getFourierLimits $phase 
     604    $::DXTL(FourCompute) config -state normal 
     605    # if there are no maps, return now 
     606    set maps [glob -nocomplain "[file root $::expgui(expfile)]*.grd"] 
     607    if {[llength $maps] < 1} return 
     608    set types {} 
     609    foreach fil $maps { 
     610        lappend types [lindex [split [file root [file tail $fil]] "_"] end] 
     611    } 
     612    set i 0 
     613    foreach fil $maps lbl $types { 
     614        $::DXTL(fmenu) add command -label $lbl \ 
     615            -command "set DXTL(mtype) $lbl; set DXTL(mfil) $fil; GetFourierRange" 
     616        if {$i == 0} { 
     617            $::DXTL(fmenu) invoke 0 
     618            $::DXTL(AddContour) config -state normal 
     619        } 
     620        incr i 
     621    } 
     622} 
     623 
     624proc AddContour {} { 
     625    # set a header 
     626    if {$::DXTL(contours) == 0} { 
     627        set row 0 
     628        grid [label $::DXTL(fb).a$row -text "Type" -bg yellow \ 
     629                 ] -column 1 -row $row  -sticky ew 
     630        grid [label $::DXTL(fb).b$row -text "Contour Level" -bg yellow \ 
     631                 ] -column 2 -row $row  -sticky ew 
     632        grid [label $::DXTL(fb).c$row -text "Color" -bg yellow \ 
     633                 -anchor center] -column 3 -row $row  -sticky ew 
     634    } 
     635    set row [incr ::DXTL(contours)] 
     636    eval tk_optionMenu $::DXTL(fb).ta$row ::DXTL(fb_type_$row) {mesh solid} 
     637    grid $::DXTL(fb).ta$row -column 1 -row $row 
     638    grid [entry $::DXTL(fb).w$row -width 10 -textvariable ::DXTL(fb_val_$row) \ 
     639         ] -column 2 -row $row 
     640    set menu [eval tk_optionMenu $::DXTL(fb).tb$row \ 
     641                  ::DXTL(fb_color_$row) $::DXTLcolorlist] 
     642    $menu invoke $row 
     643    grid $::DXTL(fb).tb$row -column 3 -row $row 
     644    grid [button $::DXTL(fb).del$row -text "Delete"\ 
     645             -command "DeleteFourierContour $row"] -column 4 -row $row 
     646    update idletasks 
     647    set sizes [grid bbox $::DXTL(fb)] 
     648    [winfo parent $::DXTL(fb)] config -scrollregion $sizes \ 
     649        -width [lindex $sizes 2] 
     650} 
     651 
     652proc DeleteFourierContour {row} { 
     653    foreach i "$::DXTL(fb).ta$row $::DXTL(fb).w$row $::DXTL(fb).tb$row \ 
     654$::DXTL(fb).tb$row $::DXTL(fb).del$row" { 
     655        catch {destroy $i} 
     656    } 
     657    set ::DXTL(fb_val_$i) "" 
     658    if {$::DXTL(contours) == $row} {incr ::DXTL(contours) -1} 
     659} 
     660 
     661proc GetFourierRange {} { 
     662    set fp [open f.in w] 
     663    set lst [listFourier] 
     664    if {[llength $lst] < 1} { 
     665        MyMessageBox -parent . -title "No Fourier" \ 
     666            -message "You have not set up to compute a Fourier map." \ 
     667            -icon warning 
     668        return 
     669    } 
     670    set typelist {} 
     671    foreach l $lst { 
     672        lappend typelist [Fourierinfo $l type] 
     673    } 
     674    if {[OutputFourierType]} { 
     675        puts $fp $::DXTL(mtype) 
     676    } 
     677    close $fp 
     678    if {$::tcl_platform(platform) == "windows"} { 
     679        set map [file join $::expgui(gsasexe) forsrh.exe] 
     680    } else { 
     681        set map [file join $::expgui(gsasexe) forsrh] 
     682    } 
     683    catch { 
     684        exec $map [file root $::expgui(expfile)] < f.in >& f.out 
     685    } 
     686    foreach {min max} {{} {}} {} 
     687    catch { 
     688        set fp [open "f.out" r]         
     689        while {[gets $fp line] >= 0} { 
     690            if {[string first "range of map values" $line] != -1} { 
     691                set off [expr 4 + [string first " is " $line]] 
     692                foreach {min to max} [string trim [string range $line $off end]] {} 
     693                break 
     694            } 
     695        } 
     696    } 
     697    catch { 
     698        close $fp 
     699    } 
     700    if {$min != ""} {set ::DXTL(FourierRange) "Range: $min to $max"} 
     701} 
     702 
     703# is output of the current Fourier map type required as input to a program? 
     704# answer is yes when more than one map file is present 
     705proc OutputFourierType {} { 
     706    set i 0 
     707    foreach ext {DEL FCL FOB PTS DPT} { 
     708        if {[file exists [file root $::expgui(expfile)].$ext]} { 
     709            incr i 
     710        } 
     711        for {set i 2} {$i <= 9} {incr i} { 
     712            if {[file exists [file root $::expgui(expfile)].${i}FD]} { 
     713                incr i 
     714            } 
     715        } 
     716    } 
     717    if {$i > 1} { 
     718        return 1 
     719    } 
     720    return 0 
     721} 
     722 
     723proc DXTLwriteFourierCommands {fp} { 
     724    if {$::DXTL(mfil) == ""} return 
     725    if {![file exists $::DXTL(mfil)]} { 
     726        puts "file not found $::DXTL(mfil)" 
     727        return 
     728    } 
     729    set cntlist {} 
     730    for {set i 1} {$i <= $::DXTL(contours)} {incr i} { 
     731        set val "" 
     732        catch {set val $::DXTL(fb_val_$i)} 
     733        if {[catch {set val [expr 1.*$val]}]} continue 
     734        lappend cntlist [list $val $::DXTL(fb_type_$i) $::DXTL(fb_color_$i)]       } 
     735    if {[llength $cntlist] <= 0} return 
     736    puts $fp "mapread grd [file tail $::DXTL(mfil)] 4" 
     737    foreach item $cntlist { 
     738        puts $fp "mapcontour $item" 
     739    } 
     740    set s {} 
     741    foreach a {X Y Z} { 
     742        lappend s $::DXTL(${a}dispMin) 
     743        lappend s $::DXTL(${a}dispMax) 
     744    } 
     745    puts $fp "mapregion $s" 
     746} 
  • trunk/gsascmds.tcl

    r1219 r1225  
    39323932    exit 
    39333933} 
     3934 
     3935# Fourier routines 
     3936proc EditFourier {phase} { 
     3937    #is this a valid phase #? 
     3938    if {[lsearch $::expmap(phaselist) $phase] == -1} return 
     3939    # check that all Fourier records are set to the current phase 
     3940    foreach i [listFourier] { 
     3941        set ph [Fourierinfo $i phase] 
     3942        if {$ph != $phase} {Fourierinfo $i phase set $phase} 
     3943    } 
     3944    # for now we will not offer access to section, (dmin, dmax not supported) 
     3945    set typelist {} 
     3946    foreach i [listFourier] { 
     3947        lappend typelist [Fourierinfo $i type] 
     3948    } 
     3949    set histlist [FourierHists $phase] 
     3950    set limits  [getFourierLimits $phase] 
     3951    if {[winfo exists .export]} { 
     3952        set box .export.fourier 
     3953    } else { 
     3954        set box .fourier 
     3955    } 
     3956    catch {destroy $box} 
     3957    toplevel $box 
     3958    wm title $box "Set Fourier Options, phase $phase" 
     3959    grid [frame $box.1] -row 1 -column 1 -rowspan 10 
     3960    grid [frame $box.2] -row 1 -column 2 -rowspan 10 
     3961    grid [frame $box.b] -sticky news -row 11 -column 1 -columnspan 2 
     3962    grid columnconfigure $box.b 0 -weight 1 
     3963    grid columnconfigure $box.b 3 -weight 1 
     3964    grid [button $box.b.1 -text Continue \ 
     3965              -command "set ::DXTL(quit) 0; destroy $box" \ 
     3966             ] -row 1 -column 1 
     3967    grid [button $box.b.2 -text Quit \ 
     3968              -command "set ::DXTL(quit) 1; destroy $box" \ 
     3969             ] -row 1 -column 2 
     3970     
     3971    # map type selection 
     3972    set row 0 
     3973    grid [label $box.1.$row -text "Select map type(s)"] -column 1 -row $row 
     3974    foreach typ {DELF FCLC FOBS 2FDF 3FDF 4FDF PTSN DPTS} lbl { 
     3975        "Difference Fourier" "Fcalc Fourier" "Fobs Fourier"  
     3976        "2*Fo-Fc Fourier" "3*Fo-2*Fc Fourier" "4*Fo-3*Fc Fourier" "Patterson map" "Delta-F Patterson"\ 
     3977        } { 
     3978            incr row 
     3979            grid [ \ 
     3980                       checkbutton $box.1.$row -variable ::DXTL($typ) \ 
     3981                       -text "$lbl ($typ)" \ 
     3982                      ] -column 1 -row $row -sticky w 
     3983            if {[lsearch $typelist $typ] == -1} { 
     3984                set ::DXTL($typ) 0 
     3985            } else { 
     3986                set ::DXTL($typ) 1 
     3987            } 
     3988        } 
     3989    grid [label $box.2.a1 -text "Histogram(s) to be used:\n(last superceeds)"] -column 1 -row 1 
     3990    grid [label $box.2.a2 -textvariable ::DXTL(histlist) -width 20] -column 2 -row 1 -columnspan 2 
     3991    grid [button $box.2.a3 -text Set \ 
     3992              -command "SetFourierHists $box"] -column 5 -row 1 
     3993    set ::DXTL(histlist) {} 
     3994    foreach i $histlist { 
     3995        if {$::DXTL(histlist) != ""} {append ::DXTL(histlist) ", "} 
     3996        append ::DXTL(histlist) $i 
     3997    } 
     3998    grid [label $box.2.m1 -text min] -column 2 -row 2 
     3999    grid [label $box.2.m2 -text max] -column 3 -row 2 
     4000    grid [label $box.2.m3 -text "map step\n(A)"] -column 4 -row 2 
     4001    set row 3 
     4002    foreach axis {X Y Z} lim [lrange $limits 1 end] step [lindex $limits 0] { 
     4003        incr row 
     4004        grid [label $box.2.0$axis -text "$axis limits"] -column 1 -row $row -sticky e 
     4005        grid [entry $box.2.min$axis -width 10 -textvariable ::DXTL(min$axis)] -column 2 -row $row 
     4006        grid [entry $box.2.max$axis -width 10 -textvariable ::DXTL(max$axis)] -column 3 -row $row 
     4007        grid [entry $box.2.step$axis -width 10 -textvariable ::DXTL(step$axis)] -column 4 -row $row 
     4008        set ::DXTL(min$axis) [lindex $lim 0] 
     4009        set ::DXTL(max$axis) [lindex $lim 1] 
     4010        set ::DXTL(step$axis) [format "%.4f" [expr {$step + 0.0001}]] 
     4011    } 
     4012    putontop $box 
     4013    tkwait window $box 
     4014    afterputontop 
     4015    if $::DXTL(quit) return 
     4016    delFourier 
     4017    foreach typ {DELF FCLC FOBS 2FDF 3FDF 4FDF PTSN DPTS} { 
     4018        if {$::DXTL($typ)} { 
     4019            addFourier $phase $typ 
     4020        } 
     4021    } 
     4022    if {$::DXTL(histlist) != "<none>"} { 
     4023        FourierHists $phase set [regsub -all "," $::DXTL(histlist) " "] 
     4024    } 
     4025    setFourierLimits $phase \ 
     4026        [list $::DXTL(stepX) $::DXTL(stepY) $::DXTL(stepZ)] \ 
     4027        [list $::DXTL(minX) $::DXTL(maxX)] \ 
     4028        [list $::DXTL(minY) $::DXTL(maxY)] \ 
     4029        [list $::DXTL(minZ) $::DXTL(maxZ)] 
     4030    incr ::expgui(changed) 
     4031} 
     4032 
     4033proc SetFourierHists {top} { 
     4034    set box $top.hstsel 
     4035    set ::DXTL(histbox) $box 
     4036    catch {destroy $box} 
     4037    toplevel $box 
     4038    wm title $box "Select Histograms" 
     4039    grid [frame $box.1 -class HistList] -column 1 -row 1 -sticky news 
     4040    grid columnconfigure $box 1 -weight 1 
     4041    grid [frame $box.2] -column 2 -row 1 
     4042    grid [label $box.2.a -text {Select a histogram from the box 
     4043to the left to add it to the  
     4044histogram list below 
     4045 
     4046(note that reflection intensities  
     4047from the last histograms in list  
     4048override earlier ones) 
     4049 
     4050Histogram List:}] \ 
     4051    -column 1 -row 1 
     4052    grid [label $box.2.b -textvariable ::DXTL(histlist)] -column 1 -row 2 
     4053    grid [button $box.2.c -text Clear -command ClearFourierHist] \ 
     4054        -column 1 -row 3 
     4055    grid [button $box.3 -text Close -command "destroy $box"] \ 
     4056        -column 1 -row 3 -columnspan 2 
     4057    MakeHistBox $box.1 
     4058    bind $box.1.lbox <ButtonRelease-1>  { 
     4059        set selhist [$::DXTL(histbox).1.lbox curselection] 
     4060        if {[llength $selhist] != 1} return 
     4061        AddFourierHist [lindex $::expmap(powderlist) $selhist] 
     4062        lappend ::DXTL(histlist) 
     4063        set hist [lindex $::expmap(powderlist) $selhist] 
     4064        $::DXTL(histbox).2.b config -text $hist 
     4065    } 
     4066    sethistlist 
     4067    putontop $box 
     4068    tkwait window $box 
     4069    afterputontop 
     4070} 
     4071 
     4072proc AddFourierHist {num} { 
     4073    if {$::DXTL(histlist) == "<none>"} { 
     4074        set ::DXTL(histlist) {} 
     4075    } 
     4076    if {$::DXTL(histlist) != ""} {append ::DXTL(histlist) ", "} 
     4077    append ::DXTL(histlist) $num 
     4078} 
     4079 
     4080proc ClearFourierHist {} { 
     4081    set ::DXTL(histlist) "<none>" 
     4082} 
  • trunk/gsasmenu.tcl

    r1166 r1225  
    4040    } 
    4141    graphs { 
     42        forsrh 
    4243        forplot 
    4344        polfplot 
     
    4546        ortep 
    4647        rawplot 
    47         fourier 
    48         forsrh 
    4948        gsas2map 
    5049        liveplot 
  • trunk/import_cif.tcl

    r935 r1225  
    9898        # remove spaces from space group 
    9999        regsub -all " " $sgtmp "" sgtmp 
     100        # check for final H 
     101        if {[string range $sgtmp end end] == "H"} { 
     102            set sgtmp [string range $sgtmp 0 end-1] 
     103        } 
    100104        # make a copy where we treat bar 3 as the same as 3  
    101105        regsub -- "-3" $sgtmp "3" sgtmp3 
  • trunk/readexp.tcl

    r1219 r1225  
    47504750# read a Fourier map entry 
    47514751# returns five values: 
    4752 #   0: type of map (DELF,FCLC,FOBS,NFDF,PTSN,DPTS) 
     4752#   0: type of map (DELF,FCLC,FOBS,*FDF,PTSN,DPTS) 
    47534753#   1: section (X,Y or Z) 
    47544754#   2: phase (1-9) 
     
    47614761    } 
    47624762    set vals {} 
    4763     # 0: type of map (DELF,FCLC,FOBS,NFDF,PTSN,DPTS) 
     4763    # 0: type of map (DELF,FCLC,FOBS,[2-9]FDF,PTSN,DPTS) 
    47644764    lappend vals [string trim [string range [readexp $key] 2 6]] 
    47654765    # 1: section (X,Y or Z) 
     
    47774777#   arguments: 
    47784778#      phase: (1-9) 
    4779 #      type: type of map (DELF,FCLC,FOBS,NFDF,PTSN,DPTS) - default DELF 
     4779#      type: type of map (DELF,FCLC,FOBS,*FDF,PTSN,DPTS) - default DELF 
    47804780#      section: (X,Y or Z) - default Z 
    47814781#   returns the number of the map that is added 
     
    48004800} 
    48014801 
     4802# delete all Fourier map computations 
     4803proc delFourier {} { 
     4804    foreach i {1 2 3 4 5 6 7 8 9} { 
     4805        set key "  FOUR CDAT$i" 
     4806        delexp $key 
     4807    } 
     4808} 
     4809 
    48024810# read/set a Fourier computation value 
    48034811# use: Fourierinfo num parm  
     
    48064814#  num is the Fourier entry 
    48074815#  parm is one of the following 
    4808 #     type    -- type of map (DELF,FCLC,FOBS,NFDF,PTSN,DPTS) 
     4816#     type    -- type of map (DELF,FCLC,FOBS,*FDF,PTSN,DPTS) 
    48094817#     section -- last running map direction (X,Y or Z) 
    48104818#     phase   -- phase (1-9) 
     
    48194827    switch -glob ${parm}-$action { 
    48204828        type-get { 
    4821             # type of map (DELF,FCLC,FOBS,NFDF,PTSN,DPTS) 
     4829            # type of map (DELF,FCLC,FOBS,*FDF,PTSN,DPTS) 
    48224830            return [string trim [string range [readexp $key] 2 6]] 
    48234831        } 
    48244832        type-set { 
    48254833            set found 0 
    4826             foreach val {DELF FCLC FOBS NFDF PTSN DPTS} { 
     4834            foreach val {DELF FCLC FOBS 2FDF 3FDF 4FDF 5FDF 6FDF 7FDF 8FDF 9FDF PTSN DPTS} { 
    48274835                if {$val == $value} { 
    48284836                    set found 1 
     
    49354943    } 
    49364944    set steps {} 
    4937     foreach v {x y z} { 
    4938         set range_$v {} 
    4939         lappend steps [expr {[set cell_$v] / [set step_$v]}] 
    4940         lappend range_$v [expr {[set min_$v] * 1. / [set step_$v] }] 
    4941         lappend range_$v [expr {[set max_$v] * 1. / [set step_$v] }] 
    4942     } 
    4943     return [list $steps $range_x $range_y $range_z] 
     4945    if {[catch { 
     4946        foreach v {x y z} { 
     4947            set range_$v {} 
     4948            lappend steps [expr {[set cell_$v] / [set step_$v]}] 
     4949            lappend range_$v [expr {[set min_$v] * 1. / [set step_$v] }] 
     4950            lappend range_$v [expr {[set max_$v] * 1. / [set step_$v] }] 
     4951        } 
     4952    }]} { 
     4953        return [list {.2 .2 .2} {0 1} {0 1} {0 1}] 
     4954    } else { 
     4955        return [list $steps $range_x $range_y $range_z] 
     4956    } 
    49444957} 
    49454958 
Note: See TracChangeset for help on using the changeset viewer.