Skip to main content

Surface Wave Dispersion Python Wrapper for surf96.

Project description

PySurf96

Ruff Python 3.10+

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)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pysurf96-1.0.1.tar.gz (17.6 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pysurf96-1.0.1-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.0 MB view details)

Uploaded PyPymanylinux: glibc 2.17+ x86-64

pysurf96-1.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

pysurf96-1.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

pysurf96-1.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

File details

Details for the file pysurf96-1.0.1.tar.gz.

File metadata

  • Download URL: pysurf96-1.0.1.tar.gz
  • Upload date:
  • Size: 17.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pysurf96-1.0.1.tar.gz
Algorithm Hash digest
SHA256 a5c85cd3e76b7a130b131f9d84aebfbadb2f6d6745cf9e64e80fcad1911367b1
MD5 6a2056b2694f17e2402555272406035c
BLAKE2b-256 217a6988031c439d619042f4f9f263fb54be40887bef8d2cd17e9c2d7f6a0eda

See more details on using hashes here.

Provenance

The following attestation bundles were made for pysurf96-1.0.1.tar.gz:

Publisher: publish.yml on miili/pysurf96

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pysurf96-1.0.1-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pysurf96-1.0.1-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8d3d3bc4bf6c5b311eec07cf27703aa2948ca895200ca4fe1be3b21bae821175
MD5 574059814b77b1d2dcbf8f57e7d67bd9
BLAKE2b-256 06de0b7f766d335b4a89744ebc3f1b60e92f77bff5f0e787b9620007b24c17ea

See more details on using hashes here.

Provenance

The following attestation bundles were made for pysurf96-1.0.1-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish.yml on miili/pysurf96

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pysurf96-1.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pysurf96-1.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 48977e1a1ebb9d828a18f7f17bad0cdb553b186727cb4f5cabc9a3db562dfa7b
MD5 d45c57b090520005b8d387dc5eb9677e
BLAKE2b-256 fd9d767b3f1d75edc77020b70a78a7e9fed91492f1925d04e43d270294b91bd9

See more details on using hashes here.

Provenance

The following attestation bundles were made for pysurf96-1.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish.yml on miili/pysurf96

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pysurf96-1.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pysurf96-1.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8b391b0e882fbda81a92e3703020a8b39d8b3754c2254dd8be76978242f3d122
MD5 66be8ba596f89da66483766ec48b4e90
BLAKE2b-256 7f2585cca8eba7c5e929f4772cc85f1481e41db894b749aa168c8ed6e4ef906f

See more details on using hashes here.

Provenance

The following attestation bundles were made for pysurf96-1.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish.yml on miili/pysurf96

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pysurf96-1.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pysurf96-1.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 51cb215de45e849c73e28c061a5b3a951c987a3135643f738176943c0973eef8
MD5 3f0adf9b8223dd686a1f649511a8a44b
BLAKE2b-256 cef17b81ba167b9d8f02c5a63f6df70314a3d781ccba613802ea441788ddbcf5

See more details on using hashes here.

Provenance

The following attestation bundles were made for pysurf96-1.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish.yml on miili/pysurf96

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page