slimgroup / JUDI.jl

Julia Devito inversion.
https://slimgroup.github.io/JUDI.jl
MIT License
96 stars 29 forks source link

Output Wavefield From Extended Source Isn't Implemented #169

Open tjk9501 opened 1 year ago

tjk9501 commented 1 year ago

Hello Slimgroup!

I want to use the JUDI software to output wavefields when implementing 2D acoustic wave modeling using extended sources, but it seems that the "output wavefield from extended source" function is not yet implemented, so this issue is created. I hope to achieve the following functionality in JUDI:

# Extended source weights
weights = Array{Array}(undef, nsrc)
for j=1:nsrc
    weights[j] = randn(Float32, model.n)
end
w = judiWeights(weights)
F = judiModeling(model; options=opt)
Pw = judiLRWF(dt, wavelet);
F = F*adjoint(Pw)
d_sim = F*w

The modeling region is a 120 by 100 2D grid, total time step is 251, I hope to retrive the wavefield, which is 251 by 120 by 100 3D array. But now executing

d_sim = F*w

will result in errors because output wavefield from extended source function is not yet implemented. The output error is

julia> d_sim = F*w
ERROR: MethodError: no method matching devito_interface(::PyCall.PyObject, ::Matrix{Float32}, ::Matrix{Float32}, ::Nothing, ::Nothing, ::Nothing, ::JUDIOptions, ::Bool, ::Bool)
Closest candidates are:
  devito_interface(::PyCall.PyObject, ::Geometry, ::Array, ::Nothing, ::Nothing, ::Nothing, ::JUDIOptions, ::Bool, ::Bool) at ~/.julia/packages/JUDI/wJSeg/src/TimeModeling/Modeling/python_interface.jl:76
  devito_interface(::PyCall.PyObject, ::Nothing, ::Array, ::Nothing, ::Nothing, ::Nothing, ::JUDIOptions, ::Bool, ::Bool) at ~/.julia/packages/JUDI/wJSeg/src/TimeModeling/Modeling/python_interface.jl:103
  devito_interface(::PyCall.PyObject, ::Array, ::Array, ::Geometry, ::Nothing, ::Nothing, ::JUDIOptions, ::Bool, ::Bool) at ~/.julia/packages/JUDI/wJSeg/src/TimeModeling/Modeling/python_interface.jl:153
  ...
Stacktrace:
 [1] time_modeling(model_full::Model, srcGeometry::Matrix{Float32}, srcData::Matrix{Float32}, recGeometry::Nothing, recData::Nothing, dm::Nothing, op::Symbol, options::JUDIOptions, fw::Bool)
   @ JUDI ~/.julia/packages/JUDI/wJSeg/src/TimeModeling/Modeling/time_modeling_serial.jl:39
 [2] propagate(F::judiPointSourceModeling{Float32, :forward}, q::judiWeights{Float32})
   @ JUDI ~/.julia/packages/JUDI/wJSeg/src/TimeModeling/Modeling/propagation.jl:9
 [3] run_and_reduce(func::Function, #unused#::Nothing, nsrc::Int64, arg_func::JUDI.var"#234#235"{judiPointSourceModeling{Float32, :forward}, judiWeights{Float32}})
   @ JUDI ~/.julia/packages/JUDI/wJSeg/src/TimeModeling/Modeling/propagation.jl:32
 [4] multi_src_propagate(F::judiPointSourceModeling{Float32, :forward}, q::judiWeights{Float32})
   @ JUDI ~/.julia/packages/JUDI/wJSeg/src/TimeModeling/Modeling/propagation.jl:67
 [5] *(F::judiPointSourceModeling{Float32, :forward}, q::judiWeights{Float32})
   @ JUDI ~/.julia/packages/JUDI/wJSeg/src/TimeModeling/LinearOperators/operators.jl:173
 [6] top-level scope
   @ REPL[33]:1