📄 sconstruct
字号:
from rsfproj import *n1 = 100thr = 2min = -3max = 3def mygraph(title): return ''' graph title="%s" min2=%f max2=%f ''' %(title,min,max)# DEFINITIONS# Create range and threshold levelFlow('range',None, ''' math n1=%f n2=1 output="%f+(%f-%f)/(%f-1)*x1" ''' %(n1,min,max,min,n1) )Flow('thrpos',None,'math n1=%f n2=1 output="%f" ' %(n1,thr) )Flow('thrneg',None,'math n1=%f n2=1 output="%f" ' %(n1,-thr) )# Thresholding## SoftFlow('soft','range','thr thr=%f' % thr)## HardFlow('hard','range','thr thr=%f mode=hard' % thr)## NNGFlow('nng','range','thr thr=%f mode=nng' % thr)# PlotsPlot('range',mygraph("Data with threshold level") )Plot('thrpos',mygraph(" ") + 'dash=1')Plot('thrneg',mygraph(" ") + 'dash=1')Result('data','range thrpos thrneg','Overlay')Result('soft',mygraph("Soft thresholded data") )Result('hard',mygraph("Hard thresholded data") )Result('nng',mygraph("NNG thresholded data") )# EXAMPLE 1# Create dataFlow('data',None, ''' math n1=%f n2=1 output="1" | noise rep=y ''' % n1 )# Thresholding## SoftFlow('res1','data','thr thr=%f' % thr)## HardFlow('res4','data','thr thr=%f mode=hard' % thr)## NNGFlow('res5','data','thr thr=%f mode=nng' % thr)# PlotsPlot('data',mygraph("Data with threshold level") )Result('data1','data thrpos thrneg','Overlay')Result('soft1','res1',mygraph("Soft thresholded data") )Result('hard1','res4',mygraph("Hard thresholded data") )Result('nng1','res5',mygraph("NNG thresholded data") )End()
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -