obspy-data-api
Python-based processing and parsing of seismological data formats using ObsPy.
Install
mkdir -p .claude/skills/obspy-data-api && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/5817" && unzip -o skill.zip -d .claude/skills/obspy-data-api && rm skill.zipInstalls to .claude/skills/obspy-data-api
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
An overview of the core data API of ObsPy, a Python framework for processing seismological data. It is useful for parsing common seismological file formats, or manipulating custom data into standard objects for downstream use cases such as ObsPy's signal processing routines or SeisBench's modeling API.Key capabilities
- →Parse seismological file formats
- →Manipulate waveform data
- →Handle event metadata
- →Manage station inventory hierarchy
- →Apply signal processing routines
How it works
It provides an interface to the ObsPy framework, mapping file data into standardized Stream, Trace, and Inventory objects for analysis.
Inputs & outputs
When to use obspy-data-api
- →Parse seismic data files
- →Manipulate seismological data
- →Process waveform data
About this skill
ObsPy Data API
Waveform Data
Summary
Seismograms of various formats (e.g. SAC, MiniSEED, GSE2, SEISAN, Q, etc.) can be imported into a Stream object using the read() function.
Streams are list-like objects which contain multiple Trace objects, i.e. gap-less continuous time series and related header/meta information.
Each Trace object has the attribute data pointing to a NumPy ndarray of the actual time series and the attribute stats which contains all meta information in a dict-like Stats object. Both attributes starttime and endtime of the Stats object are UTCDateTime objects.
A multitude of helper methods are attached to Stream and Trace objects for handling and modifying the waveform data.
Stream and Trace Class Structure
Hierarchy: Stream → Trace (multiple)
Trace - DATA:
data→ NumPy arraystats:network,station,location,channel— Determine physical location and instrumentstarttime,sampling_rate,delta,endtime,npts— Interrelated
Trace - METHODS:
taper()— Tapers the data.filter()— Filters the data.resample()— Resamples the data in the frequency domain.integrate()— Integrates the data with respect to time.remove_response()— Deconvolves the instrument response.
Example
A Stream with an example seismogram can be created by calling read() without any arguments. Local files can be read by specifying the filename, files stored on http servers (e.g. at https://examples.obspy.org) can be read by specifying their URL.
>>> from obspy import read
>>> st = read()
>>> print(st)
3 Trace(s) in Stream:
BW.RJOB..EHZ | 2009-08-24T00:20:03.000000Z - ... | 100.0 Hz, 3000 samples
BW.RJOB..EHN | 2009-08-24T00:20:03.000000Z - ... | 100.0 Hz, 3000 samples
BW.RJOB..EHE | 2009-08-24T00:20:03.000000Z - ... | 100.0 Hz, 3000 samples
>>> tr = st[0]
>>> print(tr)
BW.RJOB..EHZ | 2009-08-24T00:20:03.000000Z - ... | 100.0 Hz, 3000 samples
>>> tr.data
array([ 0. , 0.00694644, 0.07597424, ..., 1.93449584,
0.98196204, 0.44196924])
>>> print(tr.stats)
network: BW
station: RJOB
location:
channel: EHZ
starttime: 2009-08-24T00:20:03.000000Z
endtime: 2009-08-24T00:20:32.990000Z
sampling_rate: 100.0
delta: 0.01
npts: 3000
calib: 1.0
...
>>> tr.stats.starttime
UTCDateTime(2009, 8, 24, 0, 20, 3)
Event Metadata
Event metadata are handled in a hierarchy of classes closely modelled after the de-facto standard format QuakeML. See read_events() and Catalog.write() for supported formats.
Event Class Structure
Hierarchy: Catalog → events → Event (multiple)
Event contains:
origins→Origin(multiple)latitude,longitude,depth,time, ...
magnitudes→Magnitude(multiple)mag,magnitude_type, ...
picksfocal_mechanisms
Station Metadata
Station metadata are handled in a hierarchy of classes closely modelled after the de-facto standard format FDSN StationXML which was developed as a human readable XML replacement for Dataless SEED. See read_inventory() and Inventory.write() for supported formats.
Inventory Class Structure
Hierarchy: Inventory → networks → Network → stations → Station → channels → Channel
Network:
code,description, ...
Station:
code,latitude,longitude,elevation,start_date,end_date, ...
Channel:
code,location_code,latitude,longitude,elevation,depth,dip,azimuth,sample_rate,start_date,end_date,response, ...
Classes & Functions
| Class/Function | Description |
|---|---|
read | Read waveform files into an ObsPy Stream object. |
Stream | List-like object of multiple ObsPy Trace objects. |
Trace | An object containing data of a continuous series, such as a seismic trace. |
Stats | A container for additional header information of an ObsPy Trace object. |
UTCDateTime | A UTC-based datetime object. |
read_events | Read event files into an ObsPy Catalog object. |
Catalog | Container for Event objects. |
Event | Describes a seismic event which does not necessarily need to be a tectonic earthquake. |
read_inventory | Function to read inventory files. |
Inventory | The root object of the Network → Station → Channel hierarchy. |
Modules
| Module | Description |
|---|---|
obspy.core.trace | Module for handling ObsPy Trace and Stats objects. |
obspy.core.stream | Module for handling ObsPy Stream objects. |
obspy.core.utcdatetime | Module containing a UTC-based datetime class. |
obspy.core.event | Module handling event metadata. |
obspy.core.inventory | Module for handling station metadata. |
obspy.core.util | Various utilities for ObsPy. |
obspy.core.preview | Tools for creating and merging previews. |
When not to use it
- →Non-seismological data processing
Prerequisites
Limitations
- →Limited to supported seismological formats
- →Requires understanding of ObsPy class hierarchy
How it compares
It abstracts complex seismological file formats into standard Python objects, simplifying downstream signal processing tasks.
Compared to similar skills
obspy-data-api side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| obspy-data-api (this skill) | 1 | 6mo | No flags | Intermediate |
| jupyter-notebook | 30 | 6mo | Review | Intermediate |
| source-coding | 1 | 7mo | Review | Advanced |
| biopython | 1 | 7mo | Review | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by benchflow-ai
View all by benchflow-ai →You might also like
jupyter-notebook
davila7
Use when the user asks to create, scaffold, or edit Jupyter notebooks (`.ipynb`) for experiments, explorations, or tutorials; prefer the bundled templates and run the helper script `new_notebook.py` to generate a clean starting notebook.
source-coding
parcadei
Problem-solving strategies for source coding in information theory
biopython
davila7
Primary Python toolkit for molecular biology. Preferred for Python-based PubMed/NCBI queries (Bio.Entrez), sequence manipulation, file parsing (FASTA, GenBank, FASTQ, PDB), advanced BLAST workflows, structures, phylogenetics. For quick BLAST, use gget. For direct REST API, use pubmed-database.
graph-algorithms
parcadei
Problem-solving strategies for graph algorithms in graph number theory
rlm
brainqub3
Run a Recursive Language Model-style loop for long-context tasks. Uses a persistent local Python REPL and an rlm-subcall subagent as the sub-LLM (llm_query).
tooluniverse-sdk
mims-harvard
Build AI scientist systems using ToolUniverse Python SDK for scientific research. Use when users need to access 1000++ scientific tools through Python code, create scientific workflows, perform drug discovery, protein analysis, genomics analysis, literature research, or any computational biology task. Triggers include requests to use scientific tools programmatically, build research pipelines, analyze biological data, search literature, predict drug properties, or create AI-powered scientific workflows.