コード例 #1
0
ファイル: sensitivity.py プロジェクト: pilotlynd/JUDI.jl
def crosscorr_freq(u, v, model, freq=None, dft_sub=None, **kwargs):
    """
    Standard cross-correlation imaging condition with on-th-fly-dft

    Parameters
    ----------
    u: TimeFunction or Tuple
        Forward wavefield (tuple of fields for TTI or dft)
    v: TimeFunction or Tuple
        Adjoint wavefield (tuple of fields for TTI)
    model: Model
        Model structure
    freq: Array
        Array of frequencies for on-the-fly DFT
    factor: int
        Subsampling factor for DFT
    """
    # Subsampled dft time axis
    time = model.grid.time_dim
    dt = time.spacing
    tsave, factor = sub_time(time, dft_sub)
    expr = 0
    for uu, vv in zip(u, v):
        ufr, ufi = uu
        # Frequencies
        nfreq = freq.shape[0]
        f = Function(name='f', dimensions=(ufr.dimensions[0],), shape=(nfreq,))
        f.data[:] = freq[:]
        omega_t = 2*np.pi*f*tsave*factor*dt
        # Gradient weighting is (2*np.pi*f)**2/nt
        w = (2*np.pi*f)**2/time.symbolic_max
        expr += w*(ufr*cos(omega_t) - ufi*sin(omega_t))*vv
    return expr
コード例 #2
0
ファイル: sensitivity.py プロジェクト: wangxch2019/JUDI.jl
def crosscorr_freq(u, v, model, freq=None, dft_sub=None, **kwargs):
    """
    Standard cross-correlation imaging condition with on-th-fly-dft

    Parameters
    ----------
    u: TimeFunction or Tuple
        Forward wavefield (tuple of fields for TTI or dft)
    v: TimeFunction or Tuple
        Adjoint wavefield (tuple of fields for TTI)
    model: Model
        Model structure
    freq: Array
        Array of frequencies for on-the-fly DFT
    factor: int
        Subsampling factor for DFT
    """
    # Subsampled dft time axis
    time = model.grid.time_dim
    dt = time.spacing
    tsave, factor = sub_time(time, dft_sub)
    expr = 0

    for uu, vv in zip(u, v):
        ufr, ufi = uu
        # Frequencies
        nfreq = np.shape(freq)[0]
        fdim = ufr.dimensions[0]
        omega_t = lambda f: 2*np.pi*f*tsave*factor*dt
        # Gradient weighting is (2*np.pi*f)**2/nt
        w = lambda f: -(2*np.pi*f)**2/time.symbolic_max
        expr += sum(w(freq[ff])*(ufr._subs(fdim, ff)*cos(omega_t(freq[ff])) -
                                 ufi._subs(fdim, ff)*sin(omega_t(freq[ff])))
                    for ff in range(nfreq))*vv
    return expr
コード例 #3
0
ファイル: sensitivity.py プロジェクト: pilotlynd/JUDI.jl
def isic_freq(u, v, model, **kwargs):
    """
    Inverse scattering imaging condition

    Parameters
    ----------
    u: TimeFunction or Tuple
        Forward wavefield (tuple of fields for TTI or dft)
    v: TimeFunction or Tuple
        Adjoint wavefield (tuple of fields for TTI)
    model: Model
        Model structure
    """
    freq = kwargs.get('freq')
    # Subsampled dft time axis
    time = model.grid.time_dim
    dt = time.spacing
    tsave, factor = sub_time(time, kwargs.get('factor'))
    expr = 0
    for uu, vv in zip(u, v):
        ufr, ufi = uu
        # Frequencies
        nfreq = freq.shape[0]
        f = Function(name='f', dimensions=(ufr.dimensions[0],), shape=(nfreq,))
        f.data[:] = freq[:]
        omega_t = 2*np.pi*f*tsave*factor*dt
        # Gradient weighting is (2*np.pi*f)**2/nt
        w = (2*np.pi*f)**2/time.symbolic_max
        expr += (w * (ufr * cos(omega_t) - ufi * sin(omega_t)) * vv * model.m -
                 factor / time.symbolic_max * (grad(ufr * cos(omega_t) -
                                                    ufi * sin(omega_t)).T * grad(vv)))
    return expr
コード例 #4
0
ファイル: sensitivity.py プロジェクト: wangxch2019/JUDI.jl
def isic_freq(u, v, model, **kwargs):
    """
    Inverse scattering imaging condition

    Parameters
    ----------
    u: TimeFunction or Tuple
        Forward wavefield (tuple of fields for TTI or dft)
    v: TimeFunction or Tuple
        Adjoint wavefield (tuple of fields for TTI)
    model: Model
        Model structure
    """
    freq = kwargs.get('freq')
    # Subsampled dft time axis
    time = model.grid.time_dim
    dt = time.spacing
    tsave, factor = sub_time(time, kwargs.get('factor'))
    expr = 0
    for uu, vv in zip(u, v):
        ufr, ufi = uu
        # Frequencies
        nfreq = np.shape(freq)[0]
        fdim = ufr.dimensions[0]
        omega_t = lambda f: 2*np.pi*f*tsave*factor*dt
        # Gradient weighting is (2*np.pi*f)**2/nt
        w = lambda f: -(2*np.pi*f)**2/time.symbolic_max
        w2 = factor / time.symbolic_max
        for ff in range(nfreq):
            cwt, swt = cos(omega_t(freq[ff])), sin(omega_t(freq[ff]))
            ufrf, ufif = ufr._subs(fdim, ff), ufi._subs(fdim, ff)
            idftu = (ufrf * cwt - ufif * swt)
            expr += w(freq[ff]) * idftu * vv * model.m - w2 * inner_grad(idftu, vv)
    return expr