A Pytorch dataset for Acoustic Wave Propagation
Project description
PyAWD: a Python acoustic wave propagation dataset using PyTorch and Devito
A package for generating a Pytorch dataset containing simulations of the acoustic wave propagation in the Marmousi velocity field. It uses the Devito Python Library to solve the acoustic wave PDE from various random initial conditions.
Marmousi velocity field
The Marmousi velocity field used in the simulation is a subset of the following:
Installation
The package (along with the dependencies) is accessible via PyPI:
pip install pyawd
Getting started
Basic imports:
import PyAWD
from PyAWD.AcousticWaveDataset import AcousticWaveDataset
Let us generate a Dataset made of 10 simulations. Each simulation is run in a $250\times 250$ matrix. We store the field state every $2$ seconds and we run the simulation for $10$ seconds:
dataset = AcousticWaveDataset(2, nx=250, dt=2, t=10)
Then we plot the first simulation:
dataset.plot_item(0)
Which outputs the following figure:
Finally, we can generate a video of this simulation. We will use $240$ frames, so that we have a final rate of $24 fps$:
dataset.generate_video(0, "example", 240)
This produces the following video (stored in the file example.mp4
):
Documentation
Basic help is provided for each class and function, and is accessible via the Python help()
function.
Examples
Mutliple IPython notebooks are presented in the examples directory. If Jupyter is installed, those examples can be explored by starting Jupyter:
jupyter-notebook
HeatPropagation.ipynb
: an introduction to PDE solving and simulation using Devito applied on the heat propagationAcousticWaveGeneration.ipynb
: an introduction to PDE solving and simulation using Devito applied on the acoustic wave propagationMarmousi.ipynb
: a visualisation of the Marmousi velocity field used in the simulationsGenerateAcousticWaveDataset.ipynb
: an example of dataset generation workflow
To do
- Enhance the velocity model by taking into account $P$ and $S$ waves (see this article)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.