AgentSkillsCN

disba

采用Thomson-Haskell矩阵法,并借助Numba加速,计算分层地球模型的面波频散曲线。当Claude需要执行以下操作时使用:(1) 计算瑞利波或勒夫波的相速度;(2) 计算群速度频散;(3) 为反演生成敏感度核;(4) 根据速度剖面正演模拟频散曲线;(5) 比较不同地球模型之间的频散特征;(6) 搭建面波层析成像工作流程。

SKILL.md
--- frontmatter
name: disba
description: |
  Compute surface wave dispersion curves for layered Earth models using the
  Thomson-Haskell matrix method with Numba acceleration. Use when Claude needs to:
  (1) Calculate Rayleigh or Love wave phase velocities, (2) Compute group velocity
  dispersion, (3) Generate sensitivity kernels for inversion, (4) Forward model
  dispersion curves from velocity profiles, (5) Compare dispersion between different
  Earth models, (6) Set up surface wave tomography workflows.

disba - Surface Wave Dispersion

Quick Reference

python
import numpy as np
from disba import PhaseDispersion, GroupDispersion

# Define velocity model (thickness, Vp, Vs, density)
# thickness in km, velocities in km/s, density in g/cm3
thickness = np.array([0.5, 1.0, 2.0, 0.0])  # 0.0 = half-space
vp = np.array([1.5, 2.5, 4.0, 6.0])
vs = np.array([0.8, 1.4, 2.3, 3.5])
rho = np.array([1.8, 2.0, 2.3, 2.6])

# Periods to compute (seconds)
periods = np.linspace(0.1, 5.0, 50)

# Calculate Rayleigh wave phase velocity
pd = PhaseDispersion(*zip(thickness, vp, vs, rho))
cpr = pd(periods, mode=0, wave='rayleigh')  # Fundamental mode

# Calculate group velocity
gd = GroupDispersion(*zip(thickness, vp, vs, rho))
ugr = gd(periods, mode=0, wave='rayleigh')

Key Classes

ClassPurpose
PhaseDispersionPhase velocity dispersion curves
GroupDispersionGroup velocity dispersion curves
PhaseSensitivitySensitivity kernels (dc/dVs, dc/dVp, dc/drho)

Essential Operations

Rayleigh and Love Waves

python
pd = PhaseDispersion(*zip(thickness, vp, vs, rho))
cpr = pd(periods, mode=0, wave='rayleigh')  # Vertical + radial motion
cpl = pd(periods, mode=0, wave='love')       # Horizontal SH motion

Multiple Modes

python
for mode in range(3):  # Fundamental + higher modes
    try:
        cpr = pd(periods, mode=mode, wave='rayleigh')
    except Exception:
        pass  # Higher modes may not exist at all periods

Sensitivity Kernels

python
from disba import PhaseSensitivity

ps = PhaseSensitivity(*zip(thickness, vp, vs, rho))
kernel_vs = ps(period=1.0, mode=0, wave='rayleigh', parameter='velocity_s')
# Other parameters: 'velocity_p', 'density'

Forward Modelling

python
def forward_model(vs_profile, thickness, vp_vs_ratio=1.73):
    """Compute dispersion curve from Vs profile."""
    vp = vs_profile * vp_vs_ratio
    rho = 0.32 * vp + 0.77  # Gardner relation
    pd = PhaseDispersion(*zip(thickness, vp, vs_profile, rho))
    return pd(periods, mode=0, wave='rayleigh')

Model Parameters

ParameterUnitDescription
thicknesskmLayer thickness (0 = half-space)
vpkm/sP-wave velocity
vskm/sS-wave velocity
rhog/cm3Density

Wave Types

TypeMotionSensitivity
RayleighVertical + radialVs (primary), Vp (secondary)
LoveHorizontal (SH)Vs only

Key Points

  1. Last layer thickness = 0 indicates half-space (infinite depth)
  2. Numba JIT - First call is slower due to compilation
  3. Higher modes may not exist at all periods
  4. Sensitivity kernels show which depths affect each period

Common Issues

IssueSolution
No dispersion at short periodsIncrease model resolution (thinner layers)
Higher mode not computedMode may not exist at those periods
Slow first runNormal - Numba compiles on first call
NaN in resultsCheck model validity (Vs < Vp, positive values)

References

Scripts