示例#1
0
文件: wefd.py 项目: YLGeoStudio/src
def eimage(plot, imag, custom, par):
    #    print clip
    title = ["pp", "ps", "sp", "ss"]
    for i in range(4):
        if i != 0:
            flag = " wantaxis2=n"
        else:
            flag = " wantaxis2=y"

        Flow(
            [plot + "_plt" + str(i), plot + "_bar" + str(i)],
            imag,
            "scale axis=123 | byte bar=${TARGETS[1]} gainpanel=a",
        )

        Plot(
            plot + str(i),
            [plot + "_plt" + str(i), plot + "_bar" + str(i)],
            "window n3=1 f3=%d bar=${SOURCES[1]} |" % i + fdmod.cgrey(flag, par),
        )
        Result(
            plot + str(i),
            [plot + "_plt" + str(i), plot + "_bar" + str(i)],
            "window n3=1 f3=%d bar=${SOURCES[1]} |" % i
            + fdmod.cgrey(flag + custom + " wantaxis2=y title=%s" % (title[i]), par),
        )
示例#2
0
文件: pot.py 项目: 1014511134/src
def cliptogetherK(plot,file1,file2,title1,title2,axis,custom,par):

    Flow(plot+'-all',[file1,file2],
         '''
         cat axis=3 space=n ${SOURCES[1]} |
         byte gainpanel=a pclip=100|
         put label1=%(lkz)s label2=%(lkx)s
             unit1=%(ukz)s unit2=%(lkx)s
             o1=%(okz)f d1=%(dkz)f o2=%(okx)f d2=%(dkx)f 
         ''' %par)
    

    
    if(axis==1):
        if(not par.has_key('ys')): par['ys']=0.75
        if(not par.has_key('xs')): par['xs']=0.75
        if(not par.has_key('xc')): par['xc']=-8.25
        Plot(file1,plot+'-all','window n3=1 f3=0 |' + fdmod.cgrey(custom+' title=%s'%title1,par))
        Plot(file2,plot+'-all','window n3=1 f3=1 |' + fdmod.cgrey(custom+' title=%s label1=  unit1= '%title2,par))
        pplot.p1x2(plot,file1,file2,par['ys'],par['xs'],par['xc'])
    else:
        if(not par.has_key('ys')): par['ys']=.75
        if(not par.has_key('xs')): par['xs']=.75
        if(not par.has_key('xc')): par['xc']=-10
        Plot(file1,plot+'-all','window n3=1 f3=1 |' + fdmod.cgrey(custom+' title=%s wantaxis2=n label2= unit2='%title1,par))
        Plot(file2,plot+'-all','window n3=1 f3=0 |' + fdmod.cgrey(custom+' title=%s '%title2,par))
        p2x1(plot,file1,file2,par['ys'],par['xs'],par['xc'])
示例#3
0
文件: iic.py 项目: 1014511134/src
def aimage(cic,iic,
           dat,wav,vel,den,sou,rec,ico,par):

    iwindow = ' ' + \
              '''
              nqz=%(nqz)d oqz=%(oqz)g
              nqx=%(nqx)d oqx=%(oqx)g
              jsnap=%(jdata)d jdata=%(jdata)d
              ''' % par + ' '

    # ------------------------------------------------------------
    # source wavefield
    fdmod.awefd(dat+'-'+vel+'-for',
                dat+'-'+vel+'-sou',
                wav,
                vel,den,sou,rec,iwindow,par)
    
    # ------------------------------------------------------------
    # receiver wavefield
    Flow(dat+'-rev',dat,'reverse which=2 opt=i verb=y' % par)
    fdmod.awefd(dat+'-'+vel+'-bck',
                dat+'-'+vel+'-rwf',
                dat+'-rev',
                vel,den,
                rec,rec,iwindow,par)

    Flow(dat+'-'+vel+'-rec',
         dat+'-'+vel+'-rwf',
         '''
         reverse which=4 opt=i verb=y
         ''' )

    # compute assymptotic Wigner distribution
    Flow(dat+'-'+vel+'-wig',
         dat+'-'+vel+'-rec',
         'wdf verb=y nh1=%(nhz)d nh2=%(nhx)d nh3=%(nht)d' % par)
    
    # ------------------------------------------------------------
    # imaging condition
    Flow(cic,[dat+'-'+vel+'-sou',dat+'-'+vel+'-rec'],
         'xcor2d uu=${SOURCES[1]} verb=y nbuf=100 axis=3')
    Flow(iic,[dat+'-'+vel+'-sou',dat+'-'+vel+'-wig'],
         'xcor2d uu=${SOURCES[1]} verb=y nbuf=100 axis=3')

    # ------------------------------------------------------------
    # WDF on image
    Flow(cic+'-wdf',cic,
         'scale axis=123 | wdf verb=y nh1=%(nhz)d nh2=%(nhx)d' % par)
    
    for img in ([cic,iic,cic+'-wdf']):
        Plot(img,fdmod.cgrey('pclip=100',par))
        Result( img,[img,rec,sou],'Overlay')
        Result('win'+img,img,
               fdmod.cgrey('pclip=100 min1=%g max1=%g min2=%g max2=%g screenratio=%g screenht=%g wantaxis=y' %
               (par['wzmin'],par['wzmax'],par['wxmin'],par['wxmax'],par['wratio'],par['wheight']),par))
示例#4
0
文件: iic.py 项目: 1014511134/src
def pimage(cic,iic,
           dat,vel,den,rec,ico,par):

    # reverse data
    Flow(dat+'-rev',dat,'reverse which=2 opt=i verb=y | pad end2=%(tpad)d' % par)

    iwindow = ' ' + \
              '''
              nqz=%(nqz)d oqz=%(oqz)g
              nqx=%(nqx)d oqx=%(oqx)g
              jsnap=%(jdata)d jdata=%(jdata)d
              ''' % par + ' '
    
    # backpropagate
    fdmod.awefd(dat+'-'+vel+'-bck',
                dat+'-'+vel+'-wfl',
                dat+'-rev',
                vel,den,
                rec,rec,iwindow,par)

    # cut wavefield around t=0
    Flow(dat+'-'+vel+'-cut',
         dat+'-'+vel+'-wfl',
         '''
         window n3=%d f3=%g |
         reverse which=4 opt=i verb=y |
         put o3=%g label3=t unit3=s
         ''' % (2*par['tcut']+1,
                par['nt']-par['kt']-par['tcut'],
                -par['tcut']*par['dt']))
         
    # compute WDF
    Flow(dat+'-'+vel+'-wig',dat+'-'+vel+'-cut',
         'wdf verb=y nh1=%(nhz)d nh2=%(nhx)d nh3=%(nht)d' % par)
    #    Result(dat+'-'+vel+'-wig','grey gainpanel=a')

    # imaging condition
    Flow(cic,dat+'-'+vel+'-cut',
         'window n3=1 f3=%d' % par['tcut'])
    Flow(iic,dat+'-'+vel+'-wig',
         'window n3=1 f3=%d' % par['tcut'])

    for img in ([cic,iic]):
        Plot(img,fdmod.cgrey('pclip=100',par))
        Result( img,[img,rec],'Overlay')
        Result('win'+img,img,
               fdmod.cgrey('min1=%g max1=%g min2=%g max2=%g screenratio=%g wantaxis=y' %
                           (par['wzmin'],par['wzmax'],par['wxmin'],par['wxmax'],par['wratio']),par) )
示例#5
0
文件: micro.py 项目: psava/cwp12
def synthesize(data,rr,snapshots,par):
    # 2D acoustic modeling
    awefd(data,'wa-2d','wava','vp-2d','ro-2d','ss-2d',rr,par)
    Result(data,'transp |' + fdmod.dgrey('',par))
    for i in range(snapshots[0],snapshots[0]+snapshots[1]*snapshots[2],snapshots[2]):
        Plot('wa-2d-%d' % i,'wa-2d','window n3=%d f3=%d | ' % (1,i) + fdmod.cgrey('pclip=99.9 gainpanel=a',par))
        Result('wa-2d-%d' %i , ['wa-2d-%d' % i,rr],'Overlay')
示例#6
0
 def cgrey(self,custom,scalar=None,horizontal=True):
   '''
   This is equivalent to fdmod.cgrey('',par) 
   scalar:  horizontal scalar for the figure space
   '''
   self._scale(scalar,horizontal)
   return fdmod.cgrey(custom,self.par)
示例#7
0
文件: saf.py 项目: 1014511134/src
def common(wav,vel,den,ss,rr,qq,par):
    
    # ------------------------------------------------------------
    # wavelet
    Result( 'wav','window n2=1000 | transp |' + fdmod.waveplot('',par))

    # ------------------------------------------------------------
    # plot model geometry
    geometry(ss,rr,qq,par)
    
    # ------------------------------------------------------------
    # velocity and density
    safodmodel(vel,den,par)
    Plot(vel,fdmod.cgrey('bias=1.9 allpos=y ',par))
    Plot(den,fdmod.cgrey('bias=1.72',par))
    Result(vel,[vel,ss,rr,qq],'Overlay')
示例#8
0
def simulateddata(sdat,rdat,slo,sd,ss,par):

    # single reflector
    par['kxref']=50
    par['lxref']=par['nximg']-par['kxref']
    par['kzref']=par['nzimg']-par['nzpad']/par['jzimg']-10
    Flow('ref',None,
         '''
         spike nsp=1 mag=1 
         n1=%(nximg)d d1=%(dximg)g o1=%(oximg)g k1=%(kxref)d l1=%(lxref)d
         n2=%(nzimg)d d2=%(dzimg)g o2=%(ozimg)g k2=%(kzref)d |
         smooth rect1=25 repeat=3 |
         spray axis=2 n=1 o=0 d=1 |
         put label1=x label2=y label3=z 
         ''' % par )    
    Plot('ref','window | transp | smooth rect1=3 |'
         + fdmod.cgrey('pclip=100',par))
    Result('ref',['ref',ss],'Overlay')

    # source wavelet
    par['frq']=5
    par['kt']=50
    Flow('wvl',None,
         '''
         spike nsp=1 mag=1
         n1=%(nt)d d1=%(dt)g o1=0   k1=%(kt)d |
         ricker1 frequency=%(frq)g |
         scale axis=123 |
         fft1 |
         window squeeze=n n1=%(nw)d min1=%(ow)g
         ''' % par)

    # source data on the surface
    for iexp in range(par['ns']):
        etag = "-e%03d" % iexp

        xsou = par['os'] + (par['fs'] + iexp * par['js']) * par['ds']
        isou = (xsou-par['oximg'])/par['dximg']
        Flow('spk'+etag,'wvl',
             '''
             pad beg2=%d n2out=%d |
             put label1=w label2=x label3=y o2=%g d2=%g |
             transp memsize=250 plane=12 |
             transp memsize=250 plane=23 
             ''' % (isou,
                    par['nximg'],
                    par['oximg'],
                    par['dximg'],) )
    Flow('spk',
         map(lambda x: 'spk-e%03d'  % x,range(par['ns'])),
         'cat space=n axis=4 ${SOURCES[1:%d]}'%par['ns'])

    # datumed source data
    zomig.Cdtone3(sdat,'spk',sd,par)
    Result(sdat,fdmod.fgrey('',par))

    # datumed receiver data
    spmig.modelPW3(rdat,slo,sdat,'ref',par)
    Result(rdat,fdmod.fgrey('',par))
