Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pyawd

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pyawd

A Pytorch dataset for Acoustic Wave Propagation

  • 0.3.75
  • PyPI
  • Socket score

Maintainers
1
Logo

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:

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:

Example

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)
Example

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:

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc