Agent skill

Gamma Phase Associator

by benchflow-ai in benchflow-ai/skillsbench

An overview of the python package for running the GaMMA earthquake phase association algorithm.

Apache-2.0Auto-check passedData & Analytics

Install Gamma Phase Associator

skills CLI
$ npx skills add benchflow-ai/skillsbench --skill gamma-phase-associator -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install benchflow-ai/skillsbench gamma-phase-associator --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/benchflow-ai/skillsbench.git skills-src && mkdir -p .claude/skills && cp -r skills-src/tasks/earthquake-phase-association/environment/skills/gamma-phase-associator .claude/skills/gamma-phase-associator && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
gamma-phase-associator
GitHub stars
1.8k
Token cost
~2.5k tokens
SKILL.md length
969 words
Files
1
Skills in repo
189
Repo updated
First seen
Licence
Apache-2.0

At a glance

An overview of the python package for running the GaMMA earthquake phase association algorithm.

  • Works in 10 steps: Input Parameters → Required DataFrame Columns → Config Dictionary Keys → …
  • Tasks that involve DataFrames
  • SKILL.md covers What is GaMMA?, Installing GaMMA and GaMMA core API
  • Calls pip; reaches github.com

What it does

Gamma Phase Associator is an agent skill from benchflow-ai/skillsbench. 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.

Its SKILL.md is about 2.5k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Data & Analytics, covering DataFrames. It works with Python. The repository describes itself as: SkillsBench evaluates how well skills work and how effective agents are at using them. The licence is Apache-2.0.

When your agent uses it

  • Tasks that involve DataFrames

Example prompts

  • “/gamma-phase-associator”

Requirements

  • Python 3

Workflow steps

10 steps, taken from the step headings in SKILL.md.

  1. Input Parameters
  2. Required DataFrame Columns
  3. Config Dictionary Keys
  4. Return Values
  5. Input Parameters
  6. Required DataFrame Columns
  7. Return Value
  8. Example Usage
  9. Practical Notes
  10. Related Configuration

What it can do on your machine

Read from SKILL.md and the folder at commit 9a1f4dd. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • pip

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Gamma Phase Associator loads about 2.5k tokens when it runs. Until then it costs about 102 tokens; SKILL.md has 969 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~102
When it runs · the whole SKILL.md, loaded when a task matches
~2.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from benchflow-ai/skillsbench at commit 9a1f4dd, republished under its Apache-2.0 licence (© benchflow-ai). 969 words, ~2,527 tokens.

