Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

gamma-phase-associator

БесплатноБез исполняемых скриптовНе проверен

An overview of the python package for running the GaMMA earthquake phase association algorithm. The algorithm expects phase picks data and station data as…

benchflow-aiот benchflow-ai★ 1 941 звезда на GitHub

Об этом скилле

GaMMA Associator Library

What is GaMMA?

GaMMA is an earthquake phase association algorithm that treats association as an unsupervised clustering problem. It uses multivariate Gaussian distribution to model the collection of phase picks of an event, and uses Expectation-Maximization to carry out pick assignment and estimate source parameters i.e., earthquake location, origin time, and magnitude.

GaMMA is a python library implementing the algorithm. For the input earthquake traces, this library assumes P/S wave picks have already been extracted. We provide documentation of its core API.

Zhu, W., McBrearty, I. W., Mousavi, S. M., Ellsworth, W. L., & Beroza, G. C. (2022). Earthquake phase association using a Bayesian Gaussian mixture model. Journal of Geophysical Research: Solid Earth, 127(5).

The skill is a derivative of the repo https://github.com/AI4EPS/GaMMA

Installing GaMMA

pip install git+https://github.com/wayneweiqiang/GaMMA.git

GaMMA core API

association

Function Signature

def association(picks, stations, config, event_idx0=0, method="BGMM", **kwargs)

Purpose

Associates seismic phase picks (P and S waves) to earthquake events using Bayesian or standard Gaussian Mixture Models. It clusters picks based on arrival time and amplitude information, then fits GMMs to estimate earthquake locations, times, and magnitudes.

1. Input Parameters

Parameter Type Default Description
picks DataFrame required Seismic phase pick data
stations DataFrame required Station metadata with locations
config dict required Configuration parameters
event_idx0 int 0 Starting event index for numbering
method str "BGMM" "BGMM" (Bayesian) or "GMM" (standard)

2. Required DataFrame Columns

picks DataFrame
Column Type Description Example
id str Station identifier (must match stations) network.station. or network.station.location.channel
timestamp datetime/str Pick arrival time (ISO format or datetime) "2019-07-04T22:00:06.084"
type str Phase type: "p" or "s" (lowercase) "p"
prob float Pick probability/weight (0-1) 0.94
amp float Amplitude in m/s (required if use_amplitude=True) 0.000017

Notes:

  • Timestamps must be in UTC or converted to UTC
  • Phase types are forced to lowercase internally
  • Picks with amp == 0 or amp == -1 are filtered when use_amplitude=True
  • The DataFrame index is used to track pick identities in the output
stations DataFrame
Column Type Description Example
id str Station identifier "CI.CCC..BH"
x(km) float X coordinate in km (projected) -35.6
y(km) float Y coordinate in km (projected) 45.2
z(km) float Z coordinate (elevation, typically negative) -0.67

Notes:

  • Coordinates should be in a projected local coordinate system (e.g., you can use the pyproj package)
  • The id column must match the id values in the picks DataFrame (e.g., network.station. or network.station.location.channel)
  • Group stations by unique id, identical attribute are collapsed to a single value and conflicting metadata are preseved as a sorted list.

3. Config Dictionary Keys

Required Keys
Key Type Description Example
dims list[str] Location dimensions to solve for ["x(km)", "y(km)", "z(km)"]
min_picks_per_eq int Minimum picks required per earthquake 5
max_sigma11 float Maximum allowed time residual in seconds 2.0
use_amplitude bool Whether to use amplitude in clustering True
bfgs_bounds tuple Bounds for BFGS optimization ((-35, 92), (-128, 78), (0, 21), (None, None))
oversample_factor float Factor for oversampling initial GMM components 5.0 for BGMM, 1.0 for GMM

Notes on dims:

  • Options: ["x(km)", "y(km)", "z(km)"], ["x(km)", "y(km)"], or ["x(km)"]

Notes on bfgs_bounds:

  • Format: ((x_min, x_max), (y_min, y_max), (z_min, z_max), (None, None))
  • The last tuple is for time (unbounded)
Velocity Model Keys
Key Type Default Description
vel dict {"p": 6.0, "s": 3.47} Uniform velocity model (km/s)
eikonal dict/None None 1D velocity model for travel times
DBSCAN Pre-clustering Keys (Optional)
Key Type Default Description
use_dbscan bool True Enable DBSCAN pre-clustering
dbscan_eps float 25 Max time between picks (seconds)
dbscan_min_samples int 3 Min samples in DBSCAN neighborhood
dbscan_min_cluster_size int 500 Min clust
Полный SKILL.md на GitHub

Установить gamma-phase-associator в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл gamma-phase-associator?

An overview of the python package for running the GaMMA earthquake phase association algorithm. The algorithm expects phase picks data and station data as input and produces (through unsupervised clustering) earthquake events with source information like earthquake location, origin time and magnitude. The skill explains commonly used functions and the expected input/output format.

Как установить скилл gamma-phase-associator?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл gamma-phase-associator запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить gamma-phase-associator с