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 details)

Uploaded Source

Built Distribution

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

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: disba-0.1.2.tar.gz
  • Upload date:
  • Size: 11.6 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.2.tar.gz
Algorithm Hash digest
SHA256 dfa316bf3bc7b91eab44b1e30c00cd19750c2379d9b10fdec0f8a36b654ab97d
MD5 9e2b6dc44f9e9d90db6883a8b4b0d79e
BLAKE2b-256 1707b1cced64f601911c4292fd6098a94801ccd878ba131bb027f3d1b5d50dd5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: disba-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 11.6 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b376aacba1ad1c2d155c779997a983a7593c422cd91d4b680f6c5967bd7d6512
MD5 d5decc6dc4a80fa029c0d2bb400c5ff6
BLAKE2b-256 7b2b9926c904b7c65c60a9e9cbe6a95a6d0c23f6d2c9a3e1ea21992e53a39cae

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