disba

Numba-accelerated computation of surface wave dispersion

https://github.com/keurfonluu/disba

Science Score: 67.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 3 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (16.6%) to scientific vocabulary

Keywords

dispersion geosciences python seismology surf96 surface-wave
Last synced: 6 months ago · JSON representation ·

Repository

Numba-accelerated computation of surface wave dispersion

Basic Info
Statistics
  • Stars: 161
  • Watchers: 10
  • Forks: 34
  • Open Issues: 2
  • Releases: 10
Topics
dispersion geosciences python seismology surf96 surface-wave
Created over 5 years ago · Last pushed about 1 year ago
Metadata Files
Readme Contributing License Code of conduct Citation

README.rst

disba
=====

|License| |Stars| |Pyversions| |Version| |Downloads| |Code style: black| |Codacy Badge| |Codecov| |Build| |Travis| |Awesome| |DOI|

**disba** is a computationally efficient Python library for the modeling of surface wave dispersion that implements a subset of codes from `Computer Programs in Seismology (CPS) `__ 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 CPS (e.g., `pysurf96 `__, `srfpython `__ and `PyLayeredModel `__) which often leads to further installation troubleshooting, especially on Windows platform.

**disba** aims to be lightweight and portable without compromising on the performance. For both Rayleigh-wave and Love-wave, it is significantly faster than CPS's *surf96* program compiled with `f2py `__, noticeably for large number of layers.

.. list-table::

   *  - |Perf Rayleigh|
      - |Perf Love|

Features
--------

Forward modeling:

-  Compute Rayleigh-wave phase or group dispersion curves using *Dunkin's matrix* or *fast delta matrix* algorithms,
-  Compute Love-wave phase or group dispersion curves using *Thomson-Haskell* method,
-  Compute Rayleigh-wave ellipticity.

Eigenfunctions and sensitivity kernels:

-  Compute Rayleigh- and Love- wave eigenfunctions,
-  Compute Rayleigh- and Love- wave phase or group velocity, and Rayleigh-wave ellipticity sensitivity kernels with respect to layer thickness, P- and S- wave velocities, and density.

Installation
------------

The recommended way to install **disba** and all its dependencies is through the Python Package Index:

.. code:: bash

   pip install disba[full] --user

Otherwise, clone and extract the package, then run from the package location:

.. code:: bash

   pip install .[full] --user

To test the integrity of the installed package, check out this repository and run:

.. code:: bash

   pytest

Documentation
-------------

Refer to the online `documentation `__ for detailed description of the API and examples.

Alternatively, the documentation can be built using `Sphinx `__:

.. code:: bash

   pip install -r doc/requirements.txt
   sphinx-build -b html doc/source doc/build

Usage
-----

The following example computes the Rayleigh- and Love- wave phase velocity dispersion curves for the 3 first modes.

.. code:: python

   import numpy as np
   from disba import PhaseDispersion

   # Velocity model
   # thickness, Vp, Vs, density
   # km, km/s, km/s, g/cm3
   velocity_model = np.array([
      [10.0, 7.00, 3.50, 2.00],
      [10.0, 6.80, 3.40, 2.00],
      [10.0, 7.00, 3.50, 2.00],
      [10.0, 7.60, 3.80, 2.00],
      [10.0, 8.40, 4.20, 2.00],
      [10.0, 9.00, 4.50, 2.00],
      [10.0, 9.40, 4.70, 2.00],
      [10.0, 9.60, 4.80, 2.00],
      [10.0, 9.50, 4.75, 2.00],
   ])

   # Periods must be sorted starting with low periods
   t = np.logspace(0.0, 3.0, 100)

   # Compute the 3 first Rayleigh- and Love- wave modal dispersion curves
   # Fundamental mode corresponds to mode 0
   pd = PhaseDispersion(*velocity_model.T)
   cpr = [pd(t, mode=i, wave="rayleigh") for i in range(3)]
   cpl = [pd(t, mode=i, wave="love") for i in range(3)]

   # pd returns a namedtuple (period, velocity, mode, wave, type)

.. list-table::

   *  - |Sample Rayleigh|
      - |Sample Love|

Likewise, ``GroupDispersion`` can be used for group velocity.

**disba**'s API is consistent across all its classes which are initialized and called in the same fashion. Thus, eigenfunctions are calculated as follow:

.. code:: python

   from disba import EigenFunction

   eigf = EigenFunction(*velocity_model.T)
   eigr = eigf(20.0, mode=0, wave="rayleigh")
   eigl = eigf(20.0, mode=0, wave="love")

   # eigf returns a namedtuple
   #  - (depth, ur, uz, tz, tr, period, mode) for Rayleigh-wave
   #  - (depth, uu, tt, period, mode) for Love-wave

