- Timestamp:
- Sep 21, 2012 5:56:33 PM (11 years ago)
- Location:
- branches/sandbox
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/sandbox/expgui
r1220 r1221 70 70 set expgui(HistSelectList) {} 71 71 # location for web pages, if not found locally 72 set expgui(website) 11bm.xor.aps.anl.gov/expguidoc/72 set expgui(website) subversion.xray.aps.anl.gov/EXPGUI/trunk/doc/ 73 73 # default for archive mode = on 74 74 set expgui(archive) 1 … … 4452 4452 CIFselect $expgui(expfile) 4453 4453 } 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 4454 4465 # add the commands in expgui_menulist 4455 4466 foreach menu [array names expgui_menulist ] { -
branches/sandbox/export_drawxtl.tcl
r1220 r1221 162 162 -command "$bx.f.canvas yview"] -sticky ns -row 3 -column 2 163 163 grid [button $bx.f.1.1 -text "Setup\nFourier" \ 164 -command EditFourier] -column 0 -row 0 164 -command {EditFourier $::expgui(export_phase); SetupFourierButtons} \ 165 ] -column 0 -row 0 165 166 grid [button [set ::DXTL(FourCompute) $bx.f.1.2] -text "Compute\nFourier" \ 166 167 -command {DXTLwritegrd $expgui(export_phase)}] -column 1 -row 0 … … 186 187 trace variable ::expgui(export_phase) w OnNewFourierPhase 187 188 OnNewFourierPhase 188 #SetupFourierButtons189 #return190 189 # this appears to be needed by OSX 191 190 ResizeWin .export … … 584 583 # and the files that are present 585 584 proc SetupFourierButtons {} { 586 set phase $::expgui(export_phase) 587 $::DXTL(FourCompute) config -state disabled 588 $::DXTL(AddContour) config -state disabled 589 $::DXTL(fmenu) delete 0 end 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 590 591 set ::DXTL(mtype) "" 591 592 set ::DXTL(mfil) "" … … 619 620 incr i 620 621 } 621 }622 623 proc EditFourier {} {624 set phase $::expgui(export_phase)625 # check that all Fourier records are set to the current phase626 foreach i [listFourier] {627 set ph [Fourierinfo $i phase]628 if {$ph != $phase} {Fourierinfo $i phase set $phase}629 }630 # for now we will not offer access to section, (dmin, dmax not supported)631 set typelist {}632 foreach i [listFourier] {633 lappend typelist [Fourierinfo $i type]634 }635 set histlist [FourierHists $phase]636 set limits [getFourierLimits $phase]637 set box .export.fourier638 catch {destroy $box}639 toplevel $box640 grid [frame $box.1] -row 1 -column 1 -rowspan 10641 grid [frame $box.2] -row 1 -column 2 -rowspan 10642 grid [frame $box.b] -sticky news -row 11 -column 1 -columnspan 2643 grid columnconfigure $box.b 0 -weight 1644 grid columnconfigure $box.b 3 -weight 1645 grid [button $box.b.1 -text Continue \646 -command "set ::DXTL(quit) 0; destroy $box" \647 ] -row 1 -column 1648 grid [button $box.b.2 -text Quit \649 -command "set ::DXTL(quit) 1; destroy $box" \650 ] -row 1 -column 2651 652 # map type selection653 set row 0654 grid [label $box.1.$row -text "Select map type(s)"] -column 1 -row $row655 foreach typ {DELF FCLC FOBS 2FDF 3FDF 4FDF PTSN DPTS} lbl {656 "Difference Fourier" "Fcalc Fourier" "Fobs Fourier"657 "2*Fo-Fc Fourier" "3*Fo-2*Fc Fourier" "4*Fo-3*Fc Fourier" "Patterson map" "Delta-F Patterson"\658 } {659 incr row660 grid [ \661 checkbutton $box.1.$row -variable ::DXTL($typ) \662 -text "$lbl ($typ)" \663 ] -column 1 -row $row -sticky w664 if {[lsearch $typelist $typ] == -1} {665 set ::DXTL($typ) 0666 } else {667 set ::DXTL($typ) 1668 }669 }670 grid [label $box.2.a1 -text "Histogram(s) to be used\n(last superceeds)"] -column 1 -row 1671 grid [entry $box.2.a2 -textvariable ::DXTL(histlist) -width 20] -column 2 -row 1 -columnspan 3672 set ::DXTL(histlist) $histlist673 grid [label $box.2.m1 -text min] -column 2 -row 2674 grid [label $box.2.m2 -text max] -column 3 -row 2675 grid [label $box.2.m3 -text "map step\n(A)"] -column 4 -row 2676 set row 3677 foreach axis {X Y Z} lim [lrange $limits 1 end] step [lindex $limits 0] {678 incr row679 grid [label $box.2.0$axis -text "$axis limits"] -column 1 -row $row -sticky e680 grid [entry $box.2.min$axis -width 10 -textvariable ::DXTL(min$axis)] -column 2 -row $row681 grid [entry $box.2.max$axis -width 10 -textvariable ::DXTL(max$axis)] -column 3 -row $row682 grid [entry $box.2.step$axis -width 10 -textvariable ::DXTL(step$axis)] -column 4 -row $row683 set ::DXTL(min$axis) [lindex $lim 0]684 set ::DXTL(max$axis) [lindex $lim 1]685 set ::DXTL(step$axis) [format "%.4f" [expr {$step + 0.0001}]]686 }687 putontop $box688 tkwait window $box689 afterputontop690 if $::DXTL(quit) return691 delFourier692 foreach typ {DELF FCLC FOBS 2FDF 3FDF 4FDF PTSN DPTS} {693 if {$::DXTL($typ)} {694 addFourier $phase $typ695 }696 }697 FourierHists $phase set $::DXTL(histlist)698 setFourierLimits $phase \699 [list $::DXTL(stepX) $::DXTL(stepY) $::DXTL(stepZ)] \700 [list $::DXTL(minX) $::DXTL(maxX)] \701 [list $::DXTL(minY) $::DXTL(maxY)] \702 [list $::DXTL(minZ) $::DXTL(maxZ)]703 SetupFourierButtons704 incr ::expgui(changed)705 622 } 706 623 -
branches/sandbox/gsascmds.tcl
r1216 r1221 3932 3932 exit 3933 3933 } 3934 3935 # Fourier routines 3936 proc 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 4033 proc 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 4043 to the left to add it to the 4044 histogram list below 4045 4046 (note that reflection intensities 4047 from the last histograms in list 4048 override earlier ones) 4049 4050 Histogram 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 4072 proc 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 4080 proc ClearFourierHist {} { 4081 set ::DXTL(histlist) "<none>" 4082 } -
branches/sandbox/gsasmenu.tcl
r1157 r1221 40 40 } 41 41 graphs { 42 forsrh 42 43 forplot 43 44 polfplot … … 45 46 ortep 46 47 rawplot 47 fourier48 forsrh49 48 gsas2map 50 49 liveplot -
branches/sandbox/import_cif.tcl
r935 r1221 98 98 # remove spaces from space group 99 99 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 } 100 104 # make a copy where we treat bar 3 as the same as 3 101 105 regsub -- "-3" $sgtmp "3" sgtmp3
Note: See TracChangeset
for help on using the changeset viewer.