All Projects → keurfonluu → disba

keurfonluu / disba

Licence: BSD-3-Clause license
Numba-accelerated computation of surface wave dispersion

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to disba

axisem
AxiSEM is a parallel spectral-element method to solve 3D wave propagation in a sphere with axisymmetric or spherically symmetric visco-elastic, acoustic, anisotropic structures.
Stars: ✭ 34 (-48.48%)
Mutual labels:  seismology
PH5
Library of PH5 clients, apis, and utilities
Stars: ✭ 14 (-78.79%)
Mutual labels:  seismology
SeisNoise.jl
Ambient Noise Cross-Correlation in Julia
Stars: ✭ 43 (-34.85%)
Mutual labels:  seismology
RfPy
Teleseismic receiver function calculation and post-processing
Stars: ✭ 25 (-62.12%)
Mutual labels:  seismology
etas
calibrate ETAS, simulate using ETAS, estimate completeness magnitude & magnitude frequency distribution
Stars: ✭ 37 (-43.94%)
Mutual labels:  seismology
FastPCC
Compute interstation correlations of seismic ambient noise, including fast implementations of the standard, 1-bit and phase cross-correlations.
Stars: ✭ 24 (-63.64%)
Mutual labels:  seismology
fteikpy
Accurate Eikonal solver for Python
Stars: ✭ 34 (-48.48%)
Mutual labels:  seismology
MTfit
MTfit code for Bayesian Moment Tensor Fitting
Stars: ✭ 61 (-7.58%)
Mutual labels:  seismology
sonify
Sonification of seismic and infrasound signals
Stars: ✭ 26 (-60.61%)
Mutual labels:  seismology
Lazylyst
Lazylyst is a GUI created for time series review, using a flexible framework for new workflows
Stars: ✭ 16 (-75.76%)
Mutual labels:  seismology
noisi
A tool for modeling and source inversion of auto- and cross-correlations of ambient seismic "noise".
Stars: ✭ 32 (-51.52%)
Mutual labels:  seismology
REDPy
Repeating Earthquake Detector (Python)
Stars: ✭ 62 (-6.06%)
Mutual labels:  seismology
OrientPy
Seismic station orientation tools
Stars: ✭ 29 (-56.06%)
Mutual labels:  seismology
scrtdd
Double Difference Relocator for SeisComP
Stars: ✭ 17 (-74.24%)
Mutual labels:  seismology
sl2influxdb
Fetch seedlink data and store them into InfluxDB
Stars: ✭ 28 (-57.58%)
Mutual labels:  seismology
obsplus
A Pandas-Centric ObsPy Expansion Pack
Stars: ✭ 28 (-57.58%)
Mutual labels:  seismology
Gisola
Gisola: A High Performance Computing application for real-time Moment Tensor inversion
Stars: ✭ 35 (-46.97%)
Mutual labels:  seismology
zmap7
ZMAP Seismology Software. V 7.x has been updated to MATLAB R2018a.
Stars: ✭ 60 (-9.09%)
Mutual labels:  seismology
nllgrid
Python class for reading and writing NLLoc grid files.
Stars: ✭ 23 (-65.15%)
Mutual labels:  seismology
QuakeMigrate
A Python package for automatic earthquake detection and location using waveform migration and stacking.
Stars: ✭ 101 (+53.03%)
Mutual labels:  seismology

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.

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:

pip install disba[full] --user

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

pip install .[full] --user

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

pytest

Documentation

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

Alternatively, the documentation can be built using Sphinx:

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.

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

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
eigen-rayleigh eigen-love

Phase velocity sensitivity kernels (GroupSensitivity for group velocity):

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)
kernel-rayleigh kernel-love

Ellipticity and ellipticity sensitivity kernels:

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].