Seismic Waveform Inversion Toolbox-1.0

Overview

Seismic Waveform Inversion Toolbox (SWIT-1.0)

By Haipeng Li @ USTC

Contact: [email protected]

First look at SWIT

Contents of SWIT

Workflow of SWIT

SWIT Installation

Step 1: Install gfortran

# Install gcc and gfortran
sudo apt-get install build-essential
sudo apt install gfortran

Step 2 : Install OpenMPI

# Download the latest OpenMPI package, or go to  http://www.open-mpi.org/software/ompi to download the desired version
wget https://download.open-mpi.org/release/open-mpi/v4.1/openmpi-4.1.1.tar.gz 
tar xvfz openmpi-4.1.1.tar.gz
cd openmpi-4.1.1

# Configure the installation files and install OpenMPI (this would take quite a while)
./configure --prefix=/usr/local/openmpi CC=gcc FC=gfortran
make    # make -j8  # use 8 cores to speed up the make process
sudo make install

# Add env path at your ~/.bashrc
vim ~/.bashrc
export PATH=/usr/local/openmpi/bin:$PATH
source ~/.bashrc

# Check OpenMPI is successfully installed
which mpirun

Step 3 : Install Anaconda Environment (Otherwise, just install Python dependencies as you like)

# Anaconda is recommended. For installing Anaconda, please refer to https://docs.anaconda.com/anaconda/install/linux/
# 1. download package from: https://www.anaconda.com/products/individual/download-success
# 2. bash your_downloaded_Anaconda_package

# Create the conda environment for SWIT if you use Anaconda
conda create --name SWIT python=3.7.5
conda activate SWIT

# Install dependencies using USTC mirrors (whether use Anaconda or not)
pip install numpy obspy scipy matplotlib multiprocess PySimpleGUI psutil Pillow -i https://pypi.mirrors.ustc.edu.cn/simple/

Step 4 : Install & Run SWIT

# Complie the fd2dmpi forward solver with the default fortran compiler (mpif90).
# If you want to use other fortran compiler, you can edit the Makefile.config file (line 18) under ~/SWIT-1.0/fd2dmpi/.
cd /your/own/path/to/SWIT-1.0/fd2dmpi/
rm *.mod
make clean
make

# Add fd2dmpi and Python toolbox to the env path at your ~/.bashrc 
vim ~/.bashrc 
export PATH=/your/own/path/to/SWIT-1.0/bin:$PATH
export PYTHONPATH=/your/own/path/to/SWIT-1.0/toolbox
source ~/.bashrc

# Option 1. Run SWIT via GUI
cd /your/own/path/to/SWIT-1.0/toolbox/
python runswit_Linux.py    # or python runswit_MacOS.py 

# Option 2. Run SWIT via the Python script
cd /your/own/path/to/SWIT-1.0/example/some_case/
./run_workflow     # You need to modify all the paths in the Python script before running

# Notice:
# If you use the Intel Compiler, you need to make the following change in forward and adjoint functions in toolbox/solver.py: 
# Before:     
#	   solver_cmd = 'mpirun -np %d  fd2dmpi par=%s' % (mpiproc, parfile)
# After:
#    solver_cmd = 'mpiexec -np %d  fd2dmpi par=%s' % (mpiproc, parfile)

Systems

SWIT-1.0 has been tested on Ubuntu 16.04, 18.04, 20.04, Centos 7.
It seems that SWIT-1.0 cannot run on MacOS properly due to the problem with the Python multiprocess module. 
This issue will be fixed in the near future.

FWI examples (keep updating)

No. Acquisition Model Misfit Features Optimization Size
1 Land Marmousi Waveform - NLCG 481x121, 25 m
2 Land Overthrust Waveform - NLCG 401x101, 25 m
3 Marine Marmousi Waveform - NLCG 481x141, 25 m
4 Marine Overthrust Waveform - NLCG 401x121, 25 m
5 Land Marmousi Traveltime & Waveform 1D initial model NLCG 401x121, 25 m
6 Land Overthrust Waveform Multi-scale Inversion NLCG 401x101, 25 m

