up [pdf]
from rsf.proj import *

def cube(title):
    return '''
    byte gainpanel=all |
    grey3 frame1=60 frame2=60 frame3=25
    flat=n point1=0.85 point2=0.74
    title="%s"
    ''' % title

Flow('qdome',None,'qdome n1=200 d1=0.008 impedance=y | smooth rect1=4')
Result('qdome',cube('Qdome Model'))

Flow('dip','qdome','dip rect1=5 rect2=5 rect3=5 order=3')

Flow('mask','qdome',
     'window n1=1 | noise rep=y type=n seed=1234 mean=0.5 | mask min=0.6')
Flow('qhole','qdome mask','headercut mask=${SOURCES[1]}')
Flow('qmask','mask','spray axis=1 n=200 | dd type=float')

Flow('qdip','qhole qmask',
     'dip rect1=5 rect2=5 rect3=5 order=3 mask=${SOURCES[1]}')

for dip in ('dip','qdip'):
    for case in range(2):
        dip1 = dip+str(case)

        Flow(dip1,dip,'window n4=1 f4=%d' % case)
        Plot(dip1,cube('XY'[case] + ' slope') + ' color=j')

Result('qslope','dip0 dip1','SideBySideIso')
Result('pslope','qdip0 qdip1','SideBySideIso')

Flow('qmiss','qhole qmask dip',
     '''
     factorn nt=20 nx=20 niter=10 npx=50 npy=50 
     mask=${SOURCES[1]} dip=${SOURCES[2]} miter=100
     ''')

Plot('qhole',cube('60% Removed'))
Plot('qmiss',cube('Interpolated'))

Result('qmiss','qhole qmiss','SideBySideIso')

Flow('pmiss','qhole qmask qdip',
     '''
     planemis3 mask=${SOURCES[1]} dip=${SOURCES[2]}
     order=3 niter=20 verb=y
     ''')

Result('pmiss',cube('Interpolated'))

End()

sfqdome
sfsmooth
sfbyte
sfgrey3
sfdip
sfwindow
sfnoise
sfmask
sfheadercut
sfspray
sfdd
sffactorn
sfplanemis3