示例#9
0
文件: itest.py 项目: 1014511134/src
def debug(par):
    proj = Project()
    proj.Program('SICt.x',Split('SICt.c intutil.c'))

    Flow('k1',['qs','qr'],
         '''
         sic ur=${SOURCES[1]} nbuf=500 verb=y
         oa=%(oa)g na=%(na)d da=%(da)g
         nl=%(nl)d dl=%(dl)g
         sig=%(sig)g
         ''' % par)
    
    Flow('k2',['ps','pr'],
         '''
         sic3d
         ur=${SOURCES[1]} verb=y
         oanga=%(oanga)g nanga=%(nanga)d danga=%(danga)g
         oangb=%(oangb)g nangb=%(nangb)d dangb=%(dangb)g
         nl=%(nl)d dl=%(dl)g
         sig=%(sig)g
         ''' % par )
    Flow('k3',['qs','qr','SICt.x'],
         '''
         ./SICt.x
         ur=${SOURCES[1]} verb=y
         oanga=%(oanga)g nanga=%(nanga)d danga=%(danga)g
         oangb=%(oangb)g nangb=%(nangb)d dangb=%(dangb)g
         nl=%(nl)d dl=%(dl)g
         sig=%(sig)g
         ''' % par )
    Flow('k4',['qs','qr','SICt.x'],
         '''
         ./SICt.x
         ur=${SOURCES[1]} verb=y
         oa=%(oa)g na=%(na)d da=%(da)g
         nl=%(nl)d dl=%(dl)g
         sig=%(sig)g
         ''' % par )
    
    Plot(  'k1','transp |' + fdmod.cgrey('pclip=100',par))
    Plot(  'k2',             fdmod.cgrey('pclip=100',par))
    Plot(  'k3','transp |' + fdmod.cgrey('pclip=100',par))
    Plot(  'k4','transp |' + fdmod.cgrey('pclip=100',par))
    
    for id in ('4','3'):
        Result('k'+id,['k'+id,'ss','sx'],'Overlay')
示例#10
0
文件: micro.py 项目: psava/cwp12
def addnoise(noisy,data,scale,snapshots,par):
    Flow(noisy,data, 'math output="0" | noise seed=123 | transp | bandpass flo=20 fhi=50 | transp | add scale=%f | add mode=a ${SOURCES[0]} | add scale=1e6' % scale)

    Result(noisy,'transp | grey pclip=99.9')
    backproject(noisy,'rr-2d','vp-2d','ro-2d','wa-%s'% noisy,par)

    Result('wa-%s' % noisy,
        'window f3=%d n3=%d j3=%d | ' % (snapshots[0],snapshots[1],snapshots[2]) + 
        fdmod.cgrey('pclip=100',par))
示例#11
0
文件: micro.py 项目: psava/cwp12
def model(rr,par):
    Flow('zero-2d',None,
         '''
         spike nsp=1 mag=0.0
         n1=%(nz)d o1=%(oz)g d1=%(dz)g 
         n2=%(nx)d o2=%(ox)g d2=%(dx)g |
         put label1=%(lz)s label2=%(lx)s unit1=%(uz)s unit2=%(ux)s
         ''' % par)

    Flow('vz-2d','zero-2d',
        '''
        spike nsp=5
        nsp=5 k1=10,40,70,100,130 l1=39,69,99,129,%(nz)d mag=0.2,0.4,0.6,0.8,1.0 
         n1=%(nz)d o1=%(oz)g d1=%(dz)g 
         n2=%(nx)d o2=%(ox)g d2=%(dx)g |
         put label1=%(lz)s label2=%(lx)s unit1=%(uz)s unit2=%(ux)s | 
        add add=%(vp)f
        ''' % par)

    Flow('fault-2d','zero-2d',
        '''
        spike nsp=1 k1=40 mag=1.0 l1=%(nz)d k2=60 l2=%(nx)d p2=1
         n1=%(nz)d o1=%(oz)g d1=%(dz)g 
         n2=%(nx)d o2=%(ox)g d2=%(dx)g |
         put label1=%(lz)s label2=%(lx)s unit1=%(uz)s unit2=%(ux)s  
        ''' % par)
    Flow('const-2d','zero-2d',
        '''
        spike nsp=1 mag=1.0 k1=40 l1=%(nz)d k2=1 l2=59
         n1=%(nz)d o1=%(oz)g d1=%(dz)g 
         n2=%(nx)d o2=%(ox)g d2=%(dx)g |
         put label1=%(lz)s label2=%(lx)s unit1=%(uz)s unit2=%(ux)s  
        ''' % par)
    Flow('vp-2d','vz-2d','window')

    Flow('ro-2d','zero-2d','math output="%(ro)g"' %par)

    fdmod.makebox('box',0.2,0.4,0.4,0.9,par)
    Plot('box',fdmod.bbplot('',par))

    Plot('vp-2d',fdmod.cgrey('allpos=y pclip=100 bias=1.5 ',par))
    Plot('ro-2d',fdmod.cgrey('bias=2. allpos=y',par))
    Result('vp-2d','vp-2d ss-2d rr-2d box','Overlay')
    Result('ro-2d','ro-2d ss-2d','Overlay')
示例#12
0
文件: rwezo.py 项目: 1014511134/src
def plots(par):
    pplot.p3x2(par['prefix']+'iCCall',
               'migCC-SSF','migCC-PSC','migCC-FFD',
               'migCC-F15','migCC-F45','migCC-F60',
               0.3,0.3,-8,-12)
    pplot.p3x2(par['prefix']+'iRCall',
               'migRC-SSF','migRC-PSC','migRC-FFD',
               'migRC-F15','migRC-F45','migRC-F60',
               0.3,0.3,-10,-12)

    Result(par['prefix']+'icomp',['imgCC','migCC-FFD','migCC-F60'],'Movie')
    Result(par['prefix']+'imgCC',['imgCC','cos'],'Overlay')

    Plot  ('imgCC',
           'window | transp |' + fdmod.cgrey('pclip=100',par))
    Plot  ('imgRC','migCC-FFD',
           '         transp |' + fdmod.cgrey('pclip=100',par))
    Plot('imgRC-ovl',['imgRC','cos'],'Overlay')
    pplot.p2x1(par['prefix']+'CCvsRC','imgRC-ovl','imgCC',0.5,0.5,-9)