Citations :

If you find SWIT is useful, please cite the following work:

1. Li, H., Li, J., Liu, B., Huang, X. (2021). Application of full-waveform tomography on deep seismic profiling dataset for tectonic fault characterization. International Meeting for Applied Geoscience & Energy.

2. Schuster, G. T. (2017). Seismic inversion. Society of Exploration Geophysicists. https://library.seg.org/doi/book/10.1190/1.9781560803423

Few more words:

  1. Simplicity is the Greatest Virtue Ever.

  2. The Seismic WIT always lies within.

You might also like...
Calculates JMA (Japan Meteorological Agency) seismic intensity (shindo) scale from acceleration data recorded in NumPy array
Calculates JMA (Japan Meteorological Agency) seismic intensity (shindo) scale from acceleration data recorded in NumPy array

shindo.py Calculates JMA (Japan Meteorological Agency) seismic intensity (shindo) scale from acceleration data stored in NumPy array Introduction Japa

A Python Tools to imaging the shallow seismic structure

ShallowSeismicImaging Tools to imaging the shallow seismic structure, above 10 km, based on the ZH ratio measured from the ambient seismic noise, and

OpenQuake's Engine for Seismic Hazard and Risk Analysis
OpenQuake's Engine for Seismic Hazard and Risk Analysis

OpenQuake Engine The OpenQuake Engine is an open source application that allows users to compute seismic hazard and seismic risk of earthquakes on a g

UnivNet: A Neural Vocoder with Multi-Resolution Spectrogram Discriminators for High-Fidelity Waveform Generation

UnivNet UnivNet: A Neural Vocoder with Multi-Resolution Spectrogram Discriminators for High-Fidelity Waveform Generation. Training python train.py --c

efficient neural audio synthesis in the waveform domain
efficient neural audio synthesis in the waveform domain

neural waveshaping synthesis real-time neural audio synthesis in the waveform domain paper • website • colab • audio by Ben Hayes, Charalampos Saitis,

Unofficial PyTorch Implementation of UnivNet: A Neural Vocoder with Multi-Resolution Spectrogram Discriminators for High-Fidelity Waveform Generation
Unofficial PyTorch Implementation of UnivNet: A Neural Vocoder with Multi-Resolution Spectrogram Discriminators for High-Fidelity Waveform Generation

UnivNet UnivNet: A Neural Vocoder with Multi-Resolution Spectrogram Discriminators for High-Fidelity Waveform Generation This is an unofficial PyTorch

The official implementation of the Interspeech 2021 paper WSRGlow: A Glow-based Waveform Generative Model for Audio Super-Resolution.

WSRGlow The official implementation of the Interspeech 2021 paper WSRGlow: A Glow-based Waveform Generative Model for Audio Super-Resolution. Audio sa

Unofficial PyTorch Implementation of UnivNet: A Neural Vocoder with Multi-Resolution Spectrogram Discriminators for High-Fidelity Waveform Generation
Unofficial PyTorch Implementation of UnivNet: A Neural Vocoder with Multi-Resolution Spectrogram Discriminators for High-Fidelity Waveform Generation

UnivNet UnivNet: A Neural Vocoder with Multi-Resolution Spectrogram Discriminators for High-Fidelity Waveform Generation This is an unofficial PyTorch

Official implementation of the paper Chunked Autoregressive GAN for Conditional Waveform Synthesis

