up [pdf]
from rsf.proj import *
Flow('velx',None,
     '''
     spike n1=512 d1=5 k1=98 n2=512 d2=5 k2=98 |
     math output="800+0.0001*(x1-1000)*(x1-1000)+0.0001*(x2-1200)*(x2-1200)"
     ''')
Result('velx',
       '''
       grey transp=n pclip=100 screenration=1 color=i
       label1="X" label2="Z" scalebar=y poly=y bias=1000
       unit1= unit2=  title=Vx 
       ''')
Flow('velz',None,
     '''
     spike n1=512 d1=5 k1=98 n2=512 d2=5 k2=98 |
     math output="700+0.0001*(x1-1200)*(x1-1200)"
     ''')
Result('velz',
       '''
       grey transp=n pclip=100 screenration=1 color=i
       label1="X" label2="Z" scalebar=y poly=y bias=800
       unit1= unit2=  title=Vz 
       ''')
Flow('yita_c',None,
     '''
     spike n1=512 d1=5 k1=98 n2=512 d2=5 k2=98 |
     math output=0.3
     ''')
Result('yita_c',
       '''
       grey transp=n pclip=100 screenration=1 color=i
       label1="X" label2="Z" scalebar=y poly=y bias=0.1
       unit1= unit2=  title=Yita
       ''')
Flow('seta_45',None,
     '''
     spike n1=512 d1=5 k1=98 n2=512 d2=5 k2=98 |
     math output=45
     ''')
Flow('seta_90',None,
     '''
     spike n1=512 d1=5 k1=98 n2=512 d2=5 k2=98 |
     math output=90
     ''')
Result('seta_45',
       '''
       grey transp=n pclip=100 screenration=1 color=i
       label1="X" label2="Z" scalebar=y poly=y bias=0.1
       unit1= unit2=  title=seta
       ''')
nt=851
dt=0.002
Flow('source',None,
     '''
     spike n1=%d d1=%g k1=100 | 
     ricker1 frequency=20 
     '''%(nt,dt))
Result('source','graph  title="Source Wavelet" ')

Flow('vc','velx',
     '''
     math output="exp(-256*((x1-1280)*(x1-1280)+(x2-1280)*(x2-1280)))"
     ''')

Flow('G_25c s1c s2c','velz velx yita_c seta_45',
     '''
     lfdanc2_25 dt=%g eps=0.0001 npk=20 DE=1 size=17 
     velx=${SOURCES[1]} eta=${SOURCES[2]} seta=${SOURCES[3]}
     s1=${TARGETS[1]} s2=${TARGETS[2]}
     '''%(dt))
Flow('wavanc','source velz G_25c s1c s2c',
     '''
     ofd2_25 vel=${SOURCES[1]} G=${SOURCES[2]} isx=256 isz=256
     s1=${SOURCES[3]} s2=${SOURCES[4]}
     dt=%g nt=%d 
     '''%(dt,nt))
Result('wavanc',
       ''' 
       window j3=200 | grey poly=y label2="X" label1="Z" title="Lowrank FD"
       yreverse=y transp=y gainpanel=each pclip=100
       ''' )

#Flow('TTI-snapshot','wavanc','window n3=1 f3=1000')
#Result('TTI-snapshot',
#     '''
#     grey poly=y label2="Z" label1="X" title="TTI 45 degree" screenratio=1
#     yreverse=y transp=n gainpanel=all pclip=100 unit1=m unit2=m
#     ''')


Flow('snapshotlfd','wavanc','window j3=150 max3=1.6 | stack axis=3')
Result('snapshotlfd',
       '''
       grey label2="Z" label1="X" title="Lowrank FD" screenratio=1
        yreverse=y transp=n gainpanel=all unit1=m unit2=m
       ''')

nt=1701
dt=0.001
nt=1200
dt=0.0015
Flow('source1',None,
     '''
     spike n1=%d d1=%g k1=133 | 
     ricker1 frequency=20 
     '''%(nt,dt))

Flow('G_25_lffdc s1_lffdc s2_lffdc parsc','velz velx yita_c seta_45',
     '''
     lffdan dt=%g eps=0.000001 npk=30 DE=1 size=9  
     velx=${SOURCES[1]} eta=${SOURCES[2]} seta=${SOURCES[3]}
     s1=${TARGETS[1]} s2=${TARGETS[2]} paras=${TARGETS[3]}
     '''%(dt))
Flow('wavan_lffdc','source1 velz G_25_lffdc parsc s1_lffdc s2_lffdc',
#Flow('wavan_lffdc','source velz G_25_lffdc parsc s1_lffdc s2_lffdc',
     '''
     lffd2an25 velz=${SOURCES[1]} 
     G=${SOURCES[2]} paras=${SOURCES[3]}      
     s1=${SOURCES[4]} s2=${SOURCES[5]}
     isx=256 isz=256
     dt=%g nt=%d factor=0.8 ax=2.0 az=2.0
     '''%(dt,nt))
Result('wavan_lffdc',
       '''
       window j3=10 | grey poly=y label2="X" label1="Z" title="Lowrank FFD"
       yreverse=y transp=y gainpanel=each pclip=99
       ''' )
Flow('snapshotlffd','wavan_lffdc','window j3=10 max3=1.6 | stack axis=3')
Result('snapshotlffd',
       '''
       grey label2="Z" label1="X" title="Lowrank FFD" screenratio=1
        yreverse=y transp=n gainpanel=all unit1=m unit2=m
       ''')
#nt=1701
#dt=0.001
#Flow('source2',None,
#     '''
#     spike n1=%d d1=%g k1=200 | 
#     ricker1 frequency=20 
#     '''%(nt,dt))
#Flow('G_25_lffdd s1_lffdd s2_lffdd parsd','velz velx yita_c seta_45',
#     '''
#     lffdand dt=%g eps=0.000001 npk=30 DE=1  
#     velx=${SOURCES[1]} eta=${SOURCES[2]} seta=${SOURCES[3]}
#     s1=${TARGETS[1]} s2=${TARGETS[2]} paras=${TARGETS[3]}
#     size=5
#     '''%dt)
#Flow('wavan_lffdd','source2 velz G_25_lffdd parsd s1_lffdd s2_lffdd',
#     '''
#     lffd2an25 velz=${SOURCES[1]} 
#     G=${SOURCES[2]} paras=${SOURCES[3]}      
#     s1=${SOURCES[4]} s2=${SOURCES[5]}
#     isx=256 isz=256
#     dt=%g nt=%d factor=0.8 ax=2.0 az=2.0
#     '''%(dt,nt))
#Result('wavan_lffdd',
#       '''
#       window j3=10 | grey poly=y label2="X" label1="Z" title="Lowrank FFD"
#       yreverse=y transp=y gainpanel=each pclip=99
#       ''' )
#Flow('G_25_lffde s1_lffde s2_lffde parse','velz velx yita_c seta_45',
#     '''
#     lffdanc dt=%g eps=0.000001 npk=30 DE=1  
#     velx=${SOURCES[1]} eta=${SOURCES[2]} seta=${SOURCES[3]}
#     s1=${TARGETS[1]} s2=${TARGETS[2]} paras=${TARGETS[3]}
#     size=5
#     '''%dt)
#Flow('wavan_lffde','source2 velz G_25_lffde parse s1_lffde s2_lffde',
#     '''
#     lffd2anc velz=${SOURCES[1]} 
#     G=${SOURCES[2]} paras=${SOURCES[3]}      
#     s1=${SOURCES[4]} s2=${SOURCES[5]}
#     isx=256 isz=256
#     dt=%g nt=%d factor=0.8 ax=2.0 az=2.0
#     '''%(dt,nt))
#Result('wavan_lffde',
#       '''
#       window j3=10 | grey poly=y label2="X" label1="Z" title="Lowrank FFD"
#       yreverse=y transp=y gainpanel=each pclip=99
#       ''' )
End()

sfspike
sfmath
sfgrey
sfricker1
sfgraph
sflfdanc2_25
sfofd2_25
sfwindow
sfstack
sflffdan
sflffd2an25