# Use for assigning xpeaks # assign spectrum using another as guide: # Pick one new peak in 2nd spectrum # Put cursor on already assigned peak in 1st spectrum # Press key "a" to copy assignment to 2nd spectrum # Can use key "n" to jump to next peak in 1st spectrum # Use "i" "I" and "o" to move in and out (expansion) # Change names of spectra and peaklists in code below # to match your names. # # Commands # i - expand about k9c cursor # I - more expand about Nhsqc cursor # o - zoom out to predefined axis limits # a - get assignemnt of closest xpeak of Nhsqc # and assign to last xpeak of k9c # # TO CHANGE NAME OF SPECTRA/XPK DATA IN THIS SCRIPT # DO A GLOBAL SEARCH/REPLACE ON THE NAMES IN THE LINES BELOW # # Spectra and associated xpeak lists are # k9c = name of spectrum that is being assigned # sac7dNhsqc = name of spectrum from which assignments are being make # k9cNhList = name of new peak list that is being assigned # sac7dNhList = name of peak list being used to make assignments bind .sac7dNhsqc {assign} proc assign {} { set pid [nv_peak closest sac7dNhList] echo $pid nv_peak panel $pid set lbln [nv_peak elem N15.L $pid] set lblh [nv_peak elem H1.L $pid] set pknum [nv_peak n k9cNhList] set pkn [expr $pknum-1] nv_peak elem N15.L k9cNhList.$pkn $lbln nv_peak elem H1.L k9cNhList.$pkn $lblh nv_peak panel $pid } bind .sac7dNhsqc {next} proc next {} { set xrng [expr 0.3] set yrng [expr 2.75] set pid [nv_peak closest sac7dNhList] set pknum [nv_peak idnum $pid] set newpid [expr $pknum+1] echo now using k9c peak number $newpid set px [nv_peak elem H1.P $newpid] set py [nv_peak elem N15.P $newpid] set x1 [expr $px+$xrng] set x2 [expr $px-$xrng] set y1 [expr $py+$yrng] set y2 [expr $py-$yrng] nv_win act .sac7dNhsqc.0 nv_win x $x1 $x2 nv_win y $y1 $y2 nv_win draw nv_win act .k9c.0 nv_win x $x1 $x2 nv_win y $y1 $y2 nv_win draw nv_win act .sac7dNhsqc.0 } bind .sac7dNhsqc {expand} proc expand {} { set xrng [expr 0.6] set yrng [expr 5.5] nv_win act .sac7dNhsqc.0 set px [nv_win cross1x] set py [nv_win cross1y] set xl [expr $px-$xrng] set xh [expr $px+$xrng] set yl [expr $py-$yrng] set yh [expr $py+$yrng] nv_win x $xl $xh nv_win y $yl $yh nv_win draw nv_win act .k9c.0 nv_win x $xl $xh nv_win y $yl $yh nv_win draw } bind .sac7dNhsqc {expand2} proc expand2 {} { set xrng [expr 0.3] set yrng [expr 2.75] nv_win act .sac7dNhsqc.0 set px [nv_win cross1x] set py [nv_win cross1y] set xl [expr $px-$xrng] set xh [expr $px+$xrng] set yl [expr $py-$yrng] set yh [expr $py+$yrng] nv_win x $xl $xh nv_win y $yl $yh nv_win draw nv_win act .k9c.0 nv_win x $xl $xh nv_win y $yl $yh nv_win draw } bind .sac7dNhsqc {compress} proc compress {} { set x1 [expr 9.77] set x2 [expr 6.67] set y1 [expr 131.4] set y2 [expr 102.1] nv_win act .sac7dNhsqc.0 nv_win x $x1 $x2 nv_win y $y1 $y2 nv_win draw nv_win act .k9c.0 nv_win x $x1 $x2 nv_win y $y1 $y2 nv_win draw nv_win act .sac7dNhsqc.0 }