Download SKILL.mdSave it as .claude/skills/gamma-phase-associator/SKILL.md (or your agent's skills folder).
name
gamma-phase-associator
description
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 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
python
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
ParameterTypeDefaultDescription
picksDataFramerequiredSeismic phase pick data
stationsDataFramerequiredStation metadata with locations
configdictrequiredConfiguration parameters
event_idx0int0Starting event index for numbering
methodstr"BGMM""BGMM" (Bayesian) or "GMM" (standard)
2. Required DataFrame Columns
picks DataFrame
ColumnTypeDescriptionExample
idstrStation identifier (must match stations)network.station. or network.station.location.channel
timestampdatetime/strPick arrival time (ISO format or datetime)"2019-07-04T22:00:06.084"
typestrPhase type: "p" or "s" (lowercase)"p"
probfloatPick probability/weight (0-1)0.94
ampfloatAmplitude 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
ColumnTypeDescriptionExample
idstrStation identifier"CI.CCC..BH"
x(km)floatX coordinate in km (projected)-35.6
y(km)floatY coordinate in km (projected)45.2
z(km)floatZ 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
KeyTypeDescriptionExample
dimslist[str]Location dimensions to solve for["x(km)", "y(km)", "z(km)"]
min_picks_per_eqintMinimum picks required per earthquake5
max_sigma11floatMaximum allowed time residual in seconds2.0
use_amplitudeboolWhether to use amplitude in clusteringTrue
bfgs_boundstupleBounds for BFGS optimization((-35, 92), (-128, 78), (0, 21), (None, None))
oversample_factorfloatFactor for oversampling initial GMM components5.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
KeyTypeDefaultDescription
veldict{"p": 6.0, "s": 3.47}Uniform velocity model (km/s)
eikonaldict/NoneNone1D velocity model for travel times
DBSCAN Pre-clustering Keys (Optional)
KeyTypeDefaultDescription
use_dbscanboolTrueEnable DBSCAN pre-clustering
dbscan_epsfloat25Max time between picks (seconds)
dbscan_min_samplesint3Min samples in DBSCAN neighborhood
dbscan_min_cluster_sizeint500Min cluster size for hierarchical splitting
dbscan_max_time_space_ratiofloat10Max time/space ratio for splitting
  • dbscan_eps is obtained from estimate_eps Function
Show full SKILL.md (385 more words)Show less
Filtering Keys (Optional)

| Key | Type | Default | Description | |-----|------|-------------| | max_sigma22 | float | 1.0 | Max phase amplitude residual in log scale (required if use_amplitude=True) | | max_sigma12 | float | 1.0 | Max covariance | | max_sigma11 | float | 2.0 | Max phase time residual (s) | | min_p_picks_per_eq | int | 0 | Min P-phase picks per event | | min_s_picks_per_eq | int | 0 |Min S-phase picks per event | | min_stations | int | 5 |Min unique stations per event |

Other Optional Keys
KeyTypeDefaultDescription
covariance_priorlist[float]autoPrior for covariance [time, amp]
ncpuintautoNumber of CPUs for parallel processing
4. Return Values

Returns a tuple (events, assignments):

events (list[dict])

List of dictionaries, each representing an associated earthquake:

KeyTypeDescription
timestrOrigin time (ISO 8601 with milliseconds)
magnitudefloatEstimated magnitude (999 if use_amplitude=False)
sigma_timefloatTime uncertainty (seconds)
sigma_ampfloatAmplitude uncertainty (log10 scale)
cov_time_ampfloatTime-amplitude covariance
gamma_scorefloatAssociation quality score
num_picksintTotal picks assigned
num_p_picksintP-phase picks assigned
num_s_picksintS-phase picks assigned
event_indexintUnique event index
x(km)floatX coordinate of hypocenter
y(km)floatY coordinate of hypocenter
z(km)floatZ coordinate (depth)
assignments (list[tuple])

List of tuples (pick_index, event_index, gamma_score):

  • pick_index: Index in the original picks DataFrame
  • event_index: Associated event index
  • gamma_score: Probability/confidence of assignment
estimate_eps Function Documentation
Function Signature
python
def estimate_eps(stations, vp, sigma=2.0)
Purpose

Estimates an appropriate DBSCAN epsilon (eps) parameter for clustering seismic phase picks based on station spacing. The eps parameter controls the maximum time distance between picks that should be considered neighbors in the DBSCAN clustering algorithm.

1. Input Parameters
ParameterTypeDefaultDescription
stationsDataFramerequiredStation metadata with 3D coordinates
vpfloatrequiredP-wave velocity in km/s
sigmafloat2.0Number of standard deviations above the mean
2. Required DataFrame Columns
stations DataFrame
ColumnTypeDescriptionExample
x(km)floatX coordinate in km-35.6
y(km)floatY coordinate in km45.2
z(km)floatZ coordinate in km-0.67
3. Return Value
TypeDescription
floatEpsilon value in seconds for use with DBSCAN clustering
4. Example Usage
python
from gamma.utils import estimate_eps

# Assuming stations DataFrame is already prepared with x(km), y(km), z(km) columns
vp = 6.0  # P-wave velocity in km/s

# Estimate eps automatically based on station spacing
eps = estimate_eps(stations, vp, sigma=2.0)

# Use in config
config = {
    "use_dbscan": True,
    "dbscan_eps": eps,  # or use estimate_eps(stations, config["vel"]["p"])
    "dbscan_min_samples": 3,
    # ... other config options
}
Typical Usage Pattern
python
from gamma.utils import association, estimate_eps

# Automatic eps estimation
config["dbscan_eps"] = estimate_eps(stations, config["vel"]["p"])

# Or manual override (common in practice)
config["dbscan_eps"] = 15  # seconds
5. Practical Notes
  • In example notebooks, the function is often commented out in favor of hardcoded values (10-15 seconds)
  • Practitioners may prefer manual tuning for specific networks/regions
  • Typical output values range from 10-20 seconds depending on station density
  • Useful when optimal eps is unknown or when working with new networks

The output is typically used with these config parameters:

python
config["dbscan_eps"] = estimate_eps(stations, config["vel"]["p"])
config["dbscan_min_samples"] = 3
config["dbscan_min_cluster_size"] = 500
config["dbscan_max_time_space_ratio"] = 10

© benchflow-ai, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in tasks/earthquake-phase-association/environment/skills/gamma-phase-associator of benchflow-ai/skillsbench.

Open the folder on GitHubat commit 9a1f4dd

Compare with similar skills

Gamma Phase Associator next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Gamma Phase Associator compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Gamma Phase Associator this skillbenchflow-ai/skillsbench1.8k—~2.5kAutomated safety check: PassApache-2.0
Chdb Datastorevemetric/vemetric3952 repos~1.4kAutomated safety check: PassApache-2.0
Polar Python SDKpolarsource/polar10k—~1.8kAutomated safety check: PassApache-2.0
CSV Data Summarizercoffeefuelbump/csv-data-summarizer-claude-skill4682 repos~1.4kAutomated safety check: PassNone
Pandas ProJeffallan/claude-skills12k1 repos~1.5kAutomated safety check: PassMIT
Python Executorcortega26/chile-hub1132 repos~1.5kAutomated safety check: PassMIT

Similar skills

  • Chdb Datastore

    vemetric/vemetric

    A skill your agent uses when the user has tabular data (pandas DataFrame, parquet, csv, Arrow, json) and wants to filter, group, aggregate, join, or speed up slow pandas.

    395 GitHub starsUsed in 2 repos~1.4k tokens
    Data & AnalyticsAuto-check passed
  • Polar Python SDK

    polarsource/polar

    Integrate Polar billing in server-side Python applications using the versioned Polar and PolarAsync clients.

    10k GitHub stars~1.8k tokensUpdated yesterday
    Data & AnalyticsAuto-check passed
  • CSV Data Summarizer

    coffeefuelbump/csv-data-summarizer-claude-skill

    Analyzes CSV files, generates summary stats, and plots quick visualizations using Python and pandas.

    468 GitHub starsUsed in 2 repos~1.4k tokens
    Data & AnalyticsAuto-check passed
  • Pandas Pro

    Jeffallan/claude-skills

    Handles pandas DataFrame work: cleaning, merging, groupby aggregation, pivots, time-series resampling and memory tuning, with checks on dtypes, shapes and nulls.

    12k GitHub starsUsed in 1 repo~1.5k tokens
    Data & AnalyticsAuto-check passed
  • Python Executor

    cortega26/chile-hub

    Execute Python code in a safe sandboxed environment via [inference.sh](https://inference.sh).

    113 GitHub starsUsed in 2 repos~1.5k tokens
    Data & AnalyticsAuto-check passed
  • Retentioneering Product Analytics

    retentioneering/retentioneering-tools

    Analyze event logs, clickstreams, user paths, product funnels, retention, behavioral segments, transition graphs, step matrices, sequence patterns, and customer journeys using Retentioneering.

    927 GitHub stars~1.6k tokensUpdated 3 days ago
    Data & AnalyticsAuto-check passed

More from benchflow-ai/skillsbench

All 189 skills in this repo
  • Lean4 Memories

    benchflow-ai/skillsbench

    This skill should be used when working on Lean 4 formalization projects to maintain persistent memory of successful proof patterns, failed approaches, project conventions, and user preferences…

    1.8k GitHub stars~3.2k tokensUpdated 2 mo ago
    Auto-check passed
  • Senior Data Engineer

    benchflow-ai/skillsbench

    World-class data engineering skill for building scalable data pipelines, ETL/ELT systems, real-time streaming, and data infrastructure.

    1.8k GitHub stars~5.9k tokensUpdated 2 mo ago
    Auto-check passed
  • Ac Branch Pi Model

    benchflow-ai/skillsbench

    AC branch pi-model power flow equations (P/Q and |S|) with transformer tap ratio and phase shift, matching acopf-math-model.md and MATPOWER branch fields.

    1.8k GitHub stars~1.1k tokensUpdated 2 mo ago
    Auto-check passed
  • Civ6lib

    benchflow-ai/skillsbench

    Civilization 6 district mechanics library. An agent skill from benchflow-ai/skillsbench.

    1.8k GitHub stars~1.7k tokensUpdated 2 mo ago
    Auto-check passed
  • D3 Visualization

    benchflow-ai/skillsbench

    Build deterministic, verifiable data visualizations with D3.js (v6).

    1.8k GitHub stars~1.5k tokensUpdated 2 mo ago
    Auto-check passed
  • Dc Power Flow

    benchflow-ai/skillsbench

    DC power flow analysis for power systems. An agent skill from benchflow-ai/skillsbench.

    1.8k GitHub stars~717 tokensUpdated 2 mo ago
    Auto-check passed

Works with

Questions about Gamma Phase Associator

What does Gamma Phase Associator do?

An overview of the python package for running the GaMMA earthquake phase association algorithm. Gamma Phase Associator is an agent skill from benchflow-ai/skillsbench. An overview of the python package for running the GaMMA earthquake phase association algorithm.

When should I use Gamma Phase Associator?

Gamma Phase Associator fits situations like: tasks that involve DataFrames.

How do I install Gamma Phase Associator in Claude Code?

Run `npx skills add benchflow-ai/skillsbench --skill gamma-phase-associator -a claude-code`. Or copy the skill folder (tasks/earthquake-phase-association/environment/skills/gamma-phase-associator in benchflow-ai/skillsbench) into .claude/skills/gamma-phase-associator in your project. Claude Code loads it when a task matches its description.

How do I install Gamma Phase Associator in Codex?

Run `npx skills add benchflow-ai/skillsbench --skill gamma-phase-associator -a codex`. Or copy the skill folder (tasks/earthquake-phase-association/environment/skills/gamma-phase-associator in benchflow-ai/skillsbench) into .agents/skills/gamma-phase-associator in your project. Codex loads it when a task matches its description.

Can I use Gamma Phase Associator in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add benchflow-ai/skillsbench --skill gamma-phase-associator -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/gamma-phase-associator, .gemini/skills/gamma-phase-associator, .github/skills/gamma-phase-associator and .opencode/skills/gamma-phase-associator in your project.

What does Gamma Phase Associator need to run?

Going by SKILL.md and its folder, Gamma Phase Associator needs the command-line tools its instructions call (pip). Our summary lists: Python 3.

Does Gamma Phase Associator access the network?

SKILL.md names 1 domain. In commands or code: github.com; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is Gamma Phase Associator safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Gamma Phase Associator use?

Gamma Phase Associator is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Gamma Phase Associator use?

About 2.5k tokens (SKILL.md is roughly 10k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Gamma Phase Associator?

Skills that share tags, products or a category with Gamma Phase Associator: Chdb Datastore (vemetric/vemetric, 395 stars), Polar Python SDK (polarsource/polar, 10k stars), CSV Data Summarizer (coffeefuelbump/csv-data-summarizer-claude-skill, 468 stars) and Pandas Pro (Jeffallan/claude-skills, 12k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Gamma Phase Associator?

benchflow-ai (a GitHub organization) maintains it in benchflow-ai/skillsbench, which has 1,835 GitHub stars. The repository holds 189 skills in this directory. The repository was last updated on July 23, 2026.

Source: benchflow-ai/skillsbench on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.