Installation
The assignments require Julia and Python 3 to be installed (Python 2 will not work).
For Windows, I recommend to use docker as Devito does not support Windows.
Julia
To install julia follow
https://julialang.org/downloads/
And install Julia 1.5
Python
The recommended installation is via conda to have a stable environment.
https://conda.io/miniconda.html
Packages
For the assignments, you will need a few python and julia packages. Please follow these instructions to install all of the packages in the order described here.
First, install Devito using pip
(or pip3
), or see the Devito's GitHub page for installation with Conda and further information. The current release of JUDI requires Python 3 and the current Devito version. Run all of the following commands from the (bash) terminal command line (not in the Julia REPL):
pip install --user git+https://github.com/devitocodes/devito.git
Then install matplotlib by
pip install matplotlib
If these commands don't work, please replace pip
by pip3
and try it again.
For reading and writing seismic SEG-Y data, JUDI uses the SegyIO package and matrix-free linear operators are based the Julia Operator LIbrary (JOLI), we can install these 2 packages via:
julia -e 'using Pkg; Pkg.add(url="https://github.com/slimgroup/SegyIO.jl.git")'
julia -e 'using Pkg; Pkg.add(url="https://github.com/slimgroup/JOLI.jl.git")'
Once Devito, SegyIO and JOLI are installed, you can install JUDI with Julia's Pkg.add
.
julia -e 'using Pkg; Pkg.add(url="https://github.com/slimgroup/JUDI.jl")'
Once you have JUDI installed, you need to point Julia's PyCall package to the Python version for which we previously installed Devito. To do this, copy-paste the following commands into the (bash) terminal:
export PYTHON=$(which python)
julia -e 'using Pkg; Pkg.build("PyCall")'
Again, try which python3
if which python
does not work.
You can verify your installation by running:
julia -e 'using Pkg; using JUDI; example=joinpath(dirname(pathof(JUDI)),"..","examples/scripts/modeling_basic_2D.jl");include(example);'
This command should finish without errors.
Docker (not necessary for homework but important for project)
Docker is a platform which builds a virtual machine/container for you in case some softwares above cannot be installed/processed in the environment on your local machine. Thus, we suggest you first try to install the softwares above and do the programming exercises on your local machine. The exercises should work well in apple/linux machines. If it renders problems on your machine (especially a windows one), you could install docker and follow the steps below to run julia sessions in a virtual environment.
First install docker for your system
https://www.docker.com/products/docker-desktop
Instead of having to install Python, Julia, Devito, JUDI and all the dependencies by yourself, you simply download the docker image and run it in a container. All you need to do is install docker and run:
docker run -p 8888:8888 philippwitte/judi:v1.1
This will download the image and launch a jupyter notebook that you can access from your internet browser. The command will display a link, which looks something like this:
Copy/paste this URL into your browser when you connect for the first time,
to login with a token:
http://0e27b13128d4:8888/?token=84a95cf4319e8e68534f20c7c6474d9875f13c70270f35f4&token=84a95cf4319e8e68534f20c7c6474d9875f13c70270f35f4
Copy-paste this link and replace the address 0e27b13128d4:8888
with localhost:8888
(the link is created inside the docker container, which doesn't know that you mapped this port to your localhost w/ port no. 8888). Instead of a notebook, you can also launch an interactive session with a terminal by running:
docker run -it philippwitte/judi:v1.1 /bin/bash
This will give you access to a terminal, in which you can start Julia/Python, run things interactively or modify code. However, figures from PyPlot sometimes do not render well from interactive julia sessions. Therefore, jupyter notebooks on docker are recommended.
Exercises
During the course you will work on the following exercises
- A first look at seismic data. Intro to julia Exercise 1 (Due: 11AM Feb 3, 2021)
- NMO correction and velocity analysis. Exercise 2 (Due: 11AM Feb 10, 2021)
- Wavefield extrapolation and migration. Exercise 3 (Due: 11AM Feb 17, 2021)
- Fourier, Radon and filtering. Exercise 4 (Due Date: 11AM Mar 15, 2021)
- From processing to inversion I. Exercise 5 (Due Date: April 5,2020)
- From processing to inversion II. Exercise 6 (Due Date: April 19,2020)
- Seismic imaging (mini-project). Exercise 7
Hand in
Please turn in your assignments as pdf files. The assignments should be send to Ziyi (Francis) Yin. Late hand ins are not accepted.
Unless stated otherwise the labs are due one week after the assignments have been posted. For example, if a homework is posted before the lecture on Wednesday, you should submit your homework before the lecture on the next Wednesday in order for your homework to be considered as on-time. If you have difficulty on the homework and want to ask for extension, please email Dr. Felix Herrmann and cc TA in advance.
Feedback
We will give you feedback on the marking of the exercises.