Numba-accelerated computation of surface wave dispersion curves
Project description
disba
disba
is a computationally efficient Python library for the modeling of surface wave dispersion curves that implements surf96's code in Python compiled just-in-time with numba
. Such implementation alleviates the usual prerequisite for a Fortran compiler needed by other libraries also based on surf96 (e.g. pysurf96
and srfpython
) which often leads to further setup troubleshooting, especially on Windows platform.
disba
's speed is comparable to surf96 compiled with f2py
for Rayleigh-wave but significantly faster for Love-wave with increasing number of layers. disba
also implements the fast delta matrix algorithm for Rayleigh-wave which, albeit ironically slower, is more robust and handles reversion of phase velocity.
Features
Forward modeling:
- Compute Rayleigh-wave dispersion curves using Dunkin's matrix or fast delta matrix algorithms,
- Compute Love-wave dispersion curves using Thomson-Haskell method,
- Support phase and group dispersion velocity.
Installation
The recommended way to install disba
and all its dependencies is through the Python Package Index:
pip install disba --user
Otherwise, clone and extract the package, then run from the package location:
pip install . --user
Usage
The following example computes the Rayleigh- and Love- waves phase velocity dispersion curves for the 20 first modes using the fast delta matrix algorithm for Rayleigh-wave (surf96 fails due to reverted phase velocity). The phase velocity increment is set to 1 m/s for root finding to avoid modal jumps at higher frequencies.
import numpy
from disba import PhaseDispersion
velocity_model = numpy.array([
[0.5, 1.0, 0.5, 1.8],
[0.3, 2.0, 1.0, 1.8],
[10.0, 1.0, 0.5, 1.8],
])
pd = PhaseDispersion(*velocity_model.T, algorithm="fast-delta", dc=0.001)
f = numpy.linspace(0.1, 10.0, 100)
t = 1.0 / f[::-1]
cpr = [pd(t, mode=i, wave="rayleigh") for i in range(20)]
cpl = [pd(t, mode=i, wave="love") for i in range(20)]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.