up [pdf]
from rsf.proj import *

Fetch('trace.HH','mig')
Flow('trace','trace.HH','dd form=native')

Flow('hdr.asc',None,
     'echo 4780 5450 1200 in=$TARGET n1=3 data_format=ascii_float')
Flow('hdr','hdr.asc','dd form=native')

def mig(antialias,steep=''):
    return '''
    window min1=0 | 
    mig%s3 vel=1500 antialias=%s
    n2=300 d2=20 o2=1780
    n3=100 d3=20 o3=4450
    n1=200 hdr=${SOURCES[1]} |
    put o2=0 o3=0
    ''' % (steep,antialias)

Flow('aal','trace hdr',mig('triangle'))
Flow('noa','trace hdr',mig('none'))
Flow('fla','trace hdr',mig('flat'))
Flow('dip','trace hdr',mig('','steep'))
Flow('all','fla dip','add ${SOURCES[1]}')

for case in Split('aal noa fla dip all'):
    Plot('t'+case,case,
         '''
         window n1=1 min1=1 |
         transp plane=12 |
         grey pclip=95 wanttitle=n titlefat=0 grid1=n d1num=1000
         label1="CMP Y" unit1=m label2="CMP X" unit2=m labelsz=8 labelfat=2
         ''')
    Plot('t2'+case,'t'+case,'Overlay',
         vppen='vpstyle=n big=n vshift=6 xscale=.7 yscale=.35')
    Plot('y'+case,case,
         '''
         window n3=1 min3=1000 |
         grey pclip=95 wanttitle=n titlefat=0 grid1=n d1num=1 wantaxis2=n
         label1=Time unit1=s label2="CMP X" unit2=m labelsz=8 labelfat=2
         ''')
    Plot('y2'+case,'y'+case,'Overlay',
         vppen='vpstyle=n big=n vshift=0 scale=.7')
    Result('imp-'+case,['t2'+case,'y2'+case],'Overlay',
           vppen='vpstyle=n big=n scale=1.05')

End()

sfdd
sfwindow
sfmig3
sfput
sfmigsteep3
sfadd
sftransp
sfgrey

data/mig/trace.HH