示例#13
0
文件: saf.py 项目: 1014511134/src
def migration(dat,vel,den,ss,rr,qq,uuu,wig,cic,iic,par):

    Result(dat,
           '''
           reverse which=2 opt=i | window f2=%(tpad)d | 
           put d1=1 o2=%(ot)g |
           grey title=""
           label1="Receiver #" unit1="" label2="Time" unit2="s"
           screenratio=0.3 screenht=4
           labelsz=5 labelfat=3 %(labelattr)s
           '''% par)

    fdmod.awefd(uuu+'-out',
                uuu+'-bck',
                dat,
                vel,
                den,
                ss,
                rr,
                'free=y jsnap=1' + fdmod.qqbox2d(par),par)

    Flow(uuu,
         uuu+'-bck',
         '''
         window n3=%d f3=%d |
         put o3=%g label3=t unit3=s
         ''' % (2*par['twin'],
                par['nt']-par['tpad']-par['twin'],
                -par['twin']*par['dt']))

    # CIC
    Flow(cic,uuu,
         'window n3=1 f3=%(twin)d' % par)
    
    # IIC
    Flow(wig,uuu,
         'wigner verb=y nh1=%(nhz)d nh2=%(nhx)d nh3=%(nht)d' %par)
    Flow(iic,wig,
         'window n3=1 f3=%(twin)d' %par)

    for k in ([uuu,wig]):
        wflplot(k,'winss',par)

    for k in ([cic,iic]):

        # image
        Plot(  k,fdmod.cgrey('pclip=99.99',par))
        Result(k,[k,ss],'Overlay')
        
        # image (window)
        Plot(  'win'+k,k,wingrey('pclip=99.99',par))
        Result('win'+k,['win'+k,'winss'],'Overlay')
        
        # slope decomposition
        slope(k+'-ssk',k,par)
示例#14
0
文件: iic.py 项目: 1014511134/src
def model(vo,vv,rm,gg,gm,par):
    if(not par.has_key('vbias')): par['vbias']=0
    
    Flow(gg+'-nu', gg,'math output="input*%g"' % gm)

    # random velocity
    Flow(vv,[vo,gg+'-nu'],
         '''
         math v=${SOURCES[0]} n=${SOURCES[1]}
         output="v/sqrt(1+n)"
         ''' % par)
    
    Plot(vo,fdmod.cgrey('allpos=y bias=1.45',par))
    Plot(vv,fdmod.cgrey('allpos=y bias=1.45',par))
    Result(vo,vo,'Overlay')
    Result(vv,vv,'Overlay')
    
    # density
    Flow(rm,vo,'math output=1')
    Plot(rm,fdmod.cgrey('allpos=y pclip=100',par))
示例#15
0
文件: itest.py 项目: 1014511134/src
def stereo2d(par):
    # 2D stereographic IC
    Flow('jj',['qs','qr'],
         '''
         sic ur=${SOURCES[1]} nbuf=500 verb=y
         oa=%(oa)g na=%(na)d da=%(da)g
         nl=%(nl)d dl=%(dl)g
         sig=%(sig)g
         ''' % par)
    Plot(  'jj','transp | ' + fdmod.cgrey('pclip=99.9',par))
    Result('jj',['jj','jj','ss','sx'],'Overlay')
示例#16
0
文件: iic.py 项目: 1014511134/src
def random(seed,gg,mask,ff,aa,ru,rv,par):

    part=par.copy()

    # random field
    part['ff']=ff # ???
    part['aa']=aa # angle    
    part['ru']=ru # characteristic length
    part['rv']=rv # characteristic length
    gfield.execute(gg+'_',seed,part)
    Flow(gg,[gg+'_',mask],'add mode=p ${SOURCES[1]}')
    Result(gg,fdmod.cgrey('color=F',par))    
示例#17
0
文件: wefd.py 项目: YLGeoStudio/src
def ecic(imag, ss, rr, cc, custom, par):
    sout = imag + "_ds"  #   source data (not the input sdat!)
    rout = imag + "_dr"  # receiver data (not the input rdat!)

    # conventional (cross-correlation zero-lag) imaging condition
    for i in ("1", "2"):
        for j in ("1", "2"):
            wemig.cic(imag + i + j, sout + i, rout + j, "nbuf=100", par)
            Plot(imag + i + j, fdmod.cgrey("pclip=99.8" + custom, par))
            Result(imag + i + j, [imag + i + j, "ss", "rr"], "Overlay")

    Flow(imag, [imag + "11", imag + "12", imag + "21", imag + "22"], "cat ${SOURCES[1:4]} space=n axis=3")
示例#18
0
文件: itest.py 项目: 1014511134/src
def test(par):

    for i in ('s','r'):
        Flow(  'v'+i,'u'+i,'window n3=1 f3=400')
        Result('v'+i,fdmod.cgrey('',par))
        
        Flow(  'k'+i,'f'+i,
               '''
               lstk verb=y
               oa=%(oa)d na=%(na)d da=%(da)g
               nl=%(nl)d dl=%(dl)g sig=%g
               ''' % par )
        Result('k'+i,fdmod.dgrey('gainpanel=a pclip=100',par))
        
        jx = 20
        Result('k'+i+'all','k'+i,
               '''
               window j2=%d |
               transp plane=23 |
               put n3=1 n2=%d |
               grey pclip=100
               ''' % (jx,par['nx']/2/jx*na) )
        
        Flow('t'+i,'k'+i,'byte gainpanel=a pclip=100 | put label1=x label2=t label3=a')
        
        Result('ff','fs fr','cat axis=3 space=n ${SOURCES[1]} | transp | grey pclip=100 gainpanel=e')
        Result('tt','ts tr',
               '''
               cat axis=3 space=n ${SOURCES[1]} |
               window j1=10 |
               transp plane=12 |
               transp plane=23 |
               grey title=""
               ''')
        
#        for i in ('s','r'):
#            Flow(['t'+i+'plt','t'+i+'bar'],'k'+i,'byte bar=${TARGETS[1]} gainpanel=a pclip=99.9')
#            for k in range(20):
#                Result('t'+i+'plt'+str(k),['t'+i+'plt','t'+i+'bar'],
#                       'window n1=1 f1=%d | transp |' % (20*k) +
#                       'grey title="" screenratio=0.2 screenht=3 label2=x unit2=m label1=p unit1="#" ')
                
        Flow('fi','fs fr','add mode=p ${SOURCES[1]}')
        Flow('ki','ks kr',
             '''
             add mode=p ${SOURCES[1]} |
             transp plane=23 memsize=1000 |
             stack
             ''')
        
        Result('fi',fdmod.dgrey('',par))
        Result('ki',fdmod.dgrey('',par))
示例#19
0
def importvels(par):
    # prepare velocity
    sigsbee.getmigvel('velo',par)
    sigsbee.getstrvel('vstr',par)
    Result('vstr',fdmod.cgrey('color=j allpos=y bias=1.5',par))
    Result('velo',fdmod.cgrey('color=j allpos=y bias=1.5',par))

    # padding in z
    Flow('vpad','vstr',
         '''
         window n1=1 f1=1200 | 
         spray axis=1 n=143 |
         smooth rect2=250 repeat=5
         ''' )

    Flow('vsed','vstr','window n1=1180' )

    Flow('velC','vsed vpad','cat axis=1 ${SOURCES[1]}')
    Flow('velCt','velC','transp')

    # masks
    sigsbee.makemask('velC','smask','wmask','lmask',par)
示例#20
0
文件: itest.py 项目: 1014511134/src
def stereo3d(par):
    # 3D stereographic IC
    Flow('kk',['qs','qr'],
         '''
         sic3d ur=${SOURCES[1]} nbuf=500 verb=y stack=n
         oanga=%(oanga)g nanga=%(nanga)d danga=%(danga)g
         oangb=%(oangb)g nangb=%(nangb)d dangb=%(dangb)g
         nl=%(nl)d dl=%(dl)g
         sig=%(sig)g
         ''' % par )    
    Plot(  'kk','transp plane=23 | stack | transp | '
           + fdmod.cgrey('pclip=99.9',par))
    Result('kk',['kk','ss','sx'],'Overlay')
示例#21
0
文件: iic.py 项目: 1014511134/src
def points(sp,sa,wp,xm,qq,par):
    
    # ------------------------------------------------------------
    ls = 2*par['lo']    

    par['zs' ] = par['oz'] + par['lo']
    par['zs0'] = par['zt']+ls
    par['zs1'] = par['zt']
    par['zs2'] = par['zt']-ls

    par['xs' ] = par['xt']
    par['xs0'] = par['xt']
    par['xs1'] = par['xt']-ls
    par['xs2'] = par['xt']+ls

    par['jzs0'] = par['zs0'] / par['dz']
    par['jzs1'] = par['zs1'] / par['dz']
    par['jzs2'] = par['zs2'] / par['dz']
    
    par['jxs0'] = par['xs0'] / par['dx']
    par['jxs1'] = par['xs1'] / par['dx']
    par['jxs2'] = par['xs2'] / par['dx']
    
    # ------------------------------------------------------------
    # source positions
    fdmod.point('ss0',par['xs0'],par['zs0'],par)
    fdmod.point('ss1',par['xs1'],par['zs1'],par)
    fdmod.point('ss2',par['xs2'],par['zs2'],par)
    Flow(sp,'ss0 ss1 ss2','cat axis=2 space=n ${SOURCES[1:3]} | window n1=2')
    Plot(sp,'window |' + fdmod.ssplot('plotcol=2',par))

    fdmod.point(sa,par['xs'],par['zs'],par)    
    Plot(sa,'window |' + fdmod.ssplot('',par))

    # ------------------------------------------------------------
    # source wavelet
    fdmod.wavelet(wp+'_',par['fo'],par)
    Flow(wp,wp+'_','spray axis=2 n=3 o=0 d=1 | transp')

    # ------------------------------------------------------------
    # scatterrers
    Flow(xm,None,
         '''
         spike nsp=3 mag=1,1,1
         n1=%(nz)d o1=%(oz)g d1=%(dz)g k1=%(jzs0)d,%(jzs1)d,%(jzs2)d l1=%(jzs0)d,%(jzs1)d,%(jzs2)d
         n2=%(nx)d o2=%(ox)g d2=%(dx)g k2=%(jxs0)d,%(jxs1)d,%(jxs2)d l2=%(jxs0)d,%(jxs1)d,%(jxs2)d
         ''' % par)

    Plot(  xm,'smooth rect1=3 rect2=3 repeat=3 |'
           +fdmod.cgrey('pclip=100',par))
    Result(xm,[xm,qq],'Overlay')
示例#22
0
def adjoint(bsl,dim,swfl,rwfl,slo,ss,par):

    for iexp in range(par['ns']):
        etag = "-e%03d" % iexp

        Flow(bsl+etag,
             [dim,swfl+etag,rwfl+etag,slo],
             '''
             rtoc |
             ../Code/srmvatau.x
             adj=y nht=%g oht=%g dht=%g %s
             swf=${SOURCES[1]}
             rwf=${SOURCES[2]}
             slo=${SOURCES[3]} |
             real
             ''' % (par['nht'],par['oht'],par['dht'],spmig.param(par)))

    Flow(bsl+'-all',
         map(lambda x: bsl+'-e%03d'  % x,range(par['ns'])),
         'cat space=n axis=2 ${SOURCES[1:%d]}'%par['ns'])
    Flow(bsl,bsl+'-all','stack | spray axis=2 n=1 o=0 d=1')

    # plot complete slowness backprojection
    Plot(bsl,
         'window | transp |' + fdmod.cgrey('color=e pclip=97',par))
    Result(bsl,[bsl,ss],'Overlay')

    # clip slowness perturbation
    Flow(bsl+'-byt',
         bsl+'-all','byte gainpanel=a pclip=97')

    for iexp in range(par['ns']):
        etag = "-e%03d" % iexp
        
        # plot partial slowness backprojection
        Plot(bsl+etag,bsl+'-byt',
             'window n2=1 f2=%d | transp |' % iexp + fdmod.cgrey('color=e',par))
        Result(bsl+etag,[bsl+etag,ss+etag],'Overlay')
示例#23
0
def forward(dsl,dim,swfl,rwfl,slo,ss,par):

    for iexp in range(par['ns']):
        etag = "-e%03d" % iexp
        
        Flow(dim+etag,
             [dsl,swfl+etag,rwfl+etag,slo],
             '''
             rtoc |
             ../Code/srmvatau.x
             adj=n nht=%g oht=%g dht=%g %s
             swf=${SOURCES[1]}
             rwf=${SOURCES[2]}
             slo=${SOURCES[3]} |
             real
             ''' % (par['nht'],par['oht'],par['dht'],spmig.param(par)))

    Flow(dim+'-all',
         map(lambda x: dim+'-e%03d'  % x,range(par['ns'])),
         'cat space=n axis=2 ${SOURCES[1:%d]}'%par['ns'])
    Flow(dim,dim+'-all','stack | spray axis=2 n=1 o=0 d=1')

    # plot complete image perturbation
    Plot(dim,
         'window n4=1 min4=0 | transp |' + fdmod.cgrey('pclip=97',par))
    Result(dim,[dim,ss],'Overlay')
    
    # plot DIM tiles
    Result(dim+'-tile',
           dim,
           '''
           window j1=%(jcig)d f1=%(fcig)d |
           transp plane=12 |
           transp plane=23 |
           put n2=%(nxtile)d o2=%(oxtile)g d2=%(dxtile)g n3=1 |
           ''' % par
           + fdmod.cgrey('wantaxis2=n pclip=97',par))
示例#24
0
文件: pot.py 项目: 1014511134/src
def cliptogether(plot,file1,file2,title1,title2,axis,custom,par):

    Flow(plot+'-all',[file1,file2],
         '''
         cat axis=3 space=n ${SOURCES[1]} |
         byte gainpanel=a %s
         ''' %custom)
    

    
    if(axis==1):
        if(not par.has_key('ys')): par['ys']=0.75
        if(not par.has_key('xs')): par['xs']=0.75
        if(not par.has_key('xc')): par['xc']=-8.25
        Plot(file1,plot+'-all','window n3=1 f3=0 |' + fdmod.cgrey(custom+' title=%s'%title1,par))
        Plot(file2,plot+'-all','window n3=1 f3=1 |' + fdmod.cgrey(custom+' title=%s wantaxis1=n label1= unit1= '%title2,par))
        pplot.p1x2(plot,file1,file2,par['ys'],par['xs'],par['xc'])
    else:
        if(not par.has_key('ys')): par['ys']=.75
        if(not par.has_key('xs')): par['xs']=.75
        if(not par.has_key('yc')): par['yc']=-5
        Plot(file1,plot+'-all','window n3=1 f3=1 |' + fdmod.cgrey(custom+' title=%s wantaxis2=n label2= unit2='%title1,par))
        Plot(file2,plot+'-all','window n3=1 f3=0 |' + fdmod.cgrey(custom+' title=%s '%title2,par))
        p2x1(plot,file1,file2,par['ys'],par['xs'],par['yc']) 
示例#25
0
文件: saf.py 项目: 1014511134/src
def randomvel(vsm,vrn,gg,scale,ss,rr,qq,par):
    Flow(vrn+'-gg',gg,
         '''
         window n1=%d n2=%d |
         math "output=input*%g"
         ''' % (par['nz'],par['nx'],scale))
    
    Flow(vrn,[vsm,vrn+'-gg'],
         '''
         math n=${SOURCES[1]}
         output="input/sqrt(1+n)"
         ''' % par)

    Plot(vrn,fdmod.cgrey('bias=1.9 allpos=y',par))
    Result(vrn,[vrn,ss,rr,qq],'Overlay')
示例#26
0
文件: marm.py 项目: 1014511134/src
def model(vp,vs,rx,epsilon,delta,nu,par):
    label=''
    barattr=''' xll=2 yll=1.3 
         wantscalebar=y bartype=h
         wherebartic=top wherebarlabel=top barlabelsz=8
         labelsz=8 color=j'''
    Result(vp,fdmod.cgrey('bias=1.6 min1=.5  barlabel="V\_P0\^ (km/s)" '+barattr,par))
    Result(vs,fdmod.cgrey('bias=0.0 min1=.5  barlabel="V\_S0\^ (km/s)" '+barattr,par))
    Result(rx,fdmod.cgrey('bias=1.72 min1=.5 barlabel="\s140 \F9 r \F4 (g/cm\^3) " '+barattr,par))
    Result(epsilon,fdmod.cgrey('bias=.1 min1=.5 barlabel="\s150 \F9 e " formatbar=%4.2f'+barattr,par))
    Result(delta,fdmod.cgrey('bias=0.1 min1=.5  barlabel="\s150 \F9 d " formatbar=%4.2f'+barattr,par))
    Result(nu,fdmod.cgrey('bias=0 color=e allpos=n min1=.5 formatbar=%3.0f barlabel="\s150 \F10 n \s100 (\^o\_)" '+barattr+' color=e',par))
示例#27
0
文件: iic.py 项目: 1014511134/src
def point(sp,sa,wp,xm,qq,par):

    # ------------------------------------------------------------
    ls = 2*par['lo']    

    par['zs' ] = par['oz'] + par['lo']
    par['zs0'] = par['zt']

    par['xs' ] = par['xt']
    par['xs0'] = par['xt']

    par['jzs0'] = (par['zs0']-par['oz']) / par['dz']
    par['jxs0'] = (par['xs0']-par['ox']) / par['dx']
    
    # ------------------------------------------------------------
    # source positions
    fdmod.point(sp,par['xs0'],par['zs0'],par)
    Plot(sp,'window |' + fdmod.ssplot('',par))

    fdmod.point(sa,par['xs'],par['zs'],par)    
    Plot(sa,'window |' + fdmod.ssplot('',par))

    # ------------------------------------------------------------
    # source wavelet
    fdmod.wavelet(wp+'_',par['fo'],par)
    Flow(wp,wp+'_','transp')

    # ------------------------------------------------------------
    # scatterrers
    Flow(xm,None,
         '''
         spike nsp=3 mag=1,1,1
         n1=%(nz)d o1=%(oz)g d1=%(dz)g k1=%(jzs0)d l1=%(jzs0)d
         n2=%(nx)d o2=%(ox)g d2=%(dx)g k2=%(jxs0)d l2=%(jxs0)d
         ''' % par)

    Plot(  xm,'smooth rect1=3 rect2=3 repeat=3 |'
           +fdmod.cgrey('pclip=100',par))
    Result(xm,[xm,qq],'Overlay')
示例#28
0
文件: rwezo.py 项目: 1014511134/src
def mig(migCC,migRC,frqRC,abmRC,abrRC,cos,par):
    par['j2'] = par.get('j2',1)
    for i in (['SSF','FFD','PSC',
               'F15','F45','F60']):
        sfx = '-' + i
        
        if(i=='F15'): method='method=0 c1=0.50   c2=0.00'
        if(i=='F45'): method='method=0 c1=0.50   c2=0.25'
        if(i=='F60'): method='method=0 c1=0.4761 c2=0.3767'
        if(i=='SSF'): method='method=1'
        if(i=='FFD'): method='method=2 c1=0.50   c2=0.25'
        if(i=='PSC'): method='method=3 c1=0.50   c2=0.25'

        Flow(migRC+sfx,[frqRC,abmRC,abrRC],
             '''
             rwezomig ntap=%d adj=n verb=y %s
             abm=${SOURCES[1]}
             abr=${SOURCES[2]} |
             put label1=g label2=t
             ''' % (par['ntap'],method))

        Flow(migCC+sfx,[migRC+sfx,cos],
             '''
             c2r rays=${SOURCES[1]} adj=y linear=n nsz=%(nsz)d nsx=%(nsx)d
             a2n=%(nz)d a2o=%(oz)g a2d=%(dz)g
             a1n=%(nx)d a1o=%(ox)g a1d=%(dx)g |
             put label1=z label2=x
             ''' % par)

        Plot  (migRC+sfx,'window | transp |'
               + rgrey('pclip=99.9',par))
        Result(par['prefix']+migRC+sfx,migRC+sfx,'window j2=%(j2)d | transp |' % par
               + rgrey('pclip=99.9',par))
        
        Plot(migCC+sfx,'window j1=2 j2=2 | transp |'
             + fdmod.cgrey('pclip=100',par))
        Result(par['prefix']+migCC+sfx,[migCC+sfx,cos],'Overlay' % par)
示例#29
0
def importref(par):
    # prepare reflectivity
    sigsbee.getreflect('ref_',par)
    Result('ref',fdmod.cgrey('pclip=99',par))

    # padding in z
    Flow('rpad','ref_',
         '''
         window n1=1 f1=1200 | 
         spray axis=1 n=143 |
         smooth rect2=250 repeat=5
         ''' )

    Flow('sub',None,
         '''
         spike nsp=1 mag=1
         n1=3201 d1=0.00762 o1=3.048 k1=0 l1=%(nx)d
         n2=1180 d2=0.00762 o2=0     k2=1179 l2=1179 |
         put label1=x label2=z unit1=km unit2=km | transp 
         ''' % par)

    Flow('rsed','ref_','window n1=1180' )
    Flow('rsed_','sub rsed','add ${SOURCES[1]}')
    Flow('ref','rsed_ rpad','cat axis=1 ${SOURCES[1]}')
示例#30
0
文件: wemva.py 项目: 1014511134/src
def test(par):
    # ------------------------------------------------------------
    # source coordinate
    fdmod.point('ss',par['xsou'],par['zsou'],par)
    Plot('ss',fdmod.ssplot('',par))
    Result('vel',['vel','ss'],'Overlay')
    Result('ref',['ref','ss'],'Overlay')
    Result('img',['img','ss'],'Overlay')

    # slowness
    Flow('slo','vel',
         '''
         transp |
         math "output=1/input" |
         spray axis=2 n=1 |
         put label2=y
         ''' % par )
    Result('slo','window | transp |' + fdmod.cgrey('allpos=y bias=0.065',par))

    # migration wavelet
    Flow('wvl',None,
         '''
         spike nsp=1 mag=1
         n1=%(nt)d d1=%(dt)g o1=0        k1=1
         n2=1      d2=%(dx)g o2=%(xsou)g |
         scale axis=123 |
         put label1=t label2=x label3=y
         ''' % par)

    # modeling wavelet (time domain)
    Flow('wav',None,
         '''
         spike nsp=1 mag=1
         n1=%(nt)d d1=%(dt)g o1=0   k1=%(kt)d
         n2=1      d2=%(dx)g o2=%(xsou)g |
         ricker1 frequency=%(frq)g |
         scale axis=123 |
         put label1=t label2=x label3=y
         ''' % par)
    Result('wav','window n1=200 |' + fdmod.waveplot('',par))

    # modeling wavelet (frequency domain)
    Flow('sou','wav',
         '''
         fft1 |
         window squeeze=n n1=%(nw)d min1=%(ow)g |
         pad beg2=%(xpad)d n2out=%(nx)d |
         put label1=w label2=x label3=y |
         transp memsize=250 plane=12 |
         transp memsize=250 plane=23 
         ''' % par)

    # global slowness perturnation
    Flow('ds',None,
         '''
         spike nsp=1 mag=0.00005
         n1=%(nz)d d1=%(dz)g o1=%(oz)g
         n2=%(nx)d d2=%(dx)g o2=%(ox)g |
         put label1=z label2=x label3=y |
         smooth rect1=1 rect2=1 |
         transp plane=12 |
         transp plane=23 |
         rtoc
         ''' % par)
    Plot('ds','window | real | transp |'+ fdmod.cgrey('pclip=99.9',par))

    # ------------------------------------------------------------
    # zero-offset
    # ------------------------------------------------------------
    # data
    zomig.model3('Zmod','slo','img',par)
    Flow('Zdat','Zmod',
         '''
         transp plane=23 |
         transp plane=12 |
         pad beg1=%(begw)d n1out=%(padw)d |
         fft1 inv=y |
         put o1=0 label1=t label2=x
         ''' % par)
    Result('Zdat',fdmod.dgrey('screenratio=0.5 screenht=7',par))
    
    # wavefield
    zomig.Awftwo3('woz','Zmod','slo',par)

    # migration
    zomig.image3('Zimg','slo','Zmod',par)
    Plot(  'Zimg','window | transp |' + fdmod.cgrey('',par))
    Result('Zimg','Zimg','Overlay')

    # WEMVA zero-offset
    zomig.s2i(  'ds' ,'ZFds','woz','slo',par) # forward   F(ds)
    zomig.i2s('ZFds','ZAFds','woz','slo',par) # adjoint A(F(ds))
    Result( 'ZFds','window | real | transp |'+ fdmod.cgrey('',par))
    Result('ZAFds','window | real | transp |'+ fdmod.cgrey('pclip=98',par))

    # ------------------------------------------------------------
    # shot-record 
    # ------------------------------------------------------------
    # data
    spmig.modelPW3('Smod','slo','sou','ref',par)
    Flow('Sdat','Smod',
         '''
         transp plane=23 |
         transp plane=12 |
         pad beg1=%(begw)d n1out=%(padw)d |
         fft1 inv=y |
         window f1=%(kt)d |
         pad n1out=%(nt)d |
         put o1=0 o2=%(xoff)g o3=%(xsou)g
         ''' % par)
    Result('Sdat',
           fdmod.dgrey('min2=%g max2=%g label2="Offset" screenratio=0.5 screenht=7'
                       %(par['xoff'],-par['xoff']),par))
    
    # wavefields
    spmig.wflds  ('dos','dor','wvl','Sdat',par)
    zomig.Cwfone3('wos','dos','slo',par) #   source
    zomig.Awfone3('wor','dor','slo',par) # receiver
    
    # migration
    spmig.imagePW3('Simg','cig','slo','dos','dor',par)
    Plot(  'Simg','window | transp |'+ fdmod.cgrey('',par))
    Result('Simg','Simg ss','Overlay')

    # WEMVA shot-record
    spmig.s2i(  'ds', 'SFds','wos','wor','slo',par) # forward   F(ds)
    spmig.i2s('SFds','SAFds','wos','wor','slo',par) # adjoint A(F(ds))
    Result( 'SFds','window | real | transp |'+ fdmod.cgrey('',par))
    Result('SAFds','window | real | transp |'+ fdmod.cgrey('pclip=98',par))

    # ------------------------------------------------------------
    for ispk in range(par['nspk']):
        i = par['ospk'] + ispk
        tag = str(i)

        par['xx']=par['nx']/2+i*par['jspk']
        par['xs']=par['xx']    # x start
        par['xe']=par['xx']    # x end
        par['zs']=par['nz']/2  # z start
        par['ze']=par['nz']/2  # z end

        # slowness perturbation
        Flow('ds'+tag,None,
             '''
             spike nsp=1 mag=1
             n1=%(nz)d d1=%(dz)g o1=%(oz)g k1=%(zs)d l1=%(ze)d
             n2=%(nx)d d2=%(dx)g o2=%(ox)g k2=%(xs)d l2=%(xe)d |
             put label1=z label2=x label3=y |
             smooth rect1=6 rect2=2 repeat=3 |
             scale axis=123 |
             scale rscale=0.00005 |
             transp plane=12 |
             transp plane=23 |
             rtoc
             ''' % par)
        Result('ds'+tag,'window | real | transp |'+ fdmod.cgrey('',par))

        # image perturbation
        Flow('di'+tag,'ZFds msk',
             '''
             window squeeze=n n1=1 f1=%(xx)d |
             pad beg1=%(xx)d n1out=%(nx)d |
             put o1=%(ox)g |
             math m=${SOURCES[1]} output="input*m"
             ''' %par)
        Result('di'+tag,'window | real | transp | smooth rect2=3 repeat=3 |'+ fdmod.cgrey('',par))

        # WEMVA zero-offset
        zomig.s2i(  'ds'+tag, 'ZFds'+tag,'woz','slo',par) # forward   F(ds)
        zomig.i2s('ZFds'+tag,'ZAFds'+tag,'woz','slo',par) # adjoint A(F(ds))
        zomig.i2s(  'di'+tag, 'ZAdi'+tag,'woz','slo',par) # adjoint   A(di)
        zomig.s2i('ZAdi'+tag,'ZFAdi'+tag,'woz','slo',par) # forward F(A(di))

        Result(   'ZFds'+tag,'window | real | transp |'+ fdmod.cgrey('',par))
        Result(  'ZAFds'+tag,'window | real | transp |'+ fdmod.cgrey('pclip=99.9',par))
        Result(   'ZAdi'+tag,'window | real | transp |'+ fdmod.cgrey('pclip=99.9',par))
        Result(  'ZFAdi'+tag,'window | real | transp |'+ fdmod.cgrey('',par))

        # WEMVA shot-record
        spmig.s2i(  'ds'+tag, 'SFds'+tag,'wos','wor','slo',par) # forward   F(ds)
        spmig.i2s('SFds'+tag,'SAFds'+tag,'wos','wor','slo',par) # adjoint A(F(ds))
        spmig.i2s(  'di'+tag, 'SAdi'+tag,'wos','wor','slo',par) # adjoint   A(di)
        spmig.s2i('SAdi'+tag,'SFAdi'+tag,'wos','wor','slo',par) # forward F(A(di))

        Result(   'SFds'+tag,'window | real | transp |'+ fdmod.cgrey('',par))
        Result(  'SAFds'+tag,'window | real | transp |'+ fdmod.cgrey('pclip=99.9',par))
        Result(   'SAdi'+tag,'window | real | transp |'+ fdmod.cgrey('pclip=99.9',par))
        Result(  'SFAdi'+tag,'window | real | transp |'+ fdmod.cgrey('',par))