コード例 #1
0
ファイル: sigsbeewemva.py プロジェクト: jcapriot/src
def shotcoord(ss,par):

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

        xsou = par['os'] + (par['fs'] + iexp * par['js']) * par['ds']
        fdmod.point('ss'+etag,xsou,par['ozimg'],par)
        Plot(ss+etag,fdmod.ssplot('plotcol=5',par))

    Plot(ss,[ss+'-e%03d'%x for x in range(par['ns'])],
         'cat axis=3 space=n ${SOURCES[1:%d]} |' % par['ns']
         + fdmod.ssplot('plotcol=5',par))
コード例 #2
0
ファイル: slides_fig.py プロジェクト: ediaz/toto-stuff
 def ssplot(self,custom,scalar,horizontal=True):
   self._scale(scalar,horizontal)
   return fdmod.ssplot(custom,self.par)
コード例 #3
0
ファイル: itest.py プロジェクト: wangdanhui970520/mada
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=F', 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)
        Result('u' + i, 'window j3=10 |' + fdmod.wgrey('pclip=99', par))

        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'):
        Result('q' + i,
               'window j3=10 |' + fdmod.dgrey('gainpanel=a pclip=100', par))
        Result(
            'o' + i, 'window j3=10 | transp |' +
            fdmod.egrey('gainpanel=a pclip=100', par))

        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')