Skip to main content

Numba-accelerated computation of surface wave dispersion curves

Project description

disba

License Stars Pyversions Version Downloads Code style: black Codacy Badge Codecov

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 caused by low velocity zones.

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,
  • Support single top water layer.

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
# thickness, Vp, Vs, density
# km, km/s, km/s, g/cm3
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)

# Periods must be sorted starting with low periods
f = numpy.linspace(0.1, 10.0, 100)
t = 1.0 / f[::-1]

# Compute the 20 first Rayleigh- and Love- waves modal dispersion curves
# Fundamental mode corresponds to mode 0
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


Download files

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

Source Distribution

disba-0.1.2.tar.gz (11.6 kB view hashes)

Uploaded Source

Built Distribution

disba-0.1.2-py3-none-any.whl (11.6 kB view hashes)

Uploaded Python 3

Supported by

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