.. list-table::

   *  - |Eigen Rayleigh|
      - |Eigen Love|

Phase velocity sensitivity kernels (``GroupSensitivity`` for group velocity):

.. code:: python

   from disba import PhaseSensitivity

   ps = PhaseSensitivity(*velocity_model.T)
   parameters = ["thickness", "velocity_p", "velocity_s", "density"]
   skr = [ps(20.0, mode=0, wave="rayleigh", parameter=parameter) for parameter in parameters]
   skl = [ps(20.0, mode=0, wave="love", parameter=parameter) for parameter in parameters]

   # ps returns a namedtuple (depth, kernel, period, velocity, mode,wave, type, parameter)

.. list-table::

   *  - |Kernel Rayleigh|
      - |Kernel Love|

Ellipticity and ellipticity sensitivity kernels:

.. code:: python

   from disba import Ellipticity, EllipticitySensitivity

   ell = Ellipticity(*velocity_model.T)
   rel = ell(t, mode=0)

   # ell returns a namedtuple (period, ellipticity, mode)

   es = EllipticitySensitivity(*velocity_model.T)
   ek = [es(20.0, mode=0, parameter=parameter) for parameter in parameters]

   # es returns a namedtuple (depth, kernel, period, velocity, mode, wave, type, parameter)

.. list-table::

   *  - |Sample Ellipticity|
      - |Kernel Ellipticity|

Contributing
------------

Please refer to the `Contributing
Guidelines `__ to see how you can help. This project is released with a `Code of Conduct `__ which you agree to abide by when contributing.

.. |License| image:: https://img.shields.io/github/license/keurfonluu/disba
   :target: https://github.com/keurfonluu/disba/blob/master/LICENSE

.. |Stars| image:: https://img.shields.io/github/stars/keurfonluu/disba?logo=github
   :target: https://github.com/keurfonluu/disba

.. |Pyversions| image:: https://img.shields.io/pypi/pyversions/disba.svg?style=flat
   :target: https://pypi.org/pypi/disba/

.. |Version| image:: https://img.shields.io/pypi/v/disba.svg?style=flat
   :target: https://pypi.org/project/disba

.. |Downloads| image:: https://pepy.tech/badge/disba
   :target: https://pepy.tech/project/disba

.. |Code style: black| image:: https://img.shields.io/badge/code%20style-black-000000.svg?style=flat
   :target: https://github.com/psf/black

.. |Codacy Badge| image:: https://img.shields.io/codacy/grade/1d2218bb7d0e4e0fb2dec26fa32fe92e.svg?style=flat
   :target: https://www.codacy.com/manual/keurfonluu/disba?utm_source=github.com&utm_medium=referral&utm_content=keurfonluu/disba&utm_campaign=Badge_Grade

.. |Codecov| image:: https://img.shields.io/codecov/c/github/keurfonluu/disba.svg?style=flat
   :target: https://codecov.io/gh/keurfonluu/disba

.. |DOI| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.3987395.svg?style=flat
   :target: https://doi.org/10.5281/zenodo.3987395

.. |Build| image:: https://img.shields.io/github/workflow/status/keurfonluu/disba/Python%20package
   :target: https://github.com/keurfonluu/disba

.. |Travis| image:: https://img.shields.io/travis/com/keurfonluu/disba/master?label=docs
   :target: https://keurfonluu.github.io/disba/

.. |Awesome| image:: https://img.shields.io/badge/awesome-yes-C6A4BF
   :target: https://github.com/softwareunderground/awesome-open-geoscience

.. |Perf Rayleigh| image:: https://raw.githubusercontent.com/keurfonluu/disba/e29865fb0b385b295bc55b733a138a741787879d/.github/perf_rayleigh.svg
   :alt: perf-rayleigh

.. |Perf Love| image:: https://raw.githubusercontent.com/keurfonluu/disba/5d23a8bb3967fd59c1a38b59ce1bf800749c7eb2/.github/perf_love.svg
   :alt: perf-love

.. |Sample Rayleigh| image:: https://raw.githubusercontent.com/keurfonluu/disba/5d23a8bb3967fd59c1a38b59ce1bf800749c7eb2/.github/sample_rayleigh.svg
   :alt: sample-rayleigh

.. |Sample Love| image:: https://raw.githubusercontent.com/keurfonluu/disba/5d23a8bb3967fd59c1a38b59ce1bf800749c7eb2/.github/sample_love.svg
   :alt: sample-love

.. |Sample Ellipticity| image:: https://raw.githubusercontent.com/keurfonluu/disba/5f9b95a144e3751ffa98b5860663af874c02ae1c/.github/sample_ellipticity.svg
   :alt: sample-ellipticity

