from rsf.proj import *
from rsf.prog import RSFROOT
Nt=1000
dt=0.004
t0=0
Nx=400
dx=0.025
x0=-5
Ny=Nx
dy=dx
y0=x0
Flow('Vavg',None,'math n1=%d d1=%g o1=%g output="1/(1.5+0.25*x1)^2" ' % (Nt,dt,t0))
Flow('Vcos',None,'math n1=%d d1=%g o1=%g output="0.06/(1.5+0.25*x1)^2*cos(2*(1.*sin(3*x1)))" ' % (Nt,dt,t0))
Flow('Vsin',None,'math n1=%d d1=%g o1=%g output="0.06/(1.5+0.25*x1)^2*sin(2*(1.*sin(3*x1)))" ' % (Nt,dt,t0))
Result('Vavg','graph transp=y yreverse=y min2=0.1 max2=0.5 plotfat=7 plotcol=4 pad=n title="Wavg (s\^2\_/km\^2\_)" label1=Time unit1=s')
Result('Vcos','graph transp=y yreverse=y min2=-0.04 max2=0.04 plotfat=7 plotcol=4 pad=n title="Wcos (s\^2\_/km\^2\_)" label1=Time unit1=s wantaxis=n wanttitle=n')
Result('Vsin','graph transp=y yreverse=y min2=-0.04 max2=0.04 plotfat=7 plotcol=4 pad=n title="Wsin (s\^2\_/km\^2\_)" label1=Time unit1=s wantaxis=n wanttitle=n')
Plot('Vcos','graph transp=y yreverse=y min2=-0.04 max2=0.04 plotfat=7 plotcol=4 pad=n title="Wcos (s\^2\_/km\^2\_)" label1=Time unit1=s wantaxis=y wanttitle=y')
Plot('Vsin','graph transp=y yreverse=y min2=-0.04 max2=0.04 plotfat=7 plotcol=4 pad=n title="Wsin (s\^2\_/km\^2\_)" label1=Time unit1=s wantaxis=y wanttitle=y')
Flow('vel','Vavg Vcos Vsin','cat axis=2 ${SOURCES[1:3]}')
Flow('data','vel',
'''
window n2=1 |
noise seed=1999 rep=y |
math output="input^3" |
cut n1=100 | cut f1=999 |
ricker1 frequency=10 |
spray axis=2 n=%d d=%g o=%g label="Inline Offset" unit=km |
spray axis=3 n=%d d=%g o=%g label="Crossline Offset" unit=km |
inmo3_ort velocity=$SOURCE half=n |
put label1=Time unit1=s
''' % (Nx,dx,x0,Ny,dy,y0))
Result('data','byte gainpanel=all | grey3 title=" " frame1=%d frame2=%d frame3=%d' % (Nt/2,200,Ny/2))
Flow('Vavg0',None,'math n1=%d d1=%g o1=%g output="0.0" ' % (Nt,dt,t0))
Flow('vel0','Vavg0 Vcos Vsin','cat axis=2 ${SOURCES[1:3]}')
Flow('NMOdata','vel0',
'''
window n2=1 |
noise seed=1999 rep=y |
math output="input^3" |
cut n1=100 | cut f1=999 |
ricker1 frequency=10 |
spray axis=2 n=%d d=%g o=%g label="Inline Offset" unit=km |
spray axis=3 n=%d d=%g o=%g label="Crossline Offset" unit=km |
inmo3_ort velocity=$SOURCE half=n |
put label1=Time unit1=s
''' % (Nx,dx,x0,Ny,dy,y0))
Result('NMOdata','byte gainpanel=all | grey3 title=" " frame1=%d frame2=%d frame3=%d' % (Nt/2,Nx/2,Ny/2))
Flow('NMOdata_sq','NMOdata','math output="input^2" ')
Flow('NMOfftdata','NMOdata','rtoc | fft3 axis=1 pad=1 | window n1=500 f1=500')
Flow('NMOfftdatac','NMOfftdata','window n1=100 f1=0')
Flow('NMOfftdata_sq','NMOdata_sq','rtoc | fft3 axis=1 pad=1 | window n1=500 f1=500')
Flow('NMOfftdatac_sq','NMOfftdata_sq','window n1=150 f1=0')
Result('NMOfftrealc_sq','NMOfftdatac_sq','real | grey title="NMOrealc\^2" ')
Ntau=Nt
dtau=dt
tau0=t0
Np=200
p0=-0.04
dp=(0.04-p0)/Np
Nq=Np
q0=p0
dq=dp
Ns=1
s0=0.0
ds=0.1
Flow('bfio.bin',os.path.join(RSFROOT,'include','bfio.bin'),'/bin/cp $SOURCE $TARGET',stdin=0,stdout=-1)
Flow('NMOfmod','NMOfftdatac bfio.bin','radon34 ntau=%d dtau=%g tau0=%g np=%d dp=%g p0=%g nq=%d dq=%g q0=%g ns=%d ds=%g s0=%g fi=2 EL=0 N=32 EPSx1=7 EPSx2=5 EPSx3=5 EPSk1=7 EPSk2=5 EPSk3=5 | real | math output=input*%g' % (Ntau,dtau,tau0,Np,dp,p0,Nq,dq,q0,Ns,ds,s0,2*dx*dy/Nt))
Flow('NMOfmod_sq','NMOfftdatac_sq bfio.bin','radon34 ntau=%d dtau=%g tau0=%g np=%d dp=%g p0=%g nq=%d dq=%g q0=%g ns=%d ds=%g s0=%g fi=2 EL=0 N=32 EPSx1=9 EPSx2=5 EPSx3=5 EPSk1=9 EPSk2=5 EPSk3=5 | real | math output=input*%g' % (Ntau,dtau,tau0,Np,dp,p0,Nq,dq,q0,Ns,ds,s0,2*dx*dy/Nt))
Flow('NMOsemb-1','NMOfmod NMOfmod_sq','math output="input^2" | divn den=${SOURCES[1]} rect1=5 rect2=3 rect3=3 | math output="input/%g" ' %(Nx*dx*Ny*dy))
Result('NMOsemb-1','byte gainpanel=all allpos=y | grey3 title=" " maxval=1 minval=0 color=j label1=Time unit1=s label2="Wcos" unit2="s\^2\_/km\^2\_" label3="Wsin" unit3="s\^2\_/km\^2\_" frame1=%d frame2=%d frame3=%d' % (650,87,130))
Flow('pik1','NMOsemb-1','stack axis=3 | scale axis=2 | pick vel0=0.0 rect1=20')
Flow('pik2','NMOsemb-1','stack axis=2 | scale axis=2 | pick vel0=0.0 rect1=20')
Result('pik1','graph transp=y yreverse=y min2=-0.04 max2=0.04 plotfat=7 plotcol=3 pad=n title="Wcos (s\^2\_/km\^2\_)" label1=Time unit1=s wantaxis=n wanttitle=n')
Result('pik2','graph transp=y yreverse=y min2=-0.04 max2=0.04 plotfat=7 plotcol=3 pad=n title="Wsin (s\^2\_/km\^2\_)" label1=Time unit1=s wantaxis=n wanttitle=n')
Plot('pik1','graph transp=y yreverse=y min2=-0.04 max2=0.04 plotfat=5 plotcol=3 pad=n title="Wcos (s\^2\_/km\^2\_)" label1=Time unit1=s wantaxis=y wanttitle=y')
Plot('pik2','graph transp=y yreverse=y min2=-0.04 max2=0.04 plotfat=5 plotcol=3 pad=n title="Wsin (s\^2\_/km\^2\_)" label1=Time unit1=s wantaxis=y wanttitle=y')
Result('hu1','Vcos pik1','Overlay')
Result('hu2','Vsin pik2','Overlay')
Flow('RMOpikvel','Vavg0 pik1 pik2','cat axis=2 ${SOURCES[1:3]}')
Flow('RMOdata','NMOdata RMOpikvel','nmo3_ort velocity=${SOURCES[1]} half=n')
Result('NMOdatacut','NMOdata','window n1=400 f1=450 | byte gainpanel=all | grey3 title=" " frame1=%d frame2=%d frame3=%d' % (200,Nx/2,Ny/2))
Result('RMOdatacut','RMOdata','window n1=400 f1=450 | byte gainpanel=all | grey3 title=" " frame1=%d frame2=%d frame3=%d' % (200,Nx/2,Ny/2))
End() |