Ejemplo n.º 1
0
def artm(imag, sdat, rdat, velo, dens, sacq, racq, iacq, custom, par):

    swfl = imag + "_us"  #   source wavefield
    rwfl = imag + "_ur"  # receiver wavefield
    sout = imag + "_ds"  #   source data (not the input sdat!)
    rout = imag + "_dr"  # receiver data (not the input rdat!)

    # source wavefield (z,x,t)
    fdmod.awefd(sout, swfl, sdat, velo, dens, sacq, iacq, custom, par)

    # receiver wavefield (z,x,t)
    tdat = imag + "_tds"
    tout = imag + "_tdr"
    temp = imag + "_tmp"

    Flow(tdat, rdat, "reverse which=2 opt=i verb=y")
    fdmod.awefd(tout, rwfl, tdat, velo, dens, racq, iacq, custom, par)
    Flow(rout, tout, "reverse which=2 opt=i verb=y")

    # conventional (cross-correlation zero-lag) imaging condition
    Flow(temp, [sout, rout], "add ${SOURCES[1]} mode=p|stack axis=2")
    Flow(
        imag,
        temp,
        """
         put
         n1=%d o1=%g d1=%g
         n2=%d o2=%g d2=%g
         """
        % (par["nqz"], par["oqz"], par["dqz"], par["nqx"], par["oqx"], par["dqx"]),
    )
Ejemplo n.º 2
0
def artm(imag, sdat, rdat, velo, dens, sacq, racq, iacq, custom, par):

    swfl = imag + '_us'  #   source wavefield
    rwfl = imag + '_ur'  # receiver wavefield
    sout = imag + '_ds'  #   source data (not the input sdat!)
    rout = imag + '_dr'  # receiver data (not the input rdat!)

    # source wavefield (z,x,t)
    fdmod.awefd(sout, swfl, sdat, velo, dens, sacq, iacq, custom, par)

    # receiver wavefield (z,x,t)
    tdat = imag + '_tds'
    tout = imag + '_tdr'
    temp = imag + '_tmp'

    Flow(tdat, rdat, 'reverse which=2 opt=i verb=y')
    fdmod.awefd(tout, rwfl, tdat, velo, dens, racq, iacq, custom, par)
    Flow(rout, tout, 'reverse which=2 opt=i verb=y')

    # conventional (cross-correlation zero-lag) imaging condition
    Flow(temp, [sout, rout], 'add ${SOURCES[1]} mode=p|stack axis=2')
    Flow(
        imag, temp, '''
         put
         n1=%d o1=%g d1=%g
         n2=%d o2=%g d2=%g
         ''' % (par['nqz'], par['oqz'], par['dqz'], par['nqx'], par['oqx'],
                par['dqx']))
Ejemplo n.º 3
0
def artm(imag, sdat, rdat, velo, dens, sacq, racq, iacq, custom, par):

    swfl = imag + '_us'  #   source wavefield
    rwfl = imag + '_ur'  # receiver wavefield
    twfl = imag + '_ut'  #     temp wavefield
    sout = imag + '_ds'  #   source data (not the input sdat!)
    rout = imag + '_dr'  # receiver data (not the input rdat!)

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

    # source wavefield (z,x,t)
    fdmod.awefd(sout, swfl, sdat, velo, dens, sacq, iacq, custom + iwindow,
                par)

    # receiver wavefield (z,x,t)
    tdat = imag + '_tds'
    Flow(tdat, rdat, 'reverse which=2 opt=i verb=y')
    fdmod.awefd(rout, twfl, tdat, velo, dens, racq, iacq, custom + iwindow,
                par)
    Flow(rwfl, twfl, 'reverse which=4 opt=i verb=y')

    # conventional (cross-correlation zero-lag) imaging condition
    Flow(imag, [swfl, rwfl], 'xcor2d uu=${SOURCES[1]} axis=3 verb=y nbuf=100')