.. |Eigen Rayleigh| image:: https://raw.githubusercontent.com/keurfonluu/disba/5f9b95a144e3751ffa98b5860663af874c02ae1c/.github/eigen_rayleigh.svg
   :alt: eigen-rayleigh

.. |Eigen Love| image:: https://raw.githubusercontent.com/keurfonluu/disba/5f9b95a144e3751ffa98b5860663af874c02ae1c/.github/eigen_love.svg
   :alt: eigen-love

.. |Kernel Rayleigh| image:: https://raw.githubusercontent.com/keurfonluu/disba/5f9b95a144e3751ffa98b5860663af874c02ae1c/.github/kernel_rayleigh.svg
   :alt: kernel-rayleigh

.. |Kernel Love| image:: https://raw.githubusercontent.com/keurfonluu/disba/5f9b95a144e3751ffa98b5860663af874c02ae1c/.github/kernel_love.svg
   :alt: kernel-love

.. |Kernel Ellipticity| image:: https://raw.githubusercontent.com/keurfonluu/disba/5f9b95a144e3751ffa98b5860663af874c02ae1c/.github/kernel_ellipticity.svg
   :alt: kernel-ellipticity

Owner

  • Name: Keurfon Luu
  • Login: keurfonluu
  • Kind: user
  • Location: Wettingen, Switzerland
  • Company: INTERA Incorporated

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Luu"
  given-names: "Keurfon"
  orcid: "https://orcid.org/0000-0001-7927-0019"
title: "disba: Numba-accelerated computation of surface wave dispersion"
doi: 10.5281/zenodo.3987395
url: https://github.com/keurfonluu/disba
license: BSD-3-Clause

GitHub Events

Total
  • Issues event: 3
  • Watch event: 27
  • Issue comment event: 5
  • Push event: 4
  • Pull request event: 2
  • Fork event: 6
  • Create event: 1
Last Year
  • Issues event: 3
  • Watch event: 27
  • Issue comment event: 5
  • Push event: 4
  • Pull request event: 2
  • Fork event: 6
  • Create event: 1

Committers

Last synced: about 2 years ago

All Time
  • Total Commits: 178
  • Total Committers: 1
  • Avg Commits per committer: 178.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Keurfon Luu k****u@o****m 178

Issues and Pull Requests

Last synced: 8 months ago

All Time
  • Total issues: 15
  • Total pull requests: 30
  • Average time to close issues: 2 months
  • Average time to close pull requests: about 1 hour
  • Total issue authors: 12
  • Total pull request authors: 2
  • Average comments per issue: 1.87
  • Average comments per pull request: 0.77
  • Merged pull requests: 29
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 4
  • Pull requests: 1
  • Average time to close issues: 1 day
  • Average time to close pull requests: 8 minutes
  • Issue authors: 2
  • Pull request authors: 1
  • Average comments per issue: 1.5
  • Average comments per pull request: 1.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • chengsong2333 (3)
  • ChengSong233 (2)
  • mdenolle (1)
  • liufeng2317 (1)
  • smouellet (1)
  • h-cas-valle (1)
  • SeisPider (1)
  • AriesChen-UPC (1)
  • LevCarlo (1)
  • xichaoqiang (1)
  • mariosgeo (1)
Pull Request Authors
  • keurfonluu (30)
  • th-reb (1)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 2
  • Total downloads:
    • pypi 4,560 last-month
  • Total dependent packages: 2
    (may contain duplicates)
  • Total dependent repositories: 1
    (may contain duplicates)
  • Total versions: 32
  • Total maintainers: 1
proxy.golang.org: github.com/keurfonluu/disba
  • Versions: 16
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 5.4%
Average: 5.6%
Dependent repos count: 5.8%
Last synced: 7 months ago
pypi.org: disba

Numba-accelerated computation of surface wave dispersion

  • Versions: 16
  • Dependent Packages: 2
  • Dependent Repositories: 1
  • Downloads: 4,560 Last month
Rankings
Dependent packages count: 3.1%
Stargazers count: 7.1%
Downloads: 7.4%
Forks count: 7.5%
Average: 9.3%
Dependent repos count: 21.6%
Maintainers (1)
Last synced: 7 months ago

Dependencies

doc/requirements.txt pypi
  • matplotlib *
  • pydata-sphinx-theme *
  • sphinx *
  • sphinx-argparse *
  • sphinx-gallery *
  • sphinxcontrib-bibtex *
requirements-dev.txt pypi
  • black * development
  • docformatter * development
  • invoke * development
  • isort * development
  • pytest * development
  • pytest-cov * development
.github/workflows/ci.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v1 composite
pyproject.toml pypi