search 1 # search $1 # plot the data, then try a wide range of smoothings # plot the S/N as a function of boxcar width # data $1 read {y 1} set x=1,$(dimen(y)) limits x y box connect x y stats y a s k vecminmax y mn mx echo sigma=rms= $s for $(dimen(y)) points echo ave $a +- $($s/sqrt(dimen(y))) echo max $mx +- $s (S/N = $($mx/$s)) echo min $mn +- $s (S/N = $(abs($mn/$s))) set dimen(ym)=80 set dimen(yn)=80 do i=5,400,5 { smooth y ys $i set yk=ys if(x>$i/2 && x$1/2 && x$1 && x<$2) stats ylim a s k echo sigma=rms= $s for $(dimen(ylim)) points echo ave $a +- $($s/sqrt(dimen(y))) echo max $mx +- $s (S/N = $($mx/$s)) echo min $mn +- $s (S/N = $(abs($mn/$s))) return skip 2 # skip $1 $2 # re-evaluate stats excluding a limited region # set ylim1=yk if(xx<$1) set ylim2=yk if(xx>$2) set ylim=ylim1 concat ylim2 stats ylim a s k echo Exclude region $1 to $2 from RMS echo sigma=rms= $s for $(dimen(ylim)) points echo ave $a +- $($s/sqrt(dimen(y))) echo max $mx +- $s (S/N = $($mx/$s)) echo min $mn +- $s (S/N = $(abs($mn/$s))) relocate $1 -1 draw $1 1 relocate $2 -1 draw $2 1 return