Download presentation
Presentation is loading. Please wait.
1
Efficient Geophysical Research in Julia
Aaron Stanton and Mauricio D. Sacchi
2
Outline Motivation Julia Seismic.jl Examples
3
Motivation Matlab is a great prototyping language But…
easy to understand, compact code many built in functions for linear algebra and plotting But… inefficient for large problems not open source Compiled languages are great for implementation efficient for large problems support all forms of parallelism difficult to follow inefficient to code and debug
4
Motivation Julia presents a new opportunity with Matlab-like syntax and C-like performance.
5
Julia Released in 2012 Completely open source with MIT license
Just-In-Time compiler compiled after execution begins has access to more information than static compilers Sophisticated type system Multiple dispatch Rich library of linear algebra and plotting functions Distributed and shared memory parallelism Pass-by-reference (pointers) Directly call C-libraries with no overhead
6
Example: For-Loops Multi-level for-loop: Matlab: 5.1041 seconds
for j1=1:100; for j2 = 1:100; for j3=1:100; for j4=1000; a += 1.0; end Matlab: seconds Julia: seconds
7
Example: POCS Matlab Julia
y = zeros(nx1,nx2,nx3,nx4); for iw = 1 : nw y(:) = d(iw,:) x = y for iter = 1 : Niter Y = fftn(y); Y = Threshold(Y,p(iter)); y = ifftn(Y); y = a*x + (1 - a*T).*y end d(iw,:) = y(:) y = zeros(nx1,nx2,nx3,nx4); for iw = 1 : nw y[:] = d[iw,:] x = copy(y) for iter = 1 : Niter Y = fft(y); Y = Threshold(Y,p[iter]); y = ifft(Y); y = a*x + (1 - a*T).*y end d[iw,:] = y[:]
8
Seismic.jl
9
Installation Pkg.add(“Seismic”)
12
Basic usage
13
Basic usage
14
Basic usage
15
Basic usage
16
I/O Reading Seismic Unix Files Writing Seismic Unix Files
SegyToSeis("foo.su","foo",{"format"=>su}) Writing Seismic Unix Files SeisToSegy("foo","foo.su",{"format"=>su}) Also supports rsf and segy formats, can swap bytes and convert from IBM to IEEE.
17
Data format: foo.seisd Ntraces x Nsamples of Binary IEEE floats
18
Header format: foo.seish
For each trace the header is stored as type Header Ntraces x 31 Binary IEEE floats/integers To see all fields type “names(Header)”
19
Package Contents Utilities Processing Imaging Solvers
20
Utilities Conversion to/from SEGY, SU, and RSF formats
Reading and writing of internal format foo.seisd foo.seish Windowing Geometry Header statistics Sorting Display header statistics Binning Patching/UnPatching Processing on groups of traces
21
Processing Semblance NMO Mute Stack Bandpass and FK fan filtering
Radon transform 5D interpolation POCS MWNI Many others to come Structural Smoothing FX deconvolution Plane wave destruction for dip estimation …
22
Imaging Pre-stack time migration
3D shot-profile angle computation using Poynting vectors 3D shot-profile acoustic/elastic one-way wave equation migration/modeling Least squares shot-profile acoustic/elastic one-way wave equation migration
23
Solvers Dot product test
Memory or disk based preconditioned conjugate gradients Iteratively Reweighted Least Squares (IRLS) Fast Iterative Soft Thresholding Algorithm (FISTA)
24
Examples
25
Calling POCS Interpolation
using Seismic Param ={"Niter"=>100,"fmax"=>60,"padt"=>2,"padx"=>2,"dt"=>0.004} dpocs = Seismic.pocs(ddec,param);
26
Interpolation input
27
Interpolation output
28
Calling Plane Wave Destruction
using Seismic download(" SegyToSeis("kevin_0off_velocity.su","kevins_model",{"format"=>"su"}); d,h = SeisRead("kevins_model"); coh,pp,res = SeisPWD(d,{"w1"=>30,"w2"=>20,"dx"=>8,"dz"=>4});
29
Estimated reflector normals
30
Julia in my own research
31
ShotProfileLSEWEM
32
Conjugate Gradients …
33
Forward and adjoint operators
34
ShotProfileEWEM …
35
Conclusions Julia can be used for fast prototyping as well as large scale production Julia programs are easy to follow for implementation in other languages We developed a package in Julia that is part of the ecosystem of Julia packages: Pkg.add(“Seismic”) Utilities Processing Imaging Inversion We will continue to make additions and improvements to Seismic.jl
36
References
37
Acknowledgements Thanks to the creators of Julia and to Sam Kaplan for showing us Julia We thank the sponsors of the Signal Analysis and Imaging Group for their support
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.