| Name | PyAWD JSON |
| Version |
0.2.31
JSON |
| download |
| home_page | |
| Summary | A Pytorch dataset for Acoustic Wave Propagation |
| upload_time | 2024-03-05 10:09:44 |
| maintainer | |
| docs_url | None |
| author | |
| requires_python | >=3.8 |
| license | |
| keywords |
|
| VCS |
 |
| bugtrack_url |
|
| requirements |
No requirements were recorded.
|
| Travis-CI |
No Travis.
|
| coveralls test coverage |
No coveralls.
|
# 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](https://www.devitoproject.org) 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:
<img src="https://slideplayer.com/slide/15021598/91/images/37/Marmousi+Velocity+Model.jpg" alt="Marmousi velocity field" width="40%"/>
## Installation
The package (along with the dependencies) is accessible via [PyPI](https://pypi.org/project/PyAWD/):
```bash
pip install pyawd
```
## Getting started
Basic imports:
```python
import PyAWD
from PyAWD.ScalarAcousticWaveDataset import ScalarAcousticWaveDataset
```
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:
```python
dataset = ScalarAcousticWaveDataset(2, nx=250, dt=2, t=10)
```
Then we plot the first simulation. The 🟀 character shows the interrogator position:
```python
dataset.plot_item(0)
```
Which outputs the following figure:

Finally, we can generate a video of this simulation. We will use $200$ frames, which yields a final rate of $20 fps$:
```python
dataset.generate_video(0, "example", 200)
```
This produces the following video (stored in the file `example.mp4`):

By default, the point `(0, 0)` contains an interrogator. This means that the continuous measurement on this position (at least with a $\Delta t=dt$) can be obtained by:
```python
dataset.interrogate((0, 0))
```
## More advanced usage
Using the `VectorialAcousticWaveDataset` class, you can produce simulations in 2D which are more realistic:
```python
dataset = VectorialAcousticWaveDataset(2, nx=250, dt=2, interrogators=[(-10, 0), (10, 0)], t=10)
```
Especially, the `interrogate` method provides measurements along two orthogonal dimensions:
```python
dataset.plot_item(0)
dataset.plot_interrogators_response(0)
```
## 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](examples/) directory. If [Jupyter](https://jupyter.org) is installed, those examples can be explored by starting Jupyter:
```bash
jupyter-notebook
```
- `ScalarAcousticWaveGeneration.ipynb`: an introduction to PDE solving and simulation using Devito applied on the scalar acoustic wave propagation
- `VectorialAcousticWaveGeneration.ipynb`: an introduction to PDE solving and simulation using Devito applied on the vectorial acoustic wave propagation
- `Marmousi.ipynb`: a visualisation of the Marmousi velocity field used in the simulations
- `GenerateAcousticWaveDataset.ipynb`: an example of dataset generation workflow
- `Interrogators.ipynb`: an introduction to the PyAWD Interrogators usage
## Related Works:
- https://essd.copernicus.org/preprints/essd-2023-470/
Raw data
{
"_id": null,
"home_page": "",
"name": "PyAWD",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "",
"keywords": "",
"author": "",
"author_email": "Tribel Pascal <pascal.tribel@ulb.be>",
"download_url": "https://files.pythonhosted.org/packages/01/af/3a3478b40299d45ced6f2ee6d1f4dc054e6787bbc08c8045ce95cef2c41f/PyAWD-0.2.31.tar.gz",
"platform": null,
"description": "# PyAWD: a Python acoustic wave propagation dataset using PyTorch and Devito\nA package for generating a Pytorch dataset containing simulations of the acoustic wave propagation in the Marmousi velocity field. It uses the [Devito Python Library](https://www.devitoproject.org) to solve the acoustic wave PDE from various random initial conditions.\n\n## Marmousi velocity field\nThe Marmousi velocity field used in the simulation is a subset of the following:\n\n<img src=\"https://slideplayer.com/slide/15021598/91/images/37/Marmousi+Velocity+Model.jpg\" alt=\"Marmousi velocity field\" width=\"40%\"/>\n\n## Installation\nThe package (along with the dependencies) is accessible via [PyPI](https://pypi.org/project/PyAWD/):\n\n```bash\npip install pyawd\n```\n\n## Getting started\n\nBasic imports:\n```python\nimport PyAWD\nfrom PyAWD.ScalarAcousticWaveDataset import ScalarAcousticWaveDataset\n```\n\nLet 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:\n\n```python\ndataset = ScalarAcousticWaveDataset(2, nx=250, dt=2, t=10)\n```\n\nThen we plot the first simulation. The 🟀 character shows the interrogator position:\n\n```python\ndataset.plot_item(0)\n```\n\nWhich outputs the following figure:\n\n\nFinally, we can generate a video of this simulation. We will use $200$ frames, which yields a final rate of $20 fps$:\n\n```python\ndataset.generate_video(0, \"example\", 200)\n```\n\nThis produces the following video (stored in the file `example.mp4`):\n\n\n\n\nBy default, the point `(0, 0)` contains an interrogator. This means that the continuous measurement on this position (at least with a $\\Delta t=dt$) can be obtained by:\n\n```python\ndataset.interrogate((0, 0))\n```\n\n## More advanced usage\nUsing the `VectorialAcousticWaveDataset` class, you can produce simulations in 2D which are more realistic:\n\n```python\ndataset = VectorialAcousticWaveDataset(2, nx=250, dt=2, interrogators=[(-10, 0), (10, 0)], t=10)\n```\n\nEspecially, the `interrogate` method provides measurements along two orthogonal dimensions:\n\n```python\ndataset.plot_item(0)\ndataset.plot_interrogators_response(0)\n```\n\n\n## Documentation\nBasic help is provided for each class and function, and is accessible via the Python `help()` function.\n\n## Examples\nMutliple IPython notebooks are presented in the [examples](examples/) directory. If [Jupyter](https://jupyter.org) is installed, those examples can be explored by starting Jupyter:\n\n```bash\njupyter-notebook\n```\n\n- `ScalarAcousticWaveGeneration.ipynb`: an introduction to PDE solving and simulation using Devito applied on the scalar acoustic wave propagation\n- `VectorialAcousticWaveGeneration.ipynb`: an introduction to PDE solving and simulation using Devito applied on the vectorial acoustic wave propagation\n- `Marmousi.ipynb`: a visualisation of the Marmousi velocity field used in the simulations\n- `GenerateAcousticWaveDataset.ipynb`: an example of dataset generation workflow\n- `Interrogators.ipynb`: an introduction to the PyAWD Interrogators usage\n\n## Related Works:\n- https://essd.copernicus.org/preprints/essd-2023-470/\n",
"bugtrack_url": null,
"license": "",
"summary": "A Pytorch dataset for Acoustic Wave Propagation",
"version": "0.2.31",
"project_urls": {
"Homepage": "https://github.com/pascaltribel/PyAWD",
"Issues": "https://github.com/pascaltribel/PyAWD/issues"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "11dbdbae4e77af16e0f7c5343e0cc70c743de41ecbb53add7c1f057578518487",
"md5": "e345084de61c54b071feda6630778b9c",
"sha256": "ed930b9081cea20e45cbddebe66a485625bd1de2f94ebf66e7bcee6ec5594522"
},
"downloads": -1,
"filename": "PyAWD-0.2.31-py3-none-any.whl",
"has_sig": false,
"md5_digest": "e345084de61c54b071feda6630778b9c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 256296,
"upload_time": "2024-03-05T10:09:39",
"upload_time_iso_8601": "2024-03-05T10:09:39.407481Z",
"url": "https://files.pythonhosted.org/packages/11/db/dbae4e77af16e0f7c5343e0cc70c743de41ecbb53add7c1f057578518487/PyAWD-0.2.31-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "01af3a3478b40299d45ced6f2ee6d1f4dc054e6787bbc08c8045ce95cef2c41f",
"md5": "03bcad771b2213acefddc11b355c9417",
"sha256": "cdc1287a98e1e5c73668653418fd40096983ff7d2a1c3c62454000334a7adcd2"
},
"downloads": -1,
"filename": "PyAWD-0.2.31.tar.gz",
"has_sig": false,
"md5_digest": "03bcad771b2213acefddc11b355c9417",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 221694,
"upload_time": "2024-03-05T10:09:44",
"upload_time_iso_8601": "2024-03-05T10:09:44.992620Z",
"url": "https://files.pythonhosted.org/packages/01/af/3a3478b40299d45ced6f2ee6d1f4dc054e6787bbc08c8045ce95cef2c41f/PyAWD-0.2.31.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-03-05 10:09:44",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "pascaltribel",
"github_project": "PyAWD",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "pyawd"
}