Changeset 780 for trunk/liveplot
- Timestamp:
- Dec 4, 2009 5:11:54 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/liveplot
- Property rcs:date changed from 2003/12/05 12:54:08 to 2004/04/27 14:07:39
- Property rcs:lines changed from +8 -5 to +70 -9
- Property rcs:rev changed from 1.38 to 1.39
r758 r780 52 52 set yunits {} 53 53 set graph(chi2) 0 54 set graph(OmCoS) 0 54 55 set graph(xunits) 0 55 56 set graph(yunits) 0 … … 57 58 set graph(color_diff) blue 58 59 set graph(color_chi2) magenta 60 set graph(color_OmCoS) magenta 59 61 set graph(color_bkg) green 60 62 set graph(color_obs) black … … 426 428 wifdvec set [wifdvec / [wifdvec length]] 427 429 } 430 if {$graph(OmCoS)} { 431 wifdvec set $WGT 432 wifdvec expr sqrt(wifdvec) 433 wifdvec set [wifdvec * diffvec] 434 } 428 435 if $graph(backsub) { 429 436 obsvec set [obsvec - bckvec] … … 570 577 -symbol $peakinfo(obssym) -color $graph(color_obs) \ 571 578 -pixels [expr 0.125 * $peakinfo(obssize)]i 572 $box element config 0 -color $graph(color_chi2) 579 if $graph(chi2) { 580 $box element config 0 -dash 0 -line 3 -color $graph(color_chi2) 581 } else { 582 $box element config 0 -dash 4 -line 2 -color $graph(color_OmCoS) 583 } 573 584 $box element config 1 -color $graph(color_bkg) 574 585 $box element config 2 -color $graph(color_calc) … … 700 711 if {$color == ""} return 701 712 set peakinfo(color$num) $color 713 } 714 715 proc setSymcolor {var lbl} { 716 global graph 717 set color [tk_chooseColor -initialcolor $graph(color_$var) \ 718 -title "Choose $lbl color"] 719 if {$color == ""} return 720 set graph(color_$var) $color 702 721 } 703 722 … … 957 976 } 958 977 puts $fp "# LIVEPLOT saved options from [clock format [clock seconds]]" 959 foreach v {printout legend outname outcmd autoraise chi2 xunits yunits } {978 foreach v {printout legend outname outcmd autoraise chi2 xunits yunits OmCoS} { 960 979 puts $fp "set graph($v) [list $graph($v)]" 961 980 } 962 foreach v {diff chi2 bkg calc obs input fit } {981 foreach v {diff chi2 bkg calc obs input fit OmCoS} { 963 982 puts $fp "set graph(color_$v) [list $graph(color_$v)]" 964 983 } … … 1057 1076 global graph box 1058 1077 if $graph(chi2) { 1078 catch {$box y2axis config -min 0} 1079 $box y2axis config -title {Cumulative Chi Squared} 1059 1080 eval $box y2axis config $graph(ElementShowOption) 1060 1081 eval $box element config 0 $graph(ElementShowOption) -label "Chi2" 1082 #$box elem conf 0 -dash 0 -line 3 1083 set cycle [getcycle] 1084 readdata .g 1085 } elseif $graph(OmCoS) { 1086 catch {$box y2axis config -min ""} 1087 $box y2axis config -title {(obs-calc)/sigma} 1088 eval $box y2axis config $graph(ElementShowOption) 1089 eval $box element config 0 $graph(ElementShowOption) -label "(O-C)/s" 1090 #$box elem conf 0 -dash 4 -line 2 1061 1091 set cycle [getcycle] 1062 1092 readdata .g … … 1067 1097 } 1068 1098 } 1099 1069 1100 # evaluate the Chebyshev polynomial with coefficients A at point x 1070 1101 # coordinates are rescaled from $xmin=-1 to $xmax=1 … … 1883 1914 "x=[format %.3f [$graph(blt) xaxis invtransform $x]] y=[format %.3f [$graph(blt) yaxis invtransform $y]]" 1884 1915 } 1916 1885 1917 #------------------------------------------------------------------------- 1886 1918 # override options with locally defined values … … 2073 2105 .a.options.menu add cascade -label "Symbol color" -menu .a.options.menu.color 2074 2106 menu .a.options.menu.color 2075 set l1 {obs calc diff bkg chi2 }2076 set l2 {Observed Calculated Obs-Calc Background Cumulative-Chi2 }2107 set l1 {obs calc diff bkg chi2 OmCoS} 2108 set l2 {Observed Calculated Obs-Calc Background Cumulative-Chi2 (obs-calc)/sig} 2077 2109 if {$program != "liveplot"} { 2078 2110 lappend l1 input fit … … 2082 2114 foreach var $l1 lbl $l2 { 2083 2115 .a.options.menu.color add command -label $lbl \ 2084 -command "set graph(color_$var) \[tk_chooseColor -initialcolor \$graph(color_$var) -title \"Choose \$lbl color\"]; plotdata"2116 -command "setSymcolor $var $lbl; plotdata" 2085 2117 } 2086 2118 if {$expgui(tcldump) != "" && $program == "liveplot"} { … … 2131 2163 -variable graph(autoraise) 2132 2164 .a.options.menu add checkbutton -label "Cumulative Chi2" \ 2133 -variable graph(chi2) -command ShowCumulativeChi2 2165 -variable graph(chi2) \ 2166 -command "set graph(OmCoS) 0; ShowCumulativeChi2" 2167 .a.options.menu add checkbutton -label "(Obs-Calc)/sig" \ 2168 -variable graph(OmCoS) \ 2169 -command "set graph(chi2) 0; ShowCumulativeChi2" 2134 2170 .a.options.menu add command -label "Save Options" -underline 1 \ 2135 2171 -command "SaveOptions" … … 2357 2393 bind . <Key-l> {ToggleLiveCursor} 2358 2394 bind . <Key-L> {ToggleLiveCursor} 2395 # move the zoom region around 2396 proc ScanZoom {box key frac} { 2397 foreach var {xl xh yl yh} axis {xaxis xaxis yaxis yaxis} \ 2398 flg {-min -max -min -max} { 2399 set $var [$box $axis cget $flg] 2400 if {$var == ""} return 2401 } 2402 catch { 2403 switch -- $key { 2404 Right {set a x; set l $xl; set h $xh; set d [expr {$frac*($h-$l)}]} 2405 Left {set a x; set l $xl; set h $xh; set d [expr {-$frac*($h-$l)}]} 2406 Up {set a y; set l $yl; set h $yh; set d [expr {$frac*($h-$l)}]} 2407 Down {set a y; set l $yl; set h $yh; set d [expr {-$frac*($h-$l)}]} 2408 } 2409 $box ${a}axis configure -min [expr {$l + $d}] -max [expr {$h + $d}] 2410 } 2411 } 2412 bind . <Key-Up> "ScanZoom $box %K .1" 2413 bind . <Key-Left> "ScanZoom $box %K .1" 2414 bind . <Key-Right> "ScanZoom $box %K .1" 2415 bind . <Key-Down> "ScanZoom $box %K .1" 2416 bind . <Control-Key-Up> "ScanZoom $box %K 1.0" 2417 bind . <Control-Key-Left> "ScanZoom $box %K 1.0" 2418 bind . <Control-Key-Right> "ScanZoom $box %K 1.0" 2419 bind . <Control-Key-Down> "ScanZoom $box %K 1.0" 2359 2420 # seems to be needed in OSX 2360 2421 update
Note: See TracChangeset
for help on using the changeset viewer.