# PySurf96
[](https://github.com/astral-sh/ruff)
[](https://python.org/)
_Modelling Surface Wave Dispersion Curves_
This is a slim wrapper around the program `surf96` from _Computer programs in seismology_ by R. Hermann (<http://www.eas.slu.edu/eqc/eqccps.html>) for forward modelling of Rayleigh and Love wave dispersion curves.
In this implementation the Fortran77 code is wrapped by `f2py`, which makes the forward computation approximately **8x faster** compared over calling a Python subprocess.
More useful software for seismology at <https://pyrocko.org>.
## Installation
This package is for Python 3.
Prerequisits is a Fortran77 compiler, like GNU GCC.
```
pip install .
```
Or through pip:
```
pip install git+https://github.com/miili/pysurf96
```
## Documentation
Essentially this is a single function, `surf96`. Here is the docstring:
```
Calculate synthetic surface wave dispersion curves for a given earth model, wave type and periods.
This is a slim Fortran wrapper around surf96 from Computer Programs in Seismology from R. Hermann (2013)
Args:
thickness (np.ndarray): Layer thickness in kilometers.
vp (np.ndarray): Layer Vp velocity.
vs (np.ndarray): Layer Vs velocity.
rho (np.ndarray): Layer density in g/m^3.
periods (np.ndarray): The periods in seconds, where wave velocity is calculated
wave (WaveType, optional): The wave type, "love" or "rayleigh". Defaults to "love".
mode (int, optional): Mode of the wave, 1: fundamental, 2: second-mode, etc... Defaults to 1.
velocity (Velocity, optional): "group" or "phase" velocity. Defaults to "group".
flat_earth (bool, optional): Assume a flat earth. Defaults to True.
Raises:
ValueError: Raised when input values are unexpected.
Surf96Error: If surf96 fortran code raises an error,
this may be due to low velocity zone.
Returns:
np.ndarray: The surface wave velocities at defined periods.
```
## Example
```python
import numpy as np
from pysurf96 import surf96
# Define the velocity model in km and km/s
thickness = np.array([5.0, 23.0, 8.0, 0])
vs = np.array([2, 3.6, 3.8, 3.3])
vp = vs * 1.73
rho = vp * 0.32 + 0.77
# Periods we are interested in
periods = np.linspace(1.0, 20.0, 20)
velocities = surf96(
thickness,
vp,
vs,
rho,
periods,
wave="love",
mode=1,
velocity="group",
flat_earth=True,
```
## Citations and Acknowledgments
> Herrmann, R. B. (2013) Computer programs in seismology: An evolving tool for instruction and research, Seism. Res. Lettr. 84, 1081-1088, doi:10.1785/0220110096
Thanks to Hongjian Fang for creating the Fortran subroutine (<https://github.com/caiweicaiwei/SurfTomo>)
Raw data
{
"_id": null,
"home_page": null,
"name": "pysurf96",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": "Marius Paul Isken <mi@gfz-potsdam.de>",
"keywords": "surface wave dispersion, surf96, dispersion curve, dispersion analysis",
"author": null,
"author_email": "Marius Paul Isken <mi@gfz-potsdam.de>",
"download_url": "https://files.pythonhosted.org/packages/21/7a/6988031c439d619042f4f9f263fb54be40887bef8d2cd17e9c2d7f6a0eda/pysurf96-1.0.1.tar.gz",
"platform": null,
"description": "# PySurf96\n\n[](https://github.com/astral-sh/ruff)\n[](https://python.org/)\n\n_Modelling Surface Wave Dispersion Curves_\n\nThis is a slim wrapper around the program `surf96` from _Computer programs in seismology_ by R. Hermann (<http://www.eas.slu.edu/eqc/eqccps.html>) for forward modelling of Rayleigh and Love wave dispersion curves.\n\nIn this implementation the Fortran77 code is wrapped by `f2py`, which makes the forward computation approximately **8x faster** compared over calling a Python subprocess.\n\nMore useful software for seismology at <https://pyrocko.org>.\n\n## Installation\n\nThis package is for Python 3.\n\nPrerequisits is a Fortran77 compiler, like GNU GCC.\n\n```\npip install .\n```\n\nOr through pip:\n\n```\npip install git+https://github.com/miili/pysurf96\n```\n\n## Documentation\n\nEssentially this is a single function, `surf96`. Here is the docstring:\n\n```\nCalculate synthetic surface wave dispersion curves for a given earth model, wave type and periods.\n\nThis is a slim Fortran wrapper around surf96 from Computer Programs in Seismology from R. Hermann (2013)\n\nArgs:\n thickness (np.ndarray): Layer thickness in kilometers.\n vp (np.ndarray): Layer Vp velocity.\n vs (np.ndarray): Layer Vs velocity.\n rho (np.ndarray): Layer density in g/m^3.\n periods (np.ndarray): The periods in seconds, where wave velocity is calculated\n wave (WaveType, optional): The wave type, \"love\" or \"rayleigh\". Defaults to \"love\".\n mode (int, optional): Mode of the wave, 1: fundamental, 2: second-mode, etc... Defaults to 1.\n velocity (Velocity, optional): \"group\" or \"phase\" velocity. Defaults to \"group\".\n flat_earth (bool, optional): Assume a flat earth. Defaults to True.\nRaises:\n ValueError: Raised when input values are unexpected.\n Surf96Error: If surf96 fortran code raises an error,\n this may be due to low velocity zone.\nReturns:\n np.ndarray: The surface wave velocities at defined periods.\n```\n\n## Example\n\n```python\nimport numpy as np\nfrom pysurf96 import surf96\n\n# Define the velocity model in km and km/s\nthickness = np.array([5.0, 23.0, 8.0, 0])\nvs = np.array([2, 3.6, 3.8, 3.3])\nvp = vs * 1.73\nrho = vp * 0.32 + 0.77\n\n# Periods we are interested in\nperiods = np.linspace(1.0, 20.0, 20)\n\nvelocities = surf96(\n thickness,\n vp,\n vs,\n rho,\n periods,\n wave=\"love\",\n mode=1,\n velocity=\"group\",\n flat_earth=True,\n\n```\n\n## Citations and Acknowledgments\n\n> Herrmann, R. B. (2013) Computer programs in seismology: An evolving tool for instruction and research, Seism. Res. Lettr. 84, 1081-1088, doi:10.1785/0220110096\n\nThanks to Hongjian Fang for creating the Fortran subroutine (<https://github.com/caiweicaiwei/SurfTomo>)\n",
"bugtrack_url": null,
"license": null,
"summary": "Surface Wave Dispersion Python Wrapper for surf96.",
"version": "1.0.1",
"project_urls": {
"Github": "https://github.com/miili/pysurf96",
"Home": "https://pyrocko.org",
"Issues": "https://github.com/miili/pysurf96/issues"
},
"split_keywords": [
"surface wave dispersion",
" surf96",
" dispersion curve",
" dispersion analysis"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "cef17b81ba167b9d8f02c5a63f6df70314a3d781ccba613802ea441788ddbcf5",
"md5": "3f0adf9b8223dd686a1f649511a8a44b",
"sha256": "51cb215de45e849c73e28c061a5b3a951c987a3135643f738176943c0973eef8"
},
"downloads": -1,
"filename": "pysurf96-1.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "3f0adf9b8223dd686a1f649511a8a44b",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.10",
"size": 1033733,
"upload_time": "2024-12-05T13:32:05",
"upload_time_iso_8601": "2024-12-05T13:32:05.235510Z",
"url": "https://files.pythonhosted.org/packages/ce/f1/7b81ba167b9d8f02c5a63f6df70314a3d781ccba613802ea441788ddbcf5/pysurf96-1.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "7f2585cca8eba7c5e929f4772cc85f1481e41db894b749aa168c8ed6e4ef906f",
"md5": "66be8ba596f89da66483766ec48b4e90",
"sha256": "8b391b0e882fbda81a92e3703020a8b39d8b3754c2254dd8be76978242f3d122"
},
"downloads": -1,
"filename": "pysurf96-1.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "66be8ba596f89da66483766ec48b4e90",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.10",
"size": 1033743,
"upload_time": "2024-12-05T13:32:07",
"upload_time_iso_8601": "2024-12-05T13:32:07.877206Z",
"url": "https://files.pythonhosted.org/packages/7f/25/85cca8eba7c5e929f4772cc85f1481e41db894b749aa168c8ed6e4ef906f/pysurf96-1.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "fd9d767b3f1d75edc77020b70a78a7e9fed91492f1925d04e43d270294b91bd9",
"md5": "d45c57b090520005b8d387dc5eb9677e",
"sha256": "48977e1a1ebb9d828a18f7f17bad0cdb553b186727cb4f5cabc9a3db562dfa7b"
},
"downloads": -1,
"filename": "pysurf96-1.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "d45c57b090520005b8d387dc5eb9677e",
"packagetype": "bdist_wheel",
"python_version": "cp312",
"requires_python": ">=3.10",
"size": 1033874,
"upload_time": "2024-12-05T13:32:10",
"upload_time_iso_8601": "2024-12-05T13:32:10.346348Z",
"url": "https://files.pythonhosted.org/packages/fd/9d/767b3f1d75edc77020b70a78a7e9fed91492f1925d04e43d270294b91bd9/pysurf96-1.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "06de0b7f766d335b4a89744ebc3f1b60e92f77bff5f0e787b9620007b24c17ea",
"md5": "574059814b77b1d2dcbf8f57e7d67bd9",
"sha256": "8d3d3bc4bf6c5b311eec07cf27703aa2948ca895200ca4fe1be3b21bae821175"
},
"downloads": -1,
"filename": "pysurf96-1.0.1-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "574059814b77b1d2dcbf8f57e7d67bd9",
"packagetype": "bdist_wheel",
"python_version": "pp310",
"requires_python": ">=3.10",
"size": 1033853,
"upload_time": "2024-12-05T13:32:12",
"upload_time_iso_8601": "2024-12-05T13:32:12.745876Z",
"url": "https://files.pythonhosted.org/packages/06/de/0b7f766d335b4a89744ebc3f1b60e92f77bff5f0e787b9620007b24c17ea/pysurf96-1.0.1-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "217a6988031c439d619042f4f9f263fb54be40887bef8d2cd17e9c2d7f6a0eda",
"md5": "6a2056b2694f17e2402555272406035c",
"sha256": "a5c85cd3e76b7a130b131f9d84aebfbadb2f6d6745cf9e64e80fcad1911367b1"
},
"downloads": -1,
"filename": "pysurf96-1.0.1.tar.gz",
"has_sig": false,
"md5_digest": "6a2056b2694f17e2402555272406035c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 17581,
"upload_time": "2024-12-05T13:32:14",
"upload_time_iso_8601": "2024-12-05T13:32:14.644314Z",
"url": "https://files.pythonhosted.org/packages/21/7a/6988031c439d619042f4f9f263fb54be40887bef8d2cd17e9c2d7f6a0eda/pysurf96-1.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-05 13:32:14",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "miili",
"github_project": "pysurf96",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "pysurf96"
}