Ejemplo n.º 4
0
def fwiker(ker,dts,ss,dtr,rr,vel,den,custom,par):
    
    fdmod.awefd(ker+'_SD',ker+'_SW',dts,vel,den,ss,rr,custom+iwindow(par),par)

    Flow(dtr+'_R',dtr,'reverse which=2 opt=i verb=y')
    fdmod.awefd(ker+'_RD',ker+'_RW',dtr+'_R',vel,den,rr,ss,custom+iwindow(par),par)
    
    cic(ker,ker+'_SW',ker+'_RW','',par,isreversed=0)
Ejemplo n.º 5
0
def fwiker(ker, dts, ss, dtr, rr, vel, den, custom, par):

    fdmod.awefd(ker + '_SD', ker + '_SW', dts, vel, den, ss, rr,
                custom + iwindow(par), par)

    Flow(dtr + '_R', dtr, 'reverse which=2 opt=i verb=y')
    fdmod.awefd(ker + '_RD', ker + '_RW', dtr + '_R', vel, den, rr, ss,
                custom + iwindow(par), par)

    cic(ker, ker + '_SW', ker + '_RW', '', par, isreversed=0)
Ejemplo n.º 6
0
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))
Ejemplo n.º 7
0
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)
Ejemplo n.º 8
0
def pmodel(dat,wfl,wav,vel,den,sou,rec,ico,par):
    if(not par.has_key('mintplot')): par['mintplot']=0

    Result(wav,'window n1=1 n2=400 |' + fdmod.waveplot('',par))
    Result('p'+vel,[vel,ico,rec,sou],'Overlay')
    
    fdmod.awefd(dat,wfl,
                wav,vel,den,sou,rec,'',par)

#    Result(dat, 'window j2=5 | transp |' +
#           fdmod.dgrey('pclip=99.9 min1=%(mintplot)g labelsz=4'%par, par))
    Result(dat, 'window j2=5 | transp |' +
           fdmod.dgrey('pclip=99.5 screenratio=1.5 min1=%(mintplot)g labelsz=3 labelfat=3 '%par, par))
Ejemplo n.º 9
0
def modeling(wav, vel, den, ss, rr, qq, dat, wfl, par):
    fdmod.awefd(dat + '-tmp', wfl, wav, vel, den, ss, rr, 'free=y', par)

    Flow(dat, dat + '-tmp',
         'window f2=%(kt)d | pad end2=%(kt)d | put o2=%(ot)g' % par)

    # wavefield movie
    fdmod.wom(wfl + 'om', wfl, vel, 4.0, par)
    Plot(wfl + 'om', fdmod.wgrey('pclip=99', par), view=1)

    for f in range(0, par['nt'] / par['jsnap'], 2):
        tag = "-%02d" % f
        fdmod.wframe(wfl + 'om-' + tag, wfl + 'om', f, 'pclip=99', par)
        Result(wfl + tag, [wfl + 'om-' + tag, ss, rr, qq], 'Overlay')
Ejemplo n.º 10
0
def pmodel(dat, wfl, wav, vel, den, sou, rec, ico, par):
    if (not par.has_key('mintplot')): par['mintplot'] = 0

    Result(wav, 'window n1=1 n2=400 |' + fdmod.waveplot('', par))
    Result('p' + vel, [vel, ico, rec, sou], 'Overlay')

    fdmod.awefd(dat, wfl, wav, vel, den, sou, rec, '', par)

    #    Result(dat, 'window j2=5 | transp |' +
    #           fdmod.dgrey('pclip=99.9 min1=%(mintplot)g labelsz=4'%par, par))
    Result(
        dat, 'window j2=5 | transp |' + fdmod.dgrey(
            'pclip=99.5 screenratio=1.5 min1=%(mintplot)g labelsz=3 labelfat=3 '
            % par, par))
