PySurf96
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
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)
Metadata
Release files for pysurf96 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pysurf96-1.0.1.tar.gz | 17.6 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| pysurf96-1.0.1-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | PyPy 3.10 | PyPy 3.10 7.3 | Linux glibc 2.17+ x86-64 | Details |
| pysurf96-1.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.12 | CPython 3.12 | Linux glibc 2.17+ x86-64 | Details |
| pysurf96-1.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.11 | CPython 3.11 | Linux glibc 2.17+ x86-64 | Details |
| pysurf96-1.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.10 | CPython 3.10 | Linux glibc 2.17+ x86-64 | Details |
Total release size: 4.2 MB
Release files / pysurf96-1.0.1.tar.gz
| Download URL | pysurf96-1.0.1.tar.gz |
|---|---|
| Size | 17.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a5c85cd3e76b7a130b131f9d84aebfbadb2f6d6745cf9e64e80fcad1911367b1
|
|
BLAKE2b-256 checksum How to use checksums |
217a6988031c439d619042f4f9f263fb54be40887bef8d2cd17e9c2d7f6a0eda
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 5, 2024.
Transparency logRelease files / pysurf96-1.0.1-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | pysurf96-1.0.1-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 1.0 MB |
| Tags | Linux glibc 2.17+ x86-64 PyPy 3.10 PyPy 3.10 7.3 |
|
SHA-256 checksum How to use checksums |
8d3d3bc4bf6c5b311eec07cf27703aa2948ca895200ca4fe1be3b21bae821175
|
|
BLAKE2b-256 checksum How to use checksums |
06de0b7f766d335b4a89744ebc3f1b60e92f77bff5f0e787b9620007b24c17ea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 5, 2024.
Transparency logRelease files / pysurf96-1.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | pysurf96-1.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 1.0 MB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
48977e1a1ebb9d828a18f7f17bad0cdb553b186727cb4f5cabc9a3db562dfa7b
|
|
BLAKE2b-256 checksum How to use checksums |
fd9d767b3f1d75edc77020b70a78a7e9fed91492f1925d04e43d270294b91bd9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 5, 2024.
Transparency logRelease files / pysurf96-1.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | pysurf96-1.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 1.0 MB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
8b391b0e882fbda81a92e3703020a8b39d8b3754c2254dd8be76978242f3d122
|
|
BLAKE2b-256 checksum How to use checksums |
7f2585cca8eba7c5e929f4772cc85f1481e41db894b749aa168c8ed6e4ef906f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 5, 2024.
Transparency logRelease files / pysurf96-1.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | pysurf96-1.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 1.0 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
51cb215de45e849c73e28c061a5b3a951c987a3135643f738176943c0973eef8
|
|
BLAKE2b-256 checksum How to use checksums |
cef17b81ba167b9d8f02c5a63f6df70314a3d781ccba613802ea441788ddbcf5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 5, 2024.
Transparency log