AmanSinghNp/fast-trigger: fast-trigger v0.1.0 - High-performance recursive STA/LTA seismic event detection in C++23 with Python bindings

Read full text
Authors: Aman
Cited by: 0

Abstract

fast-trigger High-performance recursive STA/LTA seismic event detection in C++23 with Python bindings (v0.1.0) What the tool is fast-trigger is a Python library for seismic event detection using the recursive Short-Term Average / Long-Term Average (STA/LTA) algorithm. STA/LTA is a standard method in seismology: it compares a short-term average of the signal (STA) to a long-term average (LTA) and produces a ratio that spikes when a transient (e.g. an earthquake onset) occurs. That ratio is commonly used as a detection statistic or to trigger recording/analysis. The library is aimed at speed and scalability. The core is implemented in C++23 and exposed to Python via nanobind. Batch processing of many traces uses OpenMP, so you can run STA/LTA over large arrays (e.g. many channels or long continuous data) efficiently. It is intended for research and processing workflows (seismology, geophysics, signal processing), not as a full-featured GUI or end-to-end earthquake catalog tool, it provides the STA/LTA computation that you can plug into your own pipelines. Technical summary: 1D and 2D NumPy arrays in, same-shaped arrays out; recursive STA/LTA with configurable window lengths; optional strict floating-point and sanitizer builds for development; supports Python 3.12+ and NumPy 2.x on Linux, macOS, and Windows. How to use it Install (PyPI or source): pip install fast-trigger Or from a local checkout: pip install . Single trace (1D): Pass a 1D NumPy array and choose STA and LTA window lengths (in samples). You get back a 1D array of the same length with the STA/LTA ratio at each sample. import numpy as np import fast_trigger # One trace: shape (n_samples,) data = np.random.randn(1000) sta_lta = fast_trigger.compute_sta_lta(data, sta_len=10, lta_len=100) # sta_lta.shape == data.shape Multiple traces (2D batch): Stack traces as rows (n_traces, n_samples) and call the batch function. Internally this uses OpenMP over traces. # Many traces: shape (n_traces, n_samples) batch = np.vstack([data, data * 0.5]) batch_sta_lta = fast_trigger.compute_sta_lta_batch(batch, sta_len=10, lta_len=100) # batch_sta_lta.shape == batch.shape Rules: sta_len and lta_len must be positive, and sta_len < lta_len. The library expects 1D for compute_sta_lta and 2D for compute_sta_lta_batch; invalid shapes or window lengths raise ValueError. Typical workflow: Load your seismic data (e.g. from ObsPy, SEG-Y, or other I/O), convert to float64 NumPy arrays, call compute_sta_lta or compute_sta_lta_batch with window lengths suited to your sampling rate and target phases, then use the output array for threshold-based triggering, plotting, or feeding into other detection/analysis code. Links Changelog Repository Issues

Fields of Study & Subjects

Seismology and Earthquake Studies Seismic Waves and Analysis Computational Physics and Python Applications

Publication details

Journal / source
Zenodo (CERN European Organization for Nuclear Research)
Publication date
17 February 2026
Language
EN