Chunked Autoregressive GAN (CARGAN) Official implementation of the paper Chunked Autoregressive GAN for Conditional Waveform Synthesis [paper] [compan

A python package to manage the stored receiver-side Strain Green's Tensor (SGT) database of 3D background models and able to generate Green's function and synthetic waveform

A python package to manage the stored receiver-side Strain Green's Tensor (SGT) database of 3D background models and able to generate Green's function and synthetic waveform

WAL enables programmable waveform analysis.

This repro introcudes the Waveform Analysis Language (WAL). The initial paper on WAL will appear at ASPDAC'22 and can be downloaded here: https://www.

A collection of resources on GAN Inversion.

This repo is a collection of resources on GAN inversion, as a supplement for our survey

[CVPR 2021] Unsupervised 3D Shape Completion through GAN Inversion
[CVPR 2021] Unsupervised 3D Shape Completion through GAN Inversion

ShapeInversion Paper Junzhe Zhang, Xinyi Chen, Zhongang Cai, Liang Pan, Haiyu Zhao, Shuai Yi, Chai Kiat Yeo, Bo Dai, Chen Change Loy "Unsupervised 3D

[IJCAI-2021] A benchmark of data-free knowledge distillation from paper
[IJCAI-2021] A benchmark of data-free knowledge distillation from paper "Contrastive Model Inversion for Data-Free Knowledge Distillation"

DataFree A benchmark of data-free knowledge distillation from paper "Contrastive Model Inversion for Data-Free Knowledge Distillation" Authors: Gongfa

A Simplied Framework of GAN Inversion

Framework of GAN Inversion Introcuction You can implement your own inversion idea using our repo. We offer a full range of tuning settings (in hparams

Style-based Neural Drum Synthesis with GAN inversion
Style-based Neural Drum Synthesis with GAN inversion

Style-based Drum Synthesis with GAN Inversion Demo TensorFlow implementation of a style-based version of the adversarial drum synth (ADS) from the pap

Implementation for HFGI: High-Fidelity GAN Inversion for Image Attribute Editing
Implementation for HFGI: High-Fidelity GAN Inversion for Image Attribute Editing

HFGI: High-Fidelity GAN Inversion for Image Attribute Editing High-Fidelity GAN Inversion for Image Attribute Editing Update: We released the inferenc

 Chunkmogrify: Real image inversion via Segments
Chunkmogrify: Real image inversion via Segments

Chunkmogrify: Real image inversion via Segments Teaser video with live editing sessions can be found here This code demonstrates the ideas discussed i

Official implementation for
Official implementation for "Style Transformer for Image Inversion and Editing" (CVPR 2022)

Style Transformer for Image Inversion and Editing (CVPR2022) https://arxiv.org/abs/2203.07932 Existing GAN inversion methods fail to provide latent co

Comments
  • Problem make installing the package

    Problem make installing the package

    Hi Haipeng,

    I am installing this package on my macbook pro M1. I have openmpi installed:

     mpif90 --version
    GNU Fortran (Homebrew GCC 11.2.0_3) 11.2.0
    Copyright (C) 2021 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    

    However, when I run make in the fd2dmpi folder I got the following error indicating grammar error. Could this be a problem with my mpi library?

    ❯ make
    /opt/homebrew/bin/mpif90 -o .obj/global.o global.f90 -O3 -w  -c -funroll-loops -J.mod
    /opt/homebrew/bin/mpif90 -o .obj/parser.o parser.f90 -O3 -w  -c -funroll-loops -J.mod
    /opt/homebrew/bin/mpif90 -o .obj/datatype.o datatype.f90 -O3 -w  -c -funroll-loops -J.mod
    /opt/homebrew/bin/mpif90 -o .obj/mmi_mpi.o mmi_mpi.f90 -O3 -w  -c -funroll-loops -J.mod
    /opt/homebrew/bin/mpif90 -o .obj/string.o string.f90 -O3 -w  -c -funroll-loops -J.mod
    /opt/homebrew/bin/mpif90 -o .obj/su.o su.f90 -O3 -w  -c -funroll-loops -J.mod
    /opt/homebrew/bin/mpif90 -o .obj/io.o io.f90 -O3 -w  -c -funroll-loops -J.mod
    io.f90:296:17:
    
      296 |   call MPI_BCAST(den(:,ix),nz_pml,MPI_INTEGER,0,MPI_COMM_WORLD,ierr)
          |                 1
    ......
      798 | call MPI_BCAST(fs,nx_pml,MPI_INTEGER,0,MPI_COMM_WORLD,ierr)
          |               2
    Error: Type mismatch between actual argument at (1) and actual argument at (2) (REAL(4)/INTEGER(4)).
    io.f90:261:17:
    

    Best, Xin

    opened by RunningXinLiu 11
  • Questions about free surface

    Questions about free surface

    Thank you for your work.

    PML =50, whether free surface is set to Yes or No and the result seems to be the same. I don't know why.

    In addition, on line 154 of base.py, "self.nz_pml = self.nz + self.pml * (2 - self.fs)". Can you explain what it means and where self.nz_pml is used

    I would appreciate it if you could take some time to answer my questions.

    opened by ZYX68926 1
  • The data filtering becomes very slow due to large OMP_NUM_THREADS for Scipy

    The data filtering becomes very slow due to large OMP_NUM_THREADS for Scipy

    I add a default specification for OMP_NUM_THREADS in base.py (Line 70):

    os.environ["OMP_NUM_THREADS"] = "1" # export OMP_NUM_THREADS=1

    The data filtering speed is faster now.

    opened by Haipeng-ustc 0
Releases(v1.0.0)
Owner
Haipeng Li
I'm a geophysics graduate student.
Haipeng Li
python partial dependence plot toolbox

PDPbox python partial dependence plot toolbox Motivation This repository is inspired by ICEbox. The goal is to visualize the impact of certain feature

Li Jiangchun 723 Jan 7, 2023
A Python toolbox for gaining geometric insights into high-dimensional data

"To deal with hyper-planes in a 14 dimensional space, visualize a 3D space and say 'fourteen' very loudly. Everyone does it." - Geoff Hinton Overview

Contextual Dynamics Laboratory 1.6k Feb 17, 2021
python partial dependence plot toolbox

PDPbox python partial dependence plot toolbox Motivation This repository is inspired by ICEbox. The goal is to visualize the impact of certain feature

Li Jiangchun 531 Feb 16, 2021
This is a super simple visualization toolbox (script) for transformer attention visualization ✌

Trans_attention_vis This is a super simple visualization toolbox (script) for transformer attention visualization ✌ 1. How to prepare your attention m

Mingyu Wang 3 Jul 9, 2022
Plot toolbox based on Matplotlib, simple and elegant.

Elegant-Plot Plot toolbox based on Matplotlib, simple and elegant. 绘制效果 绘制过程 数据准备 每种图标类型的目录下有data.csv文件,依据样例数据填入自己的数据。

null 3 Jul 15, 2022
A Python package to request and process seismic waveform data from Hi-net.

HinetPy is a Python package to simplify tedious data request, download and format conversion tasks related to NIED Hi-net. NIED Hi-net | Source Code |

Dongdong Tian 65 Dec 9, 2022
null 8 Nov 4, 2022
LOC-FLOW is an “hands-free” earthquake location workflow to process continuous seismic records

LOC-FLOW is an “hands-free” earthquake location workflow to process continuous seismic records: from raw waveforms to well located earthquakes with magnitude calculations. The package assembles several popular routines for sequential earthquake location refinements, suitable for catalog building ranging from local to regional scales.

Miao Zhang 71 Jan 9, 2023
Repositori untuk menyimpan material Long Course STMKGxHMGI tentang Geophysical Python for Seismic Data Analysis

Long Course "Geophysical Python for Seismic Data Analysis" Instruktur: Dr.rer.nat. Wiwit Suryanto, M.Si Dipersiapkan oleh: Anang Sahroni Waktu: Sesi 1

Anang Sahroni 0 Dec 4, 2021
QuakeLabeler is a Python package to create and manage your seismic training data, processes, and visualization in a single place — so you can focus on building the next big thing.

QuakeLabeler Quake Labeler was born from the need for seismologists and developers who are not AI specialists to easily, quickly, and independently bu

Hao Mai 15 Nov 4, 2022