slimgroup / timeprobeseismic.jl Goto Github PK
View Code? Open in Web Editor NEWMemory efficient seismic inversion via trace estimation
License: MIT License
Memory efficient seismic inversion via trace estimation
License: MIT License
This issue is used to trigger TagBot; feel free to unsubscribe.
If you haven't already, you should update your TagBot.yml
to include issue comment triggers.
Please see this post on Discourse for instructions and more details.
If you'd like for me to do this for you, comment TagBot fix
on this issue.
I'll open a PR within a few hours, please be patient!
MFE is attached. adjoint(judiJacobian(F0,q,ps,dD))*dD
seems only to do RTM probing on the first source (while F0
,q
include multiple sources). lsrtm_objective
works well!
using Pkg
Pkg.activate("TimeProbeSeismic")
Pkg.add(url="https://github.com/slimgroup/JUDI.jl.git",rev="pyload")
Pkg.update()
Pkg.instantiate()
using DrWatson
@quickactivate :TimeProbeSeismic
using JLD2, FFTW, DSP
# Set up model structure
n = (1200, 200) # (x,y,z) or (x,z)
d = (10., 10.)
o = (0., 0.)
# Velocity [km/s]
v = ones(Float32,n) .+ 0.5f0
v[:,30:end] .= 3.5f0
# Slowness squared [s^2/km^2]
m = (1f0 ./ v).^2
m0 = convert(Array{Float32,2},imfilter(m, Kernel.gaussian(3)))
dm = vec(m - m0)
# Setup info and model structure
nsrc = 2 # number of sources
model = Model(n, d, o, m)
model0 = Model(n, d, o, m0)
# Set up receiver geometry
nxrec = 480
xrec = range(3000f0, stop=9000f0, length=nxrec)
yrec = 0f0
zrec = range(50f0, stop=50f0, length=nxrec)
# receiver sampling and recording time
timeR = 1000f0 # receiver recording time [ms]
dtR = 2f0 # receiver sampling interval [ms]
# Set up receiver structure
recGeometry = Geometry(xrec, yrec, zrec; dt=dtR, t=timeR, nsrc=nsrc)
# Set up source geometry (cell array with source locations for each shot)
xsrc = convertToCell(range(5000f0, stop=7000f0, length=nsrc))
ysrc = convertToCell(range(0f0, stop=0f0, length=nsrc))
zsrc = convertToCell(range(200f0, stop=200f0, length=nsrc))
# source sampling and number of time steps
timeS = 1000f0 # ms
dtS = 2f0 # ms
# Set up source structure
srcGeometry = Geometry(xsrc, ysrc, zsrc; dt=dtS, t=timeS)
# setup wavelet
f0 = 0.015f0 # kHz
wavelet = ricker_wavelet(timeS, dtS, f0)
q = judiVector(srcGeometry, wavelet)
# Set up info structure for linear operators
ntComp = get_computational_nt(srcGeometry, recGeometry, model)
info = Info(prod(n), nsrc, ntComp)
###################################################################################################
# Write shots as segy files to disk
opt = Options(isic=true)
# Setup operators
Pr = judiProjection(info, recGeometry)
F0 = judiModeling(info, model0; options=opt)
Ps = judiProjection(info, srcGeometry)
F0 = Pr*F0*adjoint(Ps)
J = judiJacobian(F0, q)
# Linearized modeling
dD = J*dm
# Adjoint jacobian
println("conventional RTM")
@time rtm = adjoint(J)*dD
# probing RTM
println("32 probing vectors")
@time rtm_32 = adjoint(judiJacobian(F0,q,32,dD))*dD
figure();imshow(rtm.data',aspect=3,cmap="Greys",vmin=-0.1*norm(rtm.data,Inf),vmax=0.1*norm(rtm.data,Inf));title("conventional RTM")
figure();imshow(rtm_32.data',aspect=3,cmap="Greys",vmin=-0.1*norm(rtm.data,Inf),vmax=0.1*norm(rtm.data,Inf));title("RTM w/ 32 probing vectors")
f, g = JUDI.lsrtm_objective(model0, q, dD, 0f0 .* dm; nlind=false, options=opt)
f_32, g_32 = JUDI.lsrtm_objective(model0, q, dD, 0f0 .* dm, 32; nlind=false, options=opt)
figure();imshow(-g',aspect=3,cmap="Greys",vmin=-0.1*norm(rtm.data,Inf),vmax=0.1*norm(rtm.data,Inf));title("conventional RTM (by lsrtm_objective)")
figure();imshow(-g_32',aspect=3,cmap="Greys",vmin=-0.1*norm(rtm.data,Inf),vmax=0.1*norm(rtm.data,Inf));title("RTM w/ 32 probing vectors (by lsrtm_objective)")
(base) francisyin@ipsec-172-16-85-30 scripts % julia
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.5.0 (2020-08-01)
_/ |\__'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |
julia> pwd()
"/Users/francisyin/.julia/dev/TimeProbeSeismic/scripts"
julia> using Pkg
julia> Pkg.activate("/Users/francisyin/.julia/dev/TimeProbeSeismic")
Activating environment at `~/.julia/dev/TimeProbeSeismic/Project.toml`
julia> Pkg.instantiate()
Updating registry at `~/.julia/registries/General`
Updating registry at `~/.julia/registries/SLIMregistryJL`
Updating git-repo `https://github.com/slimgroup/SLIMregistryJL.git`
Cloning git-repo `https://GitHub.com/slimgroup/JUDI.jl.git`
ERROR: TypeError: in typeassert, expected VersionNumber, got a value of type Pkg.Types.VersionSpec
Stacktrace:
[1] load_urls(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/Pkg/src/Operations.jl:503
[2] #download_source#54 at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/Pkg/src/Operations.jl:679 [inlined]
[3] download_source at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/Pkg/src/Operations.jl:678 [inlined]
[4] instantiate(::Pkg.Types.Context; manifest::Nothing, update_registry::Bool, verbose::Bool, platform::Pkg.BinaryPlatforms.MacOS, kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/Pkg/src/API.jl:868
[5] instantiate(::Pkg.Types.Context) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/Pkg/src/API.jl:796
[6] #instantiate#169 at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/Pkg/src/API.jl:792 [inlined]
[7] instantiate() at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/Pkg/src/API.jl:792
[8] top-level scope at REPL[4]:1
Maybe for future reference, we can add seed as an input to lsrtm_objective
, fwi_objective
, judiJacobian
, etc so that we have more control of randomization of probing vectors. Now seed is only in qr_data
and not included by any operator.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.