コード例 #1
0
def test_Marchenko(par):
    """Dot-test and comparison with pylops for Marchenko.apply_onepoint
    """
    dMarchenkoWM = dMarchenko(dRtwosided_fft,
                              nt=nt,
                              dt=dt,
                              dr=dr,
                              wav=wav,
                              toff=toff,
                              nsmooth=nsmooth,
                              saveRt=par['saveRt'])

    MarchenkoWM = Marchenko(Rtwosided_fft,
                            nt=nt,
                            dt=dt,
                            dr=dr,
                            wav=wav,
                            toff=toff,
                            nsmooth=nsmooth)

    _, _, dp0_minus, dg_inv_minus, dg_inv_plus = \
        dMarchenkoWM.apply_onepoint(trav, nfft=2 ** 11, rtm=True, greens=True,
                                    dottest=True, **dict(niter=10,
                                                         compute=False))

    _, _, p0_minus = \
        MarchenkoWM.apply_onepoint(trav, nfft=2 ** 11, rtm=True, greens=False,
                                   dottest=False, **dict(iter_lim=0, show=0))
    assert_array_almost_equal(dp0_minus, p0_minus, decimal=5)

    dginvsub = (dg_inv_minus + dg_inv_plus)[:, nt - 1:].T
    dginvsub_norm = dginvsub / dginvsub.max()
    gsub_norm = gsub / gsub.max()
    assert np.linalg.norm(gsub_norm - dginvsub_norm) / \
           np.linalg.norm(gsub_norm) < 1e-1
コード例 #2
0
def test_Marchenko_time(par):
    """Solve marchenko equations using input Rs in time domain
    """
    MarchenkoWM = Marchenko(R, dt=dt, dr=dr, nfmax=nfmax, wav=wav,
                            toff=toff, nsmooth=nsmooth)

    _, _, _, g_inv_minus, g_inv_plus = \
        MarchenkoWM.apply_onepoint(trav, G0=g0sub.T, rtm=True, greens=True,
                                   dottest=True, **dict(iter_lim=par['niter'],
                                                        show=0))
    ginvsub = (g_inv_minus + g_inv_plus)[:, nt - 1:].T
    ginvsub_norm = ginvsub / ginvsub.max()
    gsub_norm = gsub / gsub.max()
    assert np.linalg.norm(gsub_norm - ginvsub_norm) / \
           np.linalg.norm(gsub_norm) < 1e-1
コード例 #3
0
def test_Marchenko_freq(par):
    """Solve marchenko equations using input Rs in frequency domain
    """
    if par['prescaled']:
        Rtwosided_fft_sc = np.sqrt(2*nt - 1) * dt * dr * Rtwosided_fft
        R1twosided_fft_sc = np.sqrt(2*nt - 1) * dt * dr * R1twosided_fft
    else:
        Rtwosided_fft_sc = Rtwosided_fft
        R1twosided_fft_sc = R1twosided_fft
    MarchenkoWM = Marchenko(Rtwosided_fft_sc, R1=R1twosided_fft_sc,
                            nt=nt, dt=dt, dr=dr, nfmax=nfmax, wav=wav,
                            toff=toff, nsmooth=nsmooth,
                            prescaled=par['prescaled'])

    _, _, _, g_inv_minus, g_inv_plus = \
        MarchenkoWM.apply_onepoint(trav, G0=g0sub.T, rtm=True, greens=True,
                                   dottest=True, **dict(iter_lim=par['niter'],
                                                        show=0))
    ginvsub = (g_inv_minus + g_inv_plus)[:, nt-1:].T
    ginvsub_norm = ginvsub / ginvsub.max()
    gsub_norm = gsub / gsub.max()
    assert np.linalg.norm(gsub_norm-ginvsub_norm) / \
           np.linalg.norm(gsub_norm) < 1e-1