- Timestamp:
- Feb 26, 2011 9:47:37 PM (13 years ago)
- Location:
- branches/sandbox
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/sandbox/doc/expgui.html
r973 r1115 16 16 EXPGUI<BR> 17 17 A Graphical User Interface for 18 <A Href="http ://www.ncnr.nist.gov/programs/crystallography/software/gsas.html">18 <A Href="https://subversion.xor.aps.anl.gov/trac/EXPGUI/wiki/GSASIntro"> 19 19 GSAS</A> 20 20 <HR noshade width="75%" size="2" align="center"> … … 34 34 <P><P> 35 35 EXPGUI is a graphical interface for the 36 Los Alamos 37 <A Href="http://www.ncnr.nist.gov/programs/crystallography/software/gsas.html"> 38 GSAS</A> package. 36 <A Href="https://subversion.xor.aps.anl.gov/trac/EXPGUI/wiki/GSASIntro">GSAS</A> 37 package, developed at Los Alamos and maintained now at Argonne. 39 38 EXPGUI does two things: 40 39 it can be used to directly modify the GSAS … … 117 116 A.C. Larson and R.B. Von Dreele, "General Structure Analysis System (GSAS)", 118 117 Los Alamos National Laboratory Report LAUR 86-748 (2000). 119 <A HREF="http://www.ccp14.ac.uk/ccp/ccp14/ftp-mirror/gsas/public/gsas/manual/GSASManual.pdf"> 118 <A 119 HREF="https://subversion.xor.aps.anl.gov/EXPGUI/gsas/all/GSAS%20Manual.pdf"> 120 120 [link to PDF copy of manual] 121 121 </A> … … 154 154 are used. The File/Save operation is done automatically before any GSAS 155 155 programs, such as GENLES or EXPEDT, are run. 156 <P> 157 <A name="badexp"> 158 The GSAS refinement program, GENLES, will sometimes "blow up", where the 159 program changes varied parameters to values very far from their 160 correct values. This occurs when parameters are highly correlated, 161 are refining to values that are not allowed, or some of the refined parameters have 162 very little impact on the quality of the fit. When this happens, 163 invalid values are written to the GSAS experiment file that contain 164 either asterisks (****) or the string "NAN" (not a number). Such 165 files cannot be used for additional GENLES runs. 166 <P> 167 When EXPGUI reads a .EXP file it scans it for evidence of a previous 168 failure of a GENLES refinement and warns if a problem is 169 noted. Please note that this scan is not perfect and occasionally 170 you may be warned in cases where the file is fine (if possible, 171 please send such .EXP file to Brian Toby so this scan can be improved.) 172 When such a "bad" .EXP file is located, one can "revert" to an 173 archived copy of a previous experiment file (with suffix .Oxx). This 174 can be done with the Revert menu item in the File menu. Note that 175 clicking on a file in the file selection window causes it to be 176 scanned and shows the status of that refinement. Also note that 177 usually the last good archived file has settings that will produce the same bad 178 refinement, so it is necessary to either revert further back, or to 179 change the refinement options before running GENLES. 156 180 <P> 157 181 … … 681 705 <A name=tcltk> 682 706 <H2> 683 <A Href="http://www. ncnr.nist.gov/programs/crystallography/software/tclpkgs.html">707 <A Href="http://www.tcl.tk"> 684 708 Tcl/Tk</A></H2> 685 709 The 686 <A Href="http://www. ncnr.nist.gov/programs/crystallography/software/tclpkgs.html">710 <A Href="http://www.tcl.tk"> 687 711 Tcl/Tk program</A> is a platform-independent scripting language that is 688 712 used to implement most of EXPGUI. This software is available for free 689 and must be loaded in order to use EXPGUI. See the 690 installation notes for 691 <A HREF="expgui_Win_readme.html">Windows</A>, 692 and for 693 <A HREF="expgui_Unix_readme.html">UNIX</A> for information on how to do this. 713 and must be loaded in order to use EXPGUI. A somewhat out of date 714 version of Tcl/Tk (8.4) is distributed with EXPGUI (ncnrpack.exe, etc.) but 715 more recent versions can be used, but note that the BLT package (see 716 below) is needed for all features of EXPGUI. 694 717 While learning Tcl/Tk is a great thing to do, it is not a requirement 695 718 for using or installing EXPGUI. 696 697 <A name=winexec>698 <H3>699 WINEXEC</H3>700 <UL>701 The WINEXEC package is needed under Windows-95 and its offspring702 (-98 and -ME). See the <A HREF="expgui_Win_readme.html">Windows installation703 notes</A> for more details.704 </UL>705 719 706 720 <A name=blt> … … 715 729 If this is the case, a message, 716 730 "BLT Setup Error: could not access a Blt_ routine...", will be displayed. 717 This is most common in UNIX and is discussed further in the 718 <A HREF="expgui_Unix_readme.html">UNIX installation notes</A>. Also see 719 <A HREF="http://www.ncnr.nist.gov/programs/crystallography/software/tclpkgs.html"> 720 http://www.ncnr.nist.gov/programs/crystallography/software/tclpkgs.html 721 </A> for more information on installation of BLT. 731 Use of the ncnrpack file distributed with EXPGUI usually avoids this problem. 722 732 </UL> 723 733 … … 727 737 <UL> 728 738 The 729 <A HREF=" www.hume.com">Hume739 <A HREF="http://www.hume.com">Hume 730 740 </A> 731 741 Linear Algebra Tcl Package, 732 <A HREF=" www.hume.com">742 <A HREF="http://www.hume.com/la/la.html"> 733 743 La</A>, 734 744 is used by the BKGEDIT … … 739 749 should not happen, since the package is included with the EXPGUI files. 740 750 So if get this error you probably have an incomplete installation. 741 Note that the La package requires Tcl/Tk version 8.1 or higher, so that if 742 you are using an older version of Tcl/Tk, you will need to upgrade. 743 See the installation instructions for 744 <A HREF="expgui_Win_readme.html">Windows</A>, 745 and for 746 <A HREF="expgui_Unix_readme.html">UNIX</A> for more information on Tcl/Tk. 751 </UL> 752 753 <A name=winexec> 754 <H3> 755 WINEXEC</H3> 756 <UL> 757 The WINEXEC package was needed under Windows-95 and its offspring 758 (-98 and -ME). It was found in older versions of EXPGUI, but is no 759 longer included. 747 760 </UL> 748 761 … … 750 763 Acknowledgments</H2> 751 764 Praise to Larson and 752 Von Dreele for GSAS, <A HREF="http:// www.scriptics.com/">Ousterhout</A>765 Von Dreele for GSAS, <A HREF="http://home.pacbell.net/ouster/">John Ousterhout</A> 753 766 for Tcl/Tk, 754 Przemek Klosowski </A>767 Przemek Klosowski 755 768 for convincing me to learn Tcl/Tk 756 and Jonathan Wasserman for helping get this project started. 757 Thanks also to 769 and Jonathan Wasserman for helping me get this project started. 770 Thanks also to 771 Charles Lake of Indiana University of PA for working on many recent additions to EXPGUI, including the 772 bond-distance restraints module and the (soon to come) rigid body editor; 758 773 Pamela Whitfield of the NRC (Canada) for writing large 759 774 sections of the … … 763 778 code and to John Cowgill for the "Export to GRACE" code. 764 779 <P> 765 <A Href="http ://www.ncnr.nist.gov/programs/crystallography/software/gsas.html">780 <A Href="https://subversion.xor.aps.anl.gov/trac/EXPGUI/wiki/GSASIntro"> 766 781 GSAS</A> 767 782 is written by Allen C. Larson and Robert B. Von Dreele while at … … 770 785 <A HREF="MAILTO:vondreele@anl.gov">vondreele@anl.gov</A> 771 786 EXPGUI was written by Brian H. Toby while at the NIST Center for Neutron Research, 772 <A HREF="MAILTO:Brian.Toby@ANL.GOV">Brian.Toby@ANL.GOV</A> 773 with help from Jonathan Wasserman. 787 <A HREF="MAILTO:Brian.Toby@ANL.GOV">Brian.Toby@ANL.GOV</A>. 774 788 775 789 <P><hr><blockquote> … … 786 800 software. 787 801 788 <P> The author of EXPGUI is a U.S. Government employeewhich means that802 <P>EXPGUI was written by a U.S. Government employee, which means that 789 803 EXPGUI is not subject to copyright. Have fun with it. Modify it. Please write 790 804 new sections and make them available to the rest of the world. … … 793 807 expressed or implied, or assumes any liability or responsibility 794 808 for the use of this information or the software described 795 here. Brand names cited herein are used for 796 identification purposes and do not constitute an endorsement by NIST. 809 here. 797 810 </blockquote> 798 811 -
branches/sandbox/doc/expgui_intro.html
r971 r1115 70 70 Customization notes</A> 71 71 <LI> 72 <A HREF=" tutorial3/index.html">72 <A HREF="https://subversion.xor.aps.anl.gov/EXPGUI/tutorials/tutorial3/index.html"> 73 73 A well-annotated CW neutron tutorial (Alumina).</A> 74 74 <B><I>A very good place to start!</I></B> 75 75 <LI> 76 <A HREF=" tutorial1/index.html">76 <A HREF="https://subversion.xor.aps.anl.gov/EXPGUI/tutorials/tutorial1/index.html"> 77 77 A TOF Tutorial Example (Nickel)</A> 78 78 <LI> 79 <A HREF=" tutorial2/index.html">79 <A HREF="https://subversion.xor.aps.anl.gov/EXPGUI/tutorials/tutorial2/index.html"> 80 80 A CW Neutron Tutorial Example (Garnet)</A> 81 81 </UL> … … 164 164 <p><br><B>Who is to blame for EXPGUI?</B> 165 165 <blockquote>The initial version of the GUI part of EXPGUI was created by 166 Jonathan Wasserman (thanks Jon!) <a href="http://www.ncnr.nist.gov/staff/toby/">Brian166 Jonathan Wasserman (thanks Jon!) Brian 167 167 Toby</a> is irresponsible for the rest.</blockquote> 168 168 … … 170 170 <blockquote>Gee, you want to add some features... Great! You have all the 171 171 EXPGUI sources and 172 <A Href="http://www.ncnr.nist.gov/programs/crystallography/software/tclpkgs.html">Tcl/Tk</A> 173 is free. Oh, you want me to do it. Well, please 172 Tcl/Tk is free. Oh, you want me to do it. Well, please 174 173 ask and I will try. In particular, I am looking for good ideas on 175 174 how to design GUI's for different aspects of experiment editing, … … 177 176 178 177 <p><br><B>Mailing List</B> 179 <blockquote>If you would like to get news about EXPGUI, please send 180 <a href="mailto:brian.toby@anl.gov?subject=EXPGUI Mailing List">Brian.Toby@ANL.GOV</a> e-mail. The mailing list is not active at present, but 181 I hope to use it again to provide 178 <blockquote>If you would like to get news about EXPGUI, please 179 <a href="http://www.aps.anl.gov/mailman/listinfo/expgui">see this 180 link</a>. 181 The mailing list is used only to provide 182 182 information about updates and bug fixes. 183 183 </blockquote> -
branches/sandbox/expgui
r1112 r1115 1 #!/bin/sh 1 #!/bin/sh 2 2 # the next line restarts this script using wish found in the path\ 3 3 exec wish "$0" "$@" … … 157 157 # setup DISAGL viewer & editor 158 158 source [file join $expgui(scriptdir) disagledit.tcl] 159 source [file join $expgui(scriptdir) geo_viewer.tcl]159 source [file join $expgui(scriptdir) Geo_Viewer.tcl] 160 160 #--------------------------------------------------------------------------- 161 161 # override options with locally defined values … … 406 406 # start checking for external changes 407 407 afterawhile 408 # check if the file seems corrupt 409 set warnings [ScanEXPforError] 410 if {$warnings != ""} { 411 ExplainEXPerror . $warnings $expfile 412 } 408 413 } 409 414 … … 548 553 set expgui(curhist) {} 549 554 } 550 if {[CountHistory] > 100} {551 DeleteHistoryRecords "This .EXP file has [CountHistory] history records\nErasing most will speed EXPGUI"552 }555 # if {[CountHistory] > 100} { 556 # DeleteHistoryRecords "This .EXP file has [CountHistory] history records\nErasing most will speed EXPGUI" 557 # } 553 558 } 554 559 … … 4519 4524 update 4520 4525 SetStartPanel 4521 if {[CountHistory] > 200} {4522 DeleteHistoryRecords "This .EXP file has [CountHistory] history records\nErasing most will speed EXPGUI"4523 }4526 #if {[CountHistory] > 200} { 4527 # DeleteHistoryRecords "This .EXP file has [CountHistory] history records\nErasing most will speed EXPGUI" 4528 #} -
branches/sandbox/gsascmds.tcl
r1036 r1115 1026 1026 } 1027 1027 } 1028 # so sorry, have to use Internet Explorer1028 # so sorry, have to use Safari, even if not default 1029 1029 set url [file nativename $url]; # replace ~/ if present 1030 1030 if {[file pathtype $url] == "relative"} { 1031 1031 set url [file join [pwd] $url] 1032 1032 } 1033 exec osascript -e "tell application \" Internet Explorer\"\rGetURL \"file://$url\"\rend tell"1033 exec osascript -e "tell application \"Safari\" to open location \"file://$url\"" 1034 1034 } elseif {$tcl_platform(platform) == "unix"} { 1035 1035 set browserlist {} … … 2696 2696 return 2697 2697 } 2698 2699 proc ScanEXPforError {"ns {}"} { 2700 # record types to ignore 2701 set ignorelist {DESCR HSTRY PNAM HNAM "REFN STATS"} 2702 set warn {} 2703 set badkeylist {} 2704 # scan file for warnings 2705 foreach key [array names ${ns}::exparray] { 2706 if {[string first "***" [set ${ns}::exparray($key)]] != -1 || 2707 [string first "nan" [set ${ns}::exparray($key)]] != -1 || 2708 [string first "NAN" [set ${ns}::exparray($key)]] != -1 2709 } { 2710 #puts [set ${ns}::exparray($key)] 2711 set OK 0 2712 foreach i $ignorelist { 2713 if {[string first $i $key] != -1} { 2714 set OK 1 2715 break 2716 } 2717 } 2718 # ignore atom name section of Atom records 2719 if {(! $OK) && [string match "CRS*AT*A" $key]} { 2720 foreach str [list [string range [set ${ns}::exparray($key)] 0 49] 2721 [string range [set ${ns}::exparray($key)] 58 end]] { 2722 if {[string first "***" $str] || [string first "nan" $str] || [string first "NAN" $str]} { 2723 append warn " Record \"$key\": [set ${ns}::exparray($key)]\n" 2724 lappend badkeylist $key 2725 break 2726 } 2727 } 2728 continue 2729 } 2730 if {! $OK} { 2731 append warn " Record \"$key\": [set ${ns}::exparray($key)]\n" 2732 lappend badkeylist $key 2733 } 2734 } 2735 } 2736 if {$warn == ""} return 2737 set hint "" 2738 set unknown "" 2739 foreach key $badkeylist { 2740 if {[string match "CRS*AT*" $key]} { 2741 if {[string first "atomic parameter" $hint] == -1} { 2742 append hint "\t* An atomic parameter (coordinate, occupancy or U) appears out of range\n" 2743 } 2744 } elseif {[string match "CRS*ABC*" $key] || 2745 [string match "CRS*ANGLES*" $key] || 2746 [string match "CRS*CELVOL*" $key]} { 2747 if {[string first "cell parameter" $hint] == -1} { 2748 append hint "\t* A unit cell parameter appears out of range\n" 2749 } 2750 } elseif {[string match "CRS*ODF*" $key]} { 2751 if {[string first "spherical harmonic" $hint] == -1} { 2752 append hint "\t* A spherical harmonic (ODF) parameter appears out of range\n" 2753 } 2754 } elseif {[string match "HST*ICONS" $key]} { 2755 if {[string first "diffractometer constant" $hint] == -1} { 2756 append hint "\t* A diffractometer constant (wave, DIFC,...) appears out of range\n" 2757 } 2758 } elseif {[string match "HST*TRNGE" $key]} { 2759 if {[string first "histogram data range" $hint] == -1} { 2760 append hint "\t* A histogram data range value appears out of range\n" 2761 } 2762 } elseif {[string match "*GNLS RUN*" $key] || 2763 [string match "*GNLS SHFTS" $key] || 2764 [string match "HST*RPOWD" $key] || 2765 [string match " REFN RPOWD " $key] || 2766 [string match " REFN GDNFT " $key] 2767 } { 2768 if {[string first "refinement statistics" $hint] == -1} { 2769 append hint "\t* The refinement statistics imply the last refinement diverged\n" 2770 } 2771 } else { 2772 lappend unknown $key 2773 } 2774 } 2775 if {$unknown != ""} { 2776 append hint "\t* The following less common problem record(s) appear out of range:\n\t\t" 2777 foreach key $unknown { 2778 append hint "\"" [string trim $key] "\" " 2779 } 2780 } 2781 return "Likely error(s) noted:\n$hint\nDetails of problem(s):\n$warn" 2782 } 2783 2784 proc ExplainEXPerror {parent message file} { 2785 if {$parent == "."} { 2786 set w .experr 2787 } else { 2788 set w $parent.experr 2789 } 2790 catch {destroy $w} 2791 toplevel $w -class Dialog 2792 wm title $w "Corrupt .EXP file" 2793 wm iconname $w Dialog 2794 wm protocol $w WM_DELETE_WINDOW { } 2795 # Make the message box transient if the parent is viewable. 2796 if {[winfo viewable [winfo toplevel $parent]] } { 2797 wm transient $w $parent 2798 } 2799 frame $w.bot 2800 pack $w.bot -side bottom -fill both 2801 frame $w.top 2802 pack $w.top -side top -fill both -expand 1 2803 frame $w.msg 2804 pack $w.msg -in $w.top -side right -expand 1 -fill both -padx 3m -pady 3m 2805 set txt {Likely errors were noted when reading this file} 2806 append txt " ([file tail $file]). " 2807 append txt "These problems probably\narose from the last refinement, " 2808 append txt "based on settings applied in the previous saved file.\n" 2809 append txt "It is probably not possible to continue with this file.\n" 2810 append txt "You likely need to revert at least two archived versions back." 2811 grid [label $w.msg.s -text $txt -justify left] -row 0 -column 0 -sticky nws 2812 grid [button $w.msg.1 -text Help -bg yellow \ 2813 -command "MakeWWWHelp expgui.html badexp"] -row 0 -column 1 -columnspan 2 -sticky ne 2814 bind $w <Key-F1> "MakeWWWHelp expgui.html badexp" 2815 set filelist [lsort -dictionary -decreasing \ 2816 [glob -nocomplain \ 2817 [file root $file.O* ]]] 2818 grid [text $w.msg.t -font {Times 12} \ 2819 -height 10 -width 90 -relief flat -wrap word \ 2820 -yscrollcommand "$w.msg.rscr set" \ 2821 ] -row 1 -column 0 -columnspan 2 -sticky news 2822 grid [scrollbar $w.msg.rscr -command "$w.msg.t yview" \ 2823 ] -row 1 -column 2 -sticky ns 2824 # give extra space to the text box 2825 grid columnconfigure $w.msg 0 -weight 1 2826 grid rowconfigure $w.msg 1 -weight 1 2827 $w.msg.t insert end $message 2828 button $w.ok -command [list destroy $w] -text OK -default active 2829 pack $w.ok -in $w.bot -side left -expand 1 -padx 3m -pady 2m 2830 putontop $w 2831 tkwait window $w 2832 afterputontop 2833 } 2834 2698 2835 proc UpdateInfoBox {} { 2699 2836 global expgui … … 2702 2839 set file [file join [set expgui(FileMenuDir)] $expgui(FileMenuEXPNAM)] 2703 2840 if [file isdirectory $file] return 2704 if [file exists $file] { 2841 if [file exists $file] { 2705 2842 pack [label $expgui(FileInfoBox).1 -text $expgui(FileMenuEXPNAM)] \ 2706 2843 -side top 2707 2844 catch { 2845 # load the EXP file into a namespace & scan for errors 2846 expload $file scan 2847 set warnings [ScanEXPforError scan] 2848 if {$warnings != ""} { 2849 pack [frame $expgui(FileInfoBox).1a -bg yellow -padx 4 -pady 4] -side top 2850 pack [label $expgui(FileInfoBox).1a.err -justify left \ 2851 -text "WARNING: Likely corrupt" -bg yellow] \ 2852 -side left -anchor w -fill both 2853 pack [button $expgui(FileInfoBox).1a.show \ 2854 -text "More..." -padx 0 \ 2855 -command "ExplainEXPerror $expgui(FileInfoBox) [list $warnings] $file"\ 2856 ] -side right -anchor w 2857 } 2708 2858 set fp [open $file r] 2709 2859 global testline … … 2716 2866 -text "last GENLES run:\n $last\n total cycles: $cycles"] \ 2717 2867 -side top -anchor w 2868 set chi2 ? 2869 set vars ? 2718 2870 regexp {REFN GDNFT.*= *([0-9]*\.[0-9]*) +for *([0-9]+) variables} \ 2719 2871 $testline a chi2 vars … … 2754 2906 -text $lbl] \ 2755 2907 -side top -anchor w 2756 } 2908 } err 2757 2909 } 2758 2910 } … … 2864 3016 if {$expgui(expfile) == [file join $expgui(FileMenuDir) $file]} { 2865 3017 $files selection set $i 3018 set expgui(FileMenuEXPNAM) $file 3019 UpdateInfoBox 2866 3020 } 2867 3021 } -
branches/sandbox/readexp.tcl
r1109 r1115 9 9 # returns 1 if the file is 80 char/line + cr/lf 10 10 # returns 2 if the file is sequential but not fixed-record length 11 proc expload {expfile} { 12 global exparray tcl_platform 13 # $expfile is the path to the data file. 14 11 proc expload {expfile "ns {}"} { 12 # expfile is the path to the data file. 13 # ns is the namespace to place the output array (default is global) 14 if {$ns != ""} { 15 namespace eval $ns {} 16 } 15 17 if [catch {set fil [open "$expfile" r]}] { 16 18 tk_dialog .expFileErrorMsg "File Open Error" \ … … 27 29 } 28 30 catch { 29 unset exparray31 unset ${ns}::exparray 30 32 } 31 33 if {$len > 160} { … … 39 41 incr i2 80 40 42 set key [string range $nline 0 11] 41 set exparray($key) [string range $nline 12 end]43 set ${ns}::exparray($key) [string range $nline 12 end] 42 44 } 43 45 } else { … … 45 47 while {$len > 0} { 46 48 set key [string range $line 0 11] 47 set exparray($key) [string range $line 12 79]49 set ${ns}::exparray($key) [string range $line 12 79] 48 50 if {$len != 81 || [string range $line end end] != "\r"} {set fmt 2} 49 51 set len [gets $fil line]
Note: See TracChangeset
for help on using the changeset viewer.