Changeset 1221 for branches/sandbox


Ignore:
Timestamp:
Sep 21, 2012 5:56:33 PM (8 years ago)
Author:
toby
Message:

more Fourier work; remove warning on R *3* H sg in CIF

Location:
branches/sandbox
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/sandbox/expgui

    r1220 r1221  
    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
     
    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 ] {
  • branches/sandbox/export_drawxtl.tcl

    r1220 r1221  
    162162              -command "$bx.f.canvas yview"] -sticky ns -row 3 -column 2
    163163    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
    165166    grid [button [set ::DXTL(FourCompute) $bx.f.1.2] -text "Compute\nFourier" \
    166167              -command {DXTLwritegrd $expgui(export_phase)}] -column 1 -row 0
     
    186187    trace variable ::expgui(export_phase) w OnNewFourierPhase
    187188    OnNewFourierPhase
    188 #SetupFourierButtons
    189 #return
    190189    # this appears to be needed by OSX
    191190    ResizeWin .export
     
    584583# and the files that are present
    585584proc 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
    590591    set ::DXTL(mtype) ""
    591592    set ::DXTL(mfil) ""
     
    619620        incr i
    620621    }
    621 }
    622 
    623 proc EditFourier {} {
    624     set phase $::expgui(export_phase)
    625     # check that all Fourier records are set to the current phase
    626     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.fourier
    638     catch {destroy $box}
    639     toplevel $box
    640     grid [frame $box.1] -row 1 -column 1 -rowspan 10
    641     grid [frame $box.2] -row 1 -column 2 -rowspan 10
    642     grid [frame $box.b] -sticky news -row 11 -column 1 -columnspan 2
    643     grid columnconfigure $box.b 0 -weight 1
    644     grid columnconfigure $box.b 3 -weight 1
    645     grid [button $box.b.1 -text Continue \
    646               -command "set ::DXTL(quit) 0; destroy $box" \
    647              ] -row 1 -column 1
    648     grid [button $box.b.2 -text Quit \
    649               -command "set ::DXTL(quit) 1; destroy $box" \
    650              ] -row 1 -column 2
    651    
    652     # map type selection
    653     set row 0
    654     grid [label $box.1.$row -text "Select map type(s)"] -column 1 -row $row
    655     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 row
    660             grid [ \
    661                        checkbutton $box.1.$row -variable ::DXTL($typ) \
    662                        -text "$lbl ($typ)" \
    663                       ] -column 1 -row $row -sticky w
    664             if {[lsearch $typelist $typ] == -1} {
    665                 set ::DXTL($typ) 0
    666             } else {
    667                 set ::DXTL($typ) 1
    668             }
    669         }
    670     grid [label $box.2.a1 -text "Histogram(s) to be used\n(last superceeds)"] -column 1 -row 1
    671     grid [entry $box.2.a2 -textvariable ::DXTL(histlist) -width 20] -column 2 -row 1 -columnspan 3
    672     set ::DXTL(histlist) $histlist
    673     grid [label $box.2.m1 -text min] -column 2 -row 2
    674     grid [label $box.2.m2 -text max] -column 3 -row 2
    675     grid [label $box.2.m3 -text "map step\n(A)"] -column 4 -row 2
    676     set row 3
    677     foreach axis {X Y Z} lim [lrange $limits 1 end] step [lindex $limits 0] {
    678         incr row
    679         grid [label $box.2.0$axis -text "$axis limits"] -column 1 -row $row -sticky e
    680         grid [entry $box.2.min$axis -width 10 -textvariable ::DXTL(min$axis)] -column 2 -row $row
    681         grid [entry $box.2.max$axis -width 10 -textvariable ::DXTL(max$axis)] -column 3 -row $row
    682         grid [entry $box.2.step$axis -width 10 -textvariable ::DXTL(step$axis)] -column 4 -row $row
    683         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 $box
    688     tkwait window $box
    689     afterputontop
    690     if $::DXTL(quit) return
    691     delFourier
    692     foreach typ {DELF FCLC FOBS 2FDF 3FDF 4FDF PTSN DPTS} {
    693         if {$::DXTL($typ)} {
    694             addFourier $phase $typ
    695         }
    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     SetupFourierButtons
    704     incr ::expgui(changed)
    705622}
    706623
  • branches/sandbox/gsascmds.tcl

    r1216 r1221  
    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}
  • branches/sandbox/gsasmenu.tcl

    r1157 r1221  
    4040    }
    4141    graphs {
     42        forsrh
    4243        forplot
    4344        polfplot
     
    4546        ortep
    4647        rawplot
    47         fourier
    48         forsrh
    4948        gsas2map
    5049        liveplot
  • branches/sandbox/import_cif.tcl

    r935 r1221  
    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
Note: See TracChangeset for help on using the changeset viewer.