Ejemplo n.º 11
0
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))
Ejemplo n.º 12
0
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) )
Ejemplo n.º 13
0
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))
Ejemplo n.º 14
0
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)
Ejemplo n.º 15
0
def modeling(wav,vel,den,ss,rr,qq,dat,wfl,par):
    fdmod.awefd(dat+'-tmp',
                wfl,
                wav,
                vel,
                den,
                ss,rr,'free=y',par)

    Flow(dat,
         dat+'-tmp',
         'window f2=%(kt)d | pad end2=%(kt)d | put o2=%(ot)g' %par)

    # wavefield movie
    fdmod.wom(wfl+'om',wfl,vel,4.0,par)
    Plot(     wfl+'om',
              fdmod.wgrey('pclip=99',par),view=1)
    
    for f in range(0,par['nt']/par['jsnap'],2):
        tag = "-%02d"%f
        fdmod.wframe(   wfl+'om-'+tag,wfl+'om',f,'pclip=99',par)
        Result(wfl+tag,[wfl+'om-'+tag,ss,rr,qq],'Overlay')
Ejemplo n.º 16
0
def wdfic(cii, uxx, uyy, wxx, wyy, dat, vel, den, rec, ico, par):

    # ------------------------------------------------------------
    par['jrec'] = 5
    par['nrec'] = 320
    par['orec'] = 0
    par['jrec'] = 10
    par['nrec'] = 160

    receivers = range(par['orec'], par['orec'] + par['nrec'] * par['jrec'],
                      par['jrec'])
    # ------------------------------------------------------------

    for k in receivers:
        ktag = "-%04d" % k

        # source coordinates
        Flow(rec + ktag, rec, 'window n2=1 f2=%g' % k)
        Plot(rec + ktag, 'window |' + fdmod.rrplot('', par))

        # velocity (overlay)
        Plot(vel + ktag, [vel, rec + ktag, ico], 'Overlay')
    allvxx = map(lambda x: vel + '-%04d' % x, receivers)
    Plot('allvxx', allvxx, 'Movie')

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

    # ------------------------------------------------------------
    # image all traces at once

    # wavefield
    # z-x-t
    Flow(
        uyy, 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']))
    Result(uyy, 'byte gainpanel=a pclip=100 |' + igrey('', par))

    # WDF over y
    # z-x-t
    Flow(wyy, uyy, 'wdf verb=y nh1=%(nhz)d nh2=%(nhx)d nh3=%(nht)d' % par)
    Result(wyy, 'byte gainpanel=a pclip=100 |' + igrey('', par))
    # ------------------------------------------------------------

    # ------------------------------------------------------------
    # image each trace separately
    for k in receivers:
        ktag = "-%04d" % k

        # data trace
        Flow(dat + ktag, dat, 'window squeeze=n n1=1 f1=%g' % k)
        Flow(dat + ktag + '-rev', dat + ktag,
             'reverse which=2 opt=i verb=y | pad end2=%(tpad)d' % par)

        fdmod.awefd(dat + ktag + '-bck', dat + ktag + '-wfl',
                    dat + ktag + '-rev', vel, den, rec + ktag, rec + ktag,
                    iwindow, par)

        # z-x-t
        Flow(
            uyy + ktag, dat + ktag + '-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']))
        Result(uyy + ktag, 'byte gainpanel=a pclip=100 |' + igrey('', par))

        # z*x-.-t
        Flow(uxx + ktag, uyy + ktag,
             'put n1=%d n2=1' % (par['nqz'] * par['nqx']))

    # collect traces at the image point for all receiver locations
    # wavefield
    # z*x-xs-t
    Flow(uxx + '-all', map(lambda x: uxx + '-%04d' % x, receivers),
         'cat axis=2 space=n ${SOURCES[1:%d]}' % (par['nrec']))

    # WDF over x
    # z*x-xs-t
    Flow(wxx + '-all', uxx + '-all', '''
         wdf verb=y nh1=0 nh2=100 nh3=%(nht)d
         ''' % par)

    for k in (uxx, wxx):

        # all traces around the target
        # z-x-t
        Flow(
            k + '-cub', k + '-all', '''
             stack |
             transp plane=23 |
             put
             n1=%d o1=%g d1=%g label1=z unit1=''
             n2=%d o2=%g d2=%g label2=x unit2=''
             ''' % (par['nqz'], par['oqz'], par['dqz'], par['nqx'], par['oqx'],
                    par['dqx']))

        # one trace at the target
        # xs-t
        Flow(k, k + '-all',
             'window n1=1 f1=%d | transp' % (par['nqz'] * par['nqx'] / 2))

        Result(
            k, '''
               put o2=%g d2=%g | 
               grey title="" pclip=98 labelsz=6 labelfat=2
               label1=%s unit1=%s
               label2=%s unit2=%s
               screenratio=0.3 screenht=4
               %s
               ''' %
            (par['ox'] + par['orec'] * par['dx'], par['jrec'] * par['dx'],
             par['lt'], par['ut'], par['lx'], par['ux'], par['labelattr']))

    # z-x
    Flow(cii, wxx + '-cub', 'window n3=1 f3=%d' % par['tcut'])
    Plot(cii, fdmod.cgrey('pclip=100', par))
    Result(cii, [cii, 'rr'], 'Overlay')
    Result(
        'win' + cii, cii,
        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))
Ejemplo n.º 17
0
def wdfic(cii,
          uxx,uyy,
          wxx,wyy,
          dat,vel,den,rec,ico,par):
    
    # ------------------------------------------------------------
    par['jrec']=5
    par['nrec']=320
    par['orec']=0
    par['jrec']=10
    par['nrec']=160
    
    receivers = range(par['orec'],par['orec']+par['nrec']*par['jrec'],par['jrec'])
    # ------------------------------------------------------------

    for k in receivers:
        ktag = "-%04d" % k
        
        # source coordinates
        Flow(rec+ktag,rec,'window n2=1 f2=%g' % k )
        Plot(rec+ktag,    'window |' + fdmod.rrplot('',par))
        
        # velocity (overlay)
        Plot(vel+ktag,[vel,rec+ktag,ico],'Overlay')
    allvxx = map(lambda x: vel+'-%04d' % x,receivers)
    Plot('allvxx',allvxx,'Movie')

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

    # ------------------------------------------------------------
    # image all traces at once

    # wavefield
    # z-x-t
    Flow(uyy,
         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']))
    Result(uyy,'byte gainpanel=a pclip=100 |' + igrey('',par))

    # WDF over y
    # z-x-t
    Flow(wyy,
         uyy,
         'wdf verb=y nh1=%(nhz)d nh2=%(nhx)d nh3=%(nht)d' % par)
    Result(wyy,'byte gainpanel=a pclip=100 |' + igrey('',par))
    # ------------------------------------------------------------

    # ------------------------------------------------------------
    # image each trace separately
    for k in receivers:
        ktag = "-%04d" % k
        
        # data trace
        Flow(dat+ktag,
             dat,'window squeeze=n n1=1 f1=%g' % k )
        Flow(dat+ktag+'-rev',
             dat+ktag,'reverse which=2 opt=i verb=y | pad end2=%(tpad)d' % par)
        
        fdmod.awefd(dat+ktag+'-bck',
                    dat+ktag+'-wfl',
                    dat+ktag+'-rev',
                    vel,den,
                    rec+ktag,rec+ktag,iwindow,par)

        # z-x-t
        Flow(uyy+ktag,
             dat+ktag+'-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']))
        Result(uyy+ktag,'byte gainpanel=a pclip=100 |' + igrey('',par))

        # z*x-.-t
        Flow(uxx+ktag,
             uyy+ktag,
             'put n1=%d n2=1' % (par['nqz']*par['nqx']) )
        
    # collect traces at the image point for all receiver locations
    # wavefield
    # z*x-xs-t
    Flow(uxx+'-all',
         map(lambda x: uxx+'-%04d' % x,receivers),
         'cat axis=2 space=n ${SOURCES[1:%d]}' % (par['nrec']))

    # WDF over x
    # z*x-xs-t
    Flow(wxx+'-all',
         uxx+'-all',
         '''
         wdf verb=y nh1=0 nh2=100 nh3=%(nht)d
         ''' % par)

    for k in (uxx,wxx):

        # all traces around the target
        # z-x-t
        Flow(k+'-cub',
             k+'-all',
             '''
             stack |
             transp plane=23 |
             put
             n1=%d o1=%g d1=%g label1=z unit1=''
             n2=%d o2=%g d2=%g label2=x unit2=''
             ''' % (par['nqz'],par['oqz'],par['dqz'],
                    par['nqx'],par['oqx'],par['dqx']))

        # one trace at the target
        # xs-t
        Flow(k,
             k+'-all',
             'window n1=1 f1=%d | transp' % (par['nqz']*par['nqx']/2) )        
        
        Result(k,
               '''
               put o2=%g d2=%g | 
               grey title="" pclip=98 labelsz=6 labelfat=2
               label1=%s unit1=%s
               label2=%s unit2=%s
               screenratio=0.3 screenht=4
               %s
               ''' % (par['ox']+par['orec']*par['dx'],
                      par['jrec']*par['dx'],
                      par['lt'],par['ut'],
                      par['lx'],par['ux'],
                      par['labelattr']) )

    # z-x
    Flow(cii,
         wxx+'-cub',
         'window n3=1 f3=%d' % par['tcut'])
    Plot(cii,fdmod.cgrey('pclip=100',par))
    Result(cii,[cii,'rr'],'Overlay')        
    Result('win'+cii,
           cii,
           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))
