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.

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


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.0.tar.gz (12.0 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.0-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: disba-0.1.0.tar.gz
  • Upload date:
  • Size: 12.0 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.0.tar.gz
Algorithm Hash digest
SHA256 b7c8cbb06b8ee5c2431067eec773ac1a4e726c9672945a1d785f984240b6bf47
MD5 f63466cf1d758abaaed79ac588abe9da
BLAKE2b-256 890fb55dddb7db70c664a23e79cb4c4605e3200402586f168e9161b2a9b17e40

See more details on using hashes here.

File details

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

File metadata

  • Download URL: disba-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.2 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 52a0e7febf379ef089558b37a02cacb83777900810797e445dc0823a6de7fc70
MD5 b819f8eb10ef2acc426c44c8d147547b
BLAKE2b-256 cdaf21a369bb33984fcc617ccf22355772348d36255af01ca6d0580b5125b181

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