Changeset 992


Ignore:
Timestamp:
Jul 29, 2010 10:07:52 AM (10 years ago)
Author:
toby
Message:

changes for POWGEN: profile #<0; use data limits from prm file for TOF

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/addcmds.tcl

    r991 r992  
    695695        if {[llength $newhist(banklist)] == $newhist(instbanks)} {
    696696            set newhist(setnum) $newhist(banknum)
     697            # at Ashfia's request, override the bank header # with the
     698            # value from the instrument parameter file.
     699            catch {
     700                set s $newhist(setnum)
     701                foreach {x tmin tmax x} $newhist(inst${s}ITYP) {}
     702                if {$tmin > 0} {set newhist(2tLimit) $tmin}
     703            }
    697704        }
    698705    } else {
     
    13111318    frame [set cfr $top.canvas.fr]
    13121319    $top.canvas create window 0 0 -anchor nw -window $cfr
    1313     grid [label $top.top -text "Select banks to add" -bg beige] \
    1314             -column 0 -columnspan 3 -row 0 -sticky ew
     1320    grid [label $top.top \
     1321              -text "Select banks to add; set the\nuseful range of data, limiting\nthe # of reflections." -anchor w -justify left \
     1322              -bg beige] -column 0 -columnspan 3 -row 0 -sticky ew
    13151323    grid [frame $top.vartyp -bd 2 -relief groove] \
    13161324            -column 0 -columnspan 3 -row 1 -sticky ew
    13171325    grid [label $top.vartyp.top -text "Data limit units:"] -column 0 -row 0 -columnspan 3 -sticky w
    1318     grid [radiobutton $top.vartyp.cb3 -text "d-min" -variable newhist(LimitMode) \
     1326    grid [radiobutton $top.vartyp.cb3 -text "d-min\n(A)" -variable newhist(LimitMode) \
    13191327            -value 0] -column 0 -row 1 -sticky w
    13201328    grid [radiobutton $top.vartyp.cb4 -textvariable newhist(datalimlbl)  \
    13211329            -variable newhist(LimitMode) -anchor w -justify l \
    13221330            -value 1] -column 1 -row 1 -sticky w
    1323     grid [radiobutton $top.vartyp.cb5 -text "Q-max" -variable newhist(LimitMode) \
     1331    grid [radiobutton $top.vartyp.cb5 -text "Q-max\n(A-1)" -variable newhist(LimitMode) \
    13241332            -value 2] -column 2 -row 1 -sticky w
    13251333    set newhist(LimitMode) 1
     
    13351343        default {set newhist(datalimlbl) "2theta\nmax"}
    13361344    }
    1337     grid [label $cfr.t2 -textvariable newhist(datalimlbl)] -column 1 -row 0
     1345    grid [label $cfr.t2 -text "Upper\ndata limit"] -column 1 -row 0
    13381346    foreach i $newhist(banklist) {
    13391347        grid [checkbutton $cfr.c$i -text $i \
     
    13461354        if {$newhist(insttype) == "TOF"} {
    13471355            set newhist(tlimit$i) $newhist(tmin$i)
     1356            catch {
     1357                foreach {x tmin tmax x} $newhist(inst${i}ITYP) {}
     1358                if {$tmin > 0} {set newhist(tlimit$i) $tmin}
     1359            }
    13481360        } else {
    13491361            set newhist(tlimit$i) $newhist(tmax$i)
  • trunk/expgui

    r987 r992  
    24592459            set row 1
    24602460            set nterms [hapinfo $hist $i profterms]
    2461             set lbls "dummy [GetProfileTerms $i $hist $ptype]"
     2461            set lbls "dummy [GetProfileTerms $i $hist [expr abs($ptype)]]"
    24622462            for { set num 1 } { $num <= $nterms } { incr num } {
    24632463                set term {}
     
    25312531                set nterms [hapinfo $hist1 $phase1 profterms]
    25322532                set htype [string range $expmap(htype_$hist1) 2 2]
    2533                 set lbls "dummy [GetProfileTerms $phase1 $hist1 $ptype]"
     2533                set lbls "dummy [GetProfileTerms $phase1 $hist1 [expr abs($ptype)]]"
    25342534                # Create a frame for this type
    25352535                incr i
     
    30213021    set col -1
    30223022    set row 1
    3023     set lbls "dummy [GetProfileTerms $phase $hist $ptype]"
     3023    set lbls "dummy [GetProfileTerms $phase $hist [expr abs($ptype)]]"
    30243024    pack [frame $w.1 -bd 6 -relief groove  -bg beige \
    30253025            ] -side top -expand yes -fill both
  • trunk/gsascmds.tcl

    r989 r992  
    762762    foreach lbls $lbllist {
    763763        incr i
    764         $menu add command -label $i -command \
    765                 "set expgui(newpeaktype) $i; \
    766                 FillChangeProfileType $w.c $hist $phase $i [list $lbls] [list $oldlbls]"
     764        set j $i
     765        # determine if negative profiles are allowed
     766        if {[string range $expmap(htype_$hist) 2 2] == "T"} {
     767            if {[histinfo $hist proftbl] > 0 && $i > 2} {
     768                set j -$i
     769            }
     770        }
     771        $menu add command -label $j -command \
     772                "set expgui(newpeaktype) $j; \
     773                FillChangeProfileType $w.c $hist $phase $j [list $lbls] [list $oldlbls]"
    767774    }
    768775    set expgui(newpeaktype) $ptype
  • trunk/readexp.tcl

    r930 r992  
    12691269#     absdamp -- damping for absorption refinement (*)
    12701270#     absref -- refinement damping for absorption refinement (*)
     1271#     proftbl -- returns number of profile table termns
    12711272#   parameters transferred from the instrument parameter file:
    12721273#     ITYP    -- returns the contents of the ITYP record
     
    18361837            ITYP-get {
    18371838                return [string trim [readexp "${key}I ITYP"]]
     1839            }
     1840            proftbl-get {
     1841                set line [readexp "${key}PAB3"]
     1842                if {$line == ""} {return 0}
     1843                set val [string trim [string range $line 0 4]]
     1844                if {$val == ""} {return 0}
     1845                return $val
    18381846            }
    18391847            default {
Note: See TracChangeset for help on using the changeset viewer.