up [pdf]
from rsf.proj import *

def plot(title):
    return 'grey titlesz=15 title="%s" wantaxis=n' % title

Flow('make',None,'make n2=20 n=5 p=11 t1=3 t2=3')
Plot('make',plot('original'))

Flow('win','hole','window j2=2 f2=1')
Flow('strip','win','math output=0 | interleave axis=2 $SOURCE')
Plot('strip',plot('gapped'))

Flow(['pef','lag'],'strip',
     'mspef maskin=$SOURCE a=5,3 ns=2 jump=1,2 lag=${TARGETS[1]}')
Flow('gap',['strip','pef'],'msmiss filt=${SOURCES[1]}')
Plot('gap',plot('restored'))

Result('mshole','make strip gap','SideBySideAniso',vppen='txscale=2')

Flow('hole','make','hole')

outs = []
for jump in ([1],[1,4]):
    jumps = string.join(map(str,jump),',')
    pef = 'pef' + jumps
    lag = 'lag' + jumps
    Flow([pef,lag],'hole',
         'mspef maskin=$SOURCE a=5,3 ns=%d jump=%s lag=${TARGETS[1]}' %
         (len(jump),jumps))
    for niter in [1,30]:
        out = 'out%s-%d' % (jumps,niter)
        outs.append(out)
        Flow(out,['hole',pef],'msmiss filt=${SOURCES[1]} niter=%d' % niter)
        Plot(out,plot('%s, iter=%d' %
                      (('singlescale','multiscale')[len(jump)-1],niter)))

Result('msiter',outs,'TwoRows')

###########################################################################
End()

sfmake
sfgrey
sfwindow
sfmath
sfinterleave
sfmspef
sfmsmiss
sfhole