Changeset 78


Ignore:
Timestamp:
Dec 4, 2009 5:00:02 PM (11 years ago)
Author:
toby
Message:

# on 1999/04/06 22:27:03, toby did:
add background subtraction
adjust pixelregion for hkl labeling
move tickmarks before histogram in File menu

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/liveplot

    • Property rcs:date changed from 1999/04/06 21:13:49 to 1999/04/06 22:27:03
    • Property rcs:lines changed from +203 -33 to +31 -16
    • Property rcs:rev changed from 1.7 to 1.8
    r76 r78  
    11#!/usr/local/bin/wish
    2 # $RCSfile: liveplot,v $
     2# $Id$
    33set Revision {$Revision$ $Date$}
    44
     
    2323}
    2424
     25set graph(backsub) 0
    2526
    2627if {$tcl_platform(platform) == "windows"} {
     
    4546set expgui(fadetime) 10
    4647set expgui(hklbox) 1
     48set expgui(pixelregion) 5
    4749set peakinfo(obssym) scross
    4850set peakinfo(obssize) 1.0
     
    321323    refposvec set $refpos
    322324    diffvec set [obsvec - calcvec]
     325    if $graph(backsub) {
     326        obsvec set [obsvec - bckvec]
     327        calcvec set [calcvec - bckvec]
     328    }
    323329    global obsvec calcvec diffvec
    324330    set maxdiff  [set diffvec(max)]
     
    337343    global refhkllist refphaselist peakinfo refpos
    338344    # look for peaks within pixelregion pixels
    339     set pixelregion 5
    340     set xmin [$plot xaxis invtransform [expr $x - $pixelregion]]
    341     set xmax [$plot xaxis invtransform [expr $x + $pixelregion]]
     345    set xmin [$plot xaxis invtransform [expr $x - $expgui(pixelregion)]]
     346    set xmax [$plot xaxis invtransform [expr $x + $expgui(pixelregion)]]
    342347    set peaknums [refposvec search $xmin $xmax]
    343348    set peaklist {}
     
    623628    pack [frame $box.d] -side top  -anchor w
    624629    pack [label $box.d.l -text "HKL label size:"] -side left
    625     pack [entry $box.d.e -textvariable expgui(lblfontsize) -width 8] \
     630    pack [entry $box.d.e -textvariable expgui(lblfontsize) -width 4] \
    626631            -side left
    627632    pack [label $box.d.l1 -text pixels] -side left
     
    632637        $box.d.l1 config -fg #888
    633638    }
     639    pack [frame $box.f] -side top  -anchor w
     640    pack [label $box.f.l -text "HKL search region:"] -side left
     641    pack [entry $box.f.e -textvariable expgui(pixelregion) -width 3] \
     642            -side left
     643    pack [label $box.f.l1 -text pixels] -side left
    634644    pack [frame $box.e] -side top  -anchor w
    635645    pack [checkbutton $box.e.b -text "Separate window for HKL labels"\
     
    661671            -from .1 -to 3 -resolution 0.05] -side top
    662672    pack [frame $box.a] -side bottom
    663     pack [button $box.a.1 -text "Apply" \
    664             -command {set peakinfo(obssym) $expgui(obssym); \
    665             set peakinfo(obssize) $expgui(obssize)} ] -side left
     673    pack [button $box.a.1 -text "Apply" -command { \
     674            if {$peakinfo(obssym) != $expgui(obssym)} {set peakinfo(obssym) $expgui(obssym)}; \
     675            if {$peakinfo(obssize) != $expgui(obssize)} {set peakinfo(obssize) $expgui(obssize)} \
     676        } ] -side left
    666677    pack [button $box.a.2 -text "Close" -command "destroy $box"] -side left
    667678}
     
    680691    puts $fp "set peakinfo(obssym) $peakinfo(obssym)"
    681692    puts $fp "set peakinfo(obssize) $peakinfo(obssize)"
     693    puts $fp "set expgui(pixelregion) $expgui(pixelregion)"
    682694
    683695    close $fp
     
    791803pack [menubutton .a.file -text File -underline 0 -menu .a.file.menu] -side left
    792804menu .a.file.menu
     805.a.file.menu add cascade -label Tickmarks -menu .a.file.menu.tick
     806menu .a.file.menu.tick
     807foreach num {1 2 3 4 5 6 7 8 9} {
     808    .a.file.menu.tick add checkbutton -label "Phase $num" \
     809            -variable  peakinfo(flag$num) \
     810            -command {plotdata $box}
     811}
    793812.a.file.menu add cascade -label "Histogram" -menu .a.file.menu.hist
    794813menu .a.file.menu.hist
     
    802821                -command {set cycle [getcycle];readdata .g}
    803822    }
    804 }
    805 .a.file.menu add cascade -label Tickmarks -menu .a.file.menu.tick
    806 menu .a.file.menu.tick
    807 foreach num {1 2 3 4 5 6 7 8 9} {
    808     .a.file.menu.tick add checkbutton -label "Phase $num" \
    809             -variable  peakinfo(flag$num) \
    810             -command {plotdata $box}
    811823}
    812824.a.file.menu add command -label "Update Plot" \
     
    846858            -command {set cycle [getcycle];readdata .g}
    847859    .a.options.menu add command -label "HKL labeling" -command setlblopts
     860    .a.options.menu add checkbutton -label "Subtract background" \
     861            -variable graph(backsub) \
     862            -command {set cycle [getcycle];readdata .g}
    848863}
    849864   
Note: See TracChangeset for help on using the changeset viewer.