PyAWD: a Python acoustic wave propagation dataset using PyTorch and Devito
A package for generating Pytorch datasets containing simulations of the acoustic wave propagation in custom velocity fields.
Acoustic Wave Equation
The equation of propagation of an acoustic wave is given by $\frac{d^2u}{dt^2} = c \nabla^2 u + f$, where
- $u(x, y, t)$ is the displacement field and can be either a scalar or a vector field
- $c(x, y, t)$ is the wave propagation speed
- $\nabla^2$ is the laplacian operator
- $f(x, y, t)$ is an external force applied on the system, for which the value can vary through time PyAWD uses the Devito Python Library to solve the acoustic wave PDE from various random initial conditions.
Installation
The package (along with the dependencies) is accessible via PyPI:
pip install pyawd
Documentation
The API documentation is available here.
Basic help is provided for each class and function and is accessible via the Python help() function.
We provide a bunch of Notebooks to start using the tool. They are presented in the examples directory. Those are readable online:
ScalarAcousticWavePropagation.ipynb: an introduction to PDE solving and simulation using Devito applied on the scalar acoustic wave propagationVectorAcousticWavePropagation.ipynb: an introduction to PDE solving and simulation using Devito applied on the vector acoustic wave propagationVectorAcousticWaveDataset.ipynb: an introduction to the VectorAcousticWaveDataset possibilitiesMarmousi.ipynb: a visualisation of the Marmousi velocity field used in the simulationsInterrogators.ipynb: an introduction to the PyAWD Interrogators usageGenerateVectorAcousticWaveDataset.ipynb: how to generate dataset usingpyawdSpatioTemporalVaryingWavePropagationSpeedField.ipynb: how to create a spatio-temporal varying propagation field
Getting started
Basic imports:
from pyawd import *
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 = VectorAcousticWaveDataset2D(2, nx=128, dt=2, t=10, velocity_model="Marmousi")
dataset.max_velocities[0] = 500
Then we plot the first simulation. The 🟀 character shows the interrogator position:
dataset.plot_item(0)
Which outputs the following figure:
By default, the point (0, 0) contains an interrogator. This means that the continuous measurement on this position (at least with a $\Delta t=ddt$) can be plotted by:
dataset.plot_interrogators_response(0)
More advanced usage
Using the VectorAcousticWaveDataset3D class allows producing simulations in 3D:
dataset_3d = VectorAcousticWaveDataset3D(1, nx=32, t=10, interrogators=[(0, 10, 15), (0, -10, 15)], velocity_model=300.)
For visualisation, the method
dataset_3d.generate_video(0, "VAWD3D", 300)
generates the following video:
Metadata
Release files for pyawd 0.3.85
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyawd-0.3.85.tar.gz | 226.8 kB | Without provenance | Details for pyawd-0.3.85.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyawd-0.3.85-py3-none-any.whl | Python 3 | none | any | Details for pyawd-0.3.85-py3-none-any.whl |
Total release size: 493.0 kB
Release files / pyawd-0.3.85.tar.gz
| Download URL | pyawd-0.3.85.tar.gz |
|---|---|
| Size | 226.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0eed9b1e9eeae29e45ee2f82573416fafb6df6a3c9dc60ec917fbface63feebb
|
|
BLAKE2b-256 checksum How to use checksums |
34414eaa4e673e1f08fd4c9e30df6cf524a8a27c33f38615736fcbb7aaf59440
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.11.6
|
Release files / pyawd-0.3.85-py3-none-any.whl
| Download URL | pyawd-0.3.85-py3-none-any.whl |
|---|---|
| Size | 266.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f55cbc8d0e037467ec37b3eca02d709cdfcd99655fc0982419c6163bfc958f3c
|
|
BLAKE2b-256 checksum How to use checksums |
7a511a5a4e3c3131b13c4ee2d03de4e7d0582844c396047ad1ff840cd671ade3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.11.6
|
Security for pyawd 0.3.85
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.