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.

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.1.tar.gz (11.1 kB view details)

Uploaded Source

Built Distribution

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

disba-0.1.1-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file disba-0.1.1.tar.gz.

File metadata

  • Download URL: disba-0.1.1.tar.gz
  • Upload date:
  • Size: 11.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.3.0.post20200616 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7

File hashes

Hashes for disba-0.1.1.tar.gz
Algorithm Hash digest
SHA256 d616df8b81198aa8f574b16759678a61bce59e8864fa6b2857f3b649bbe81dde
MD5 82c7447462fc2995bd042485eb8edc31
BLAKE2b-256 44316388461bbf82660bea3f934b45ff2fadb3552834bb4e9242237db142a11f

See more details on using hashes here.

File details

Details for the file disba-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: disba-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 11.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.3.0.post20200616 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7

File hashes

Hashes for disba-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cce00317480b2bf955139b77b48ee62d173836569db982d5333549709935a2b3
MD5 e8038cd91803b9c71832f56a589c0aae
BLAKE2b-256 49157aea5d80b7398b1c965f40ab3b21c7e8384fc7ca1969eee771616437affd

See more details on using hashes here.

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