```from rsf.proj import * dtt = 0.0001 nt = 1001 dt = 0.0002 factor = dt/dtt Flow('source1',None, ''' spike n1=%d d1=%g k1=200 | ricker1 frequency=100 '''%(nt*factor,dtt)) Flow('real','source1','math "output=0"') Flow('imag','source1','envelope hilb=y order=500 | halfint | halfint | math output="input/2" ') Flow('csource1','real imag','cmplx \${SOURCES[1]}') Flow('csource','csource1','window j1=%d'% factor) Flow('source','source1','window j1=%d'% factor) Result('source','graph title="Source Wavelet" ') par = { 'dt' : dt, 'w0' : 1500, 'nz' : 512, 'nx' : 512, 'dz' : 2, 'dx' : 2, 'kz' : 256, 'kx' : 256, 'vel': 2164, 'q' : 10 } Flow('vel',None,'spike n1=%(nz)d n2=%(nx)d d1=%(dz)g d2=%(dx)g mag=%(vel)g' %par) Flow('constq',None,'spike n1=%(nz)d n2=%(nx)d d1=%(dz)g d2=%(dx)g mag=%(q)g' %par) Flow('q-0','constq','math output=100') Flow('q-1','constq','math output=30') Flow('q-2','constq','math output=10') Flow('q-3','constq','math output=4') Flow('refl',None, ''' spike n1=%(nz)d n2=%(nx)d d1=%(dz)g d2=%(dx)g o1=0 o2=0 unit1=m unit2=m k1=%(kz)d k2=%(kx)d | smooth rect1=2 rect2=2 repeat=1 '''% par) # Lowrank decomposition Flow('fft','vel','rtoc | fft3 axis=1 pad=1 | fft3 axis=2 pad=1') for m in range(0,4): right = 'right-%d' %m left = 'left-%d' %m wave = 'wave-%d' %m snap = 'snap-%d' %m qq = 'q-%d' %m Flow([right,left],['vel','fft',qq], ''' zfraclr2 seed=2010 npk=10 eps=0.00001 dt=%(dt)g w0=%(w0)g fft=\${SOURCES[1]} q=\${SOURCES[2]} left=\${TARGETS[1]} mode=0 rev=n sign=0 ''' % par) Flow(wave,['csource','refl',left,right], ''' cfftwave2 ref=\${SOURCES[1]} left=\${SOURCES[2]} right=\${SOURCES[3]} verb=y cmplx=n ''') Flow(snap,wave, ''' window n3=1 f3=900 ''') Result(snap, ''' grey wanttitle=n label1=Z label2=X label3=Y gainpanel=all ''') Flow('cut0','snap-0','cut f1=256 | cut f2=256') Flow('cut1','snap-1','cut f1=256 | cut n2=256') Flow('cut2','snap-2','cut n1=256 | cut f2=256') Flow('cut3','snap-3','cut n1=256 | cut n2=256') Flow('comp','cut0 cut1 cut2 cut3','add \${SOURCES[1:4]}') Plot('comp','grey wanttitle=n label1=Z label2=X label3=Y gainpanel=all screenratio=1 pclip=96 wantaxis=y') Flow('line1',None,'math n1=%(nx)d d1=%(dx)g o1=0 output="256" ' %par) Plot('line1', ''' graph wanttitle=n max1=512 min1=0 max2=0 min2=512 dash=3 wantaxis=n plotcol=0 screenratio=1 plotfat=2 ''') Flow('line2',None,'math n1=%(nz)d n2=%(nx)d d1=%(dz)g d2=%(dx)g o1=0 o2=0 output="256" ' %par) Plot('line2', ''' graph transp=y wanttitle=n max1=0 min1=512 max2=512 min2=0 dash=3 wantaxis=n plotcol=0 screenratio=1 plotfat=2 ''') Result('comp','comp line1 line2','Overlay') #Flow('line2',None,'math d1=0.05 n1=5 d2=0.01 n2=1001 output="6.1" ') End() ```