Ejemplo n.º 18
0
def run(par):
    # experiments
    fdmod.horizontal('rr', 0, par)

    Plot('rr', 'window j2=10|' + fdmod.rrplot('', par))
    Plot('ss', 'window      |' + fdmod.ssplot('', par))
    Plot('sx', 'window      |' + fdmod.ssplot('plotcol=5', par))

    # wavelet
    fdmod.wavelet('wav_', par['frq'], par)
    Flow('wav', 'wav_', 'transp')
    Result('wav', 'window n2=200 |' + fdmod.waveplot('', par))

    # velocity
    Flow(
        'vbck', None, '''
         math n1=%(nz)d o1=%(oz)g d1=%(dz)g output="2000" |
         spray axis=2 n=%(nx)d o=%(ox)g d=%(dx)g
         ''' % par)
    Flow(
        'vprt', None, '''
         spike nsp=1 mag=1
         n1=%(nz)d o1=%(oz)g d1=%(dz)g k1=%(kz)d l1=%(mz)d
         n2=%(nx)d o2=%(ox)g d2=%(dx)g k2=%(kx)d l2=%(mx)d |
         smooth rect1=25 rect2=25 repeat=3 |
         scale axis=123 |
         scale rscale=%(vprt)g
         ''' % par)
    Flow('velo', 'vbck vprt', 'add ${SOURCES[1]}')
    Plot('velo', fdmod.cgrey('allpos=y bias=1200 pclip=100 color=g', par))
    Result('velo', ['velo', 'ss', 'sx'], 'Overlay')

    # density
    Flow('dens', 'velo', 'math output=1')

    # reflector
    Plot(
        'refl', 'refl velo', '''
         depth2time velocity=${SOURCES[1]} dt=%(dt)g nt=%(nt)d |
         scale rscale=-1 |
         ricker1 frequency=%(frq)g |
         time2depth velocity=${SOURCES[1]} dz=%(dz)g nz=%(nz)d |
         ''' % par + fdmod.cgrey('pclip=100', par))
    Result('refl', ['refl', 'ss', 'sx'], 'Overlay')

    # mask
    Flow(
        'mask', None, '''
         spike nsp=1 mag=1
         n1=%(nx)d o1=%(ox)g d1=%(dx)g k1=101 l1=900
         n2=%(nt)d o2=%(ot)g d2=%(dt)g |
         smooth rect1=100 |
         scale axis=123
         ''' % par)
    Result('mask', 'transp |' + fdmod.dgrey('allpos=y pclip=100', par))

    # F-D modeling (born)
    fdmod.lwefd1('do', 'wo', 'dd', 'wd', 'wav', 'velo', 'dens', 'refl', 'ss',
                 'rr', 'jsnap=100', par)
    Result(
        'do', 'transp | window min1=0.25 |' +
        fdmod.dgrey('min1=0.25 pclip=100', par))
    Result(
        'dd', 'transp | window min1=0.25 |' +
        fdmod.dgrey('min1=0.25 pclip=100', par))
    Result('wo', fdmod.wgrey('', par))
    Result('wd', fdmod.wgrey('', par))

    # source data and wavefield
    fdmod.awefd1('ds', 'ws', 'wav', 'velo', 'dens', 'sx', 'rr', '', par)
    Result('ws', 'window j3=20 |' + fdmod.wgrey('', par))

    # receiver wavefield
    Flow('du', 'dd mask',
         'add mode=p ${SOURCES[1]} | reverse which=2 opt=i verb=y')
    fdmod.awefd('dx', 'wx', 'du', 'velo', 'dens', 'rr', 'rr', '', par)
    Flow('dr', 'dx', 'reverse which=2 opt=i verb=y')
    Flow('wr', 'wx', 'reverse which=4 opt=i verb=y')
    Result('wr', 'window j3=20 |' + fdmod.wgrey('', par))

    for i in range(0, par['nt'] / 100, 1):
        fdmod.wframe('wo' + '-' + str(i), 'wo', i, 'pclip=99.9', par)
        fdmod.wframe('wd' + '-' + str(i), 'wd', i, 'pclip=100', par)

    for i in range(0, par['nt'] / 100, 1):
        fdmod.wframe('wx' + '-' + str(i), 'wx', i * 25, 'pclip=99.9', par)

    # ------------------------------------------------------------
    minx = 500
    maxx = 1500
    minz = par['oz'] + par['nz'] * par['dz'] / 2
    numz = par['nz'] / 2

    mint = 0.1
    numt = 150
    maxt = mint + numt * par['dt'] * par['jsnap']

    # wavefield
    for i in ('s', 'r'):
        Flow(
            'u' + i, 'w' + i, '''
             window min1=%(zmin)g max1=%(zmax)g min2=%(xmin)g max2=%(xmax)g |
             scale axis=123
             ''' % par)
        Plot('u' + i, 'window j3=10 |' + fdmod.wgrey('pclip=99', par), view=1)

        for k in range(0, par['nt'] / par['jsnap'], 25):
            fdmod.wframe('u' + i + '-' + str(k / 25), 'u' + i, k, 'pclip=99',
                         par)

        # windowed wavefields
        Flow(
            'p' + i, 'u' + i, '''
             window min1=%g n1=%g min2=%g max2=%g min3=%g n3=%g
             ''' % (minz, numz, minx, maxx, mint, numt))
        Flow('q' + i, 'p' + i, 'transp plane=13 memsize=500')
        Flow('o' + i, 'q' + i, 'transp plane=23 memsize=500')

    Flow('qi', 'qs qr', 'add mode=p ${SOURCES[1]}')
    Flow('oi', 'os or', 'add mode=p ${SOURCES[1]}')

    for i in ('s', 'r', 'i'):
        Plot('q' + i,
             'window j3=10 |' + fdmod.dgrey('gainpanel=a pclip=100', par),
             view=1)
        Plot('o' + i,
             'window j3=10 | transp |' +
             fdmod.egrey('gainpanel=a pclip=100', par),
             view=1)

        Flow(['q' + i + 'plt', 'q' + i + 'bar'], 'q' + i,
             'byte bar=${TARGETS[1]} gainpanel=a pclip=100')
        for k in range(10):
            Result(
                'q' + i + 'plt' + str(k), ['q' + i + 'plt', 'q' + i + 'bar'],
                'window n3=1 f3=%d |' % (10 * k) + fdmod.dgrey(
                    '''
                bar=${SOURCES[1]} min1=%g max1=%g min2=%g max2=%g
                labelsz=8 labelfat=3 screenratio=1.5
                ''' % (mint, maxt, minx, maxx), par))

    # cut along the reflectors
    Flow(
        'cut', 'refl', '''
         window min1=%g n1=%g min2=%g max2=%g |
         spray axis=3 n=%d o=%g d=%g |
         transp plane=13 memsize=500
         ''' % (minz, numz, minx, maxx, numt, 0.1, par['dt'] * 4))

    for i in ('s', 'r'):
        Flow(
            'c' + i, ['q' + i, 'cut'], '''
             add mode=p ${SOURCES[1]} |
             transp plane=23 |
             stack
             ''')
        Result('c' + i, fdmod.dgrey('', par))

        Flow('f' + i, 'q' + i, 'window n3=1 min3=300')
        Result('f' + i, fdmod.dgrey('', par))

    # ------------------------------------------------------------
    # conventional IC
    Flow('ii', ['ps', 'pr'], 'ic ur=${SOURCES[1]} version=0 nbuf=500 verb=y')
    Plot('ii', fdmod.cgrey('pclip=99.9', par))
    Result('ii', ['ii', 'ss', 'sx'], 'Overlay')
Ejemplo n.º 19
0
def run(par):
    # experiments
    fdmod.horizontal('rr',0,par)

    Plot('rr','window j2=10|' + fdmod.rrplot('',par))
    Plot('ss','window      |' + fdmod.ssplot('',par))
    Plot('sx','window      |' + fdmod.ssplot('plotcol=5',par))
    
    # wavelet
    fdmod.wavelet('wav_',par['frq'],par)
    Flow('wav','wav_','transp')
    Result('wav','window n2=200 |' + fdmod.waveplot('',par))
    
    # velocity
    Flow('vbck',None,
         '''
         math n1=%(nz)d o1=%(oz)g d1=%(dz)g output="2000" |
         spray axis=2 n=%(nx)d o=%(ox)g d=%(dx)g
         ''' % par)
    Flow('vprt',None,
         '''
         spike nsp=1 mag=1
         n1=%(nz)d o1=%(oz)g d1=%(dz)g k1=%(kz)d l1=%(mz)d
         n2=%(nx)d o2=%(ox)g d2=%(dx)g k2=%(kx)d l2=%(mx)d |
         smooth rect1=25 rect2=25 repeat=3 |
         scale axis=123 |
         scale rscale=%(vprt)g
         ''' % par)
    Flow(  'velo','vbck vprt','add ${SOURCES[1]}')
    Plot(  'velo',fdmod.cgrey('allpos=y bias=1200 pclip=100 color=g',par))
    Result('velo',['velo','ss','sx'],'Overlay')
    
    # density
    Flow('dens','velo','math output=1')
    
    # reflector
    Plot('refl','refl velo',
         '''
         depth2time velocity=${SOURCES[1]} dt=%(dt)g nt=%(nt)d |
         scale rscale=-1 |
         ricker1 frequency=%(frq)g |
         time2depth velocity=${SOURCES[1]} dz=%(dz)g nz=%(nz)d |
         ''' % par + fdmod.cgrey('pclip=100',par))
    Result('refl',['refl','ss','sx'],'Overlay')

    # mask
    Flow('mask',None,
         '''
         spike nsp=1 mag=1
         n1=%(nx)d o1=%(ox)g d1=%(dx)g k1=101 l1=900
         n2=%(nt)d o2=%(ot)g d2=%(dt)g |
         smooth rect1=100 |
         scale axis=123
         ''' % par)
    Result('mask','transp |' + fdmod.dgrey('allpos=y pclip=100',par))
        
    # F-D modeling (born)
    fdmod.lwefd1(
        'do','wo',
        'dd','wd',
        'wav','velo','dens','refl','ss','rr','jsnap=100',par)
    Result('do','transp | window min1=0.25 |' + fdmod.dgrey('min1=0.25 pclip=100',par))
    Result('dd','transp | window min1=0.25 |' + fdmod.dgrey('min1=0.25 pclip=100',par))
    Plot('wo',fdmod.wgrey('',par),view=1)
    Plot('wd',fdmod.wgrey('',par),view=1)

    # source data and wavefield
    fdmod.awefd1(
        'ds','ws',
        'wav','velo','dens','sx','rr','',par)
    Plot('ws','window j3=20 |' + fdmod.wgrey('',par),view=1)

    # receiver wavefield
    Flow('du','dd mask',
         'add mode=p ${SOURCES[1]} | reverse which=2 opt=i verb=y')
    fdmod.awefd(
        'dx','wx',
        'du','velo','dens','rr','rr','',par)
    Flow('dr','dx','reverse which=2 opt=i verb=y')
    Flow('wr','wx','reverse which=4 opt=i verb=y')
    Plot('wr','window j3=20 |' + fdmod.wgrey('',par),view=1)

    for i in range(0,par['nt']/100,1):
        fdmod.wframe('wo'+'-'+str(i),'wo',i,'pclip=99.9',par)
        fdmod.wframe('wd'+'-'+str(i),'wd',i,'pclip=100',par)

    for i in range(0,par['nt']/100,1):
        fdmod.wframe('wx'+'-'+str(i),'wx',i*25,'pclip=99.9',par)
    
    # ------------------------------------------------------------
    minx=500
    maxx=1500
    minz=par['oz']+par['nz']*par['dz']/2
    numz=par['nz']/2

    mint=0.1
    numt=150
    maxt=mint+numt*par['dt']*par['jsnap']

    # wavefield
    for i in ('s','r'):
        Flow('u'+i,'w'+i,
             '''
             window min1=%(zmin)g max1=%(zmax)g min2=%(xmin)g max2=%(xmax)g |
             scale axis=123
             ''' % par)
        Plot('u'+i,'window j3=10 |' + fdmod.wgrey('pclip=99',par),view=1)

        for k in range(0,par['nt']/par['jsnap'],25):
            fdmod.wframe('u'+i+'-'+str(k/25),'u'+i,k,'pclip=99',par)
        
        # windowed wavefields
        Flow('p'+i,'u'+i,
             '''
             window min1=%g n1=%g min2=%g max2=%g min3=%g n3=%g
             ''' % (minz,numz,
                    minx,maxx,
                    mint,numt))
        Flow('q'+i,'p'+i,'transp plane=13 memsize=500')
        Flow('o'+i,'q'+i,'transp plane=23 memsize=500')
        
    Flow(  'qi','qs qr','add mode=p ${SOURCES[1]}')
    Flow(  'oi','os or','add mode=p ${SOURCES[1]}')
    
    for i in ('s','r','i'):
        Plot('q'+i,'window j3=10 |'
             + fdmod.dgrey('gainpanel=a pclip=100',par),view=1)    
        Plot('o'+i,'window j3=10 | transp |'
             + fdmod.egrey('gainpanel=a pclip=100',par),view=1)
        
        Flow(['q'+i+'plt','q'+i+'bar'],'q'+i,
             'byte bar=${TARGETS[1]} gainpanel=a pclip=100')
        for k in range(10):
            Result('q'+i+'plt'+str(k),['q'+i+'plt','q'+i+'bar'],
                   'window n3=1 f3=%d |' % (10*k) +
                   fdmod.dgrey(
                '''
                bar=${SOURCES[1]} min1=%g max1=%g min2=%g max2=%g
                labelsz=8 labelfat=3 screenratio=1.5
                ''' %(mint,maxt,minx,maxx),par))
        
    # cut along the reflectors
    Flow('cut','refl',
         '''
         window min1=%g n1=%g min2=%g max2=%g |
         spray axis=3 n=%d o=%g d=%g |
         transp plane=13 memsize=500
         ''' % (minz,numz,
                minx,maxx,
                numt,0.1,par['dt']*4) )
    
    for i in ('s','r'):
        Flow('c'+i,['q'+i,'cut'],
             '''
             add mode=p ${SOURCES[1]} |
             transp plane=23 |
             stack
             ''')
        Result('c'+i,fdmod.dgrey('',par))

        Flow(  'f'+i,'q'+i,'window n3=1 min3=300')
        Result('f'+i,fdmod.dgrey('',par))

    # ------------------------------------------------------------
    # conventional IC
    Flow(  'ii',['ps','pr'],'ic ur=${SOURCES[1]} version=0 nbuf=500 verb=y')
    Plot(  'ii',fdmod.cgrey('pclip=99.9',par))
    Result('ii',['ii','ss','sx'],'Overlay')