seisgo.utils
The utils module provides a broad collection of signal processing, coordinate
transformation, SNR estimation, and I/O utility functions used throughout SeisGo.
Function Summary
Signal processing
Coordinate utilities
Key Functions
rms
from seisgo import utils
noise_rms = utils.rms(noise_trace) # √(mean(d²))
get_snr
Compute the signal-to-noise ratio using physics-based signal and noise windows:
Parameter |
Default |
Description |
|---|---|---|
|
required |
1-D or 2-D data array. |
|
required |
Time vector (s). |
|
required |
Source–receiver distance (km). |
|
required |
Velocity range defining the signal window. |
|
|
Extend the signal window by this many seconds. |
|
|
Gap (s) between the signal and noise windows. |
|
|
Trace axis for 2-D arrays. |
|
|
Return SNR in decibels. |
|
|
Also return the window index arrays. |
|
|
|
|
|
Allow noise window to be shorter than signal window if needed. |
snr = utils.get_snr(corrdata.data, t, dist=50.0, vmin=1.5, vmax=4.5)
# snr[i] = [snr_negative, snr_positive] for each trace i
ricker and gaussian
Generate standard source wavelets:
t_r, w_r = utils.ricker(dt=0.001, f=30, t0=0.05)
t_g, w_g = utils.gaussian(dt=0.001, width=0.02, shift=0.05)
The Gaussian wavelet follows the FWANT convention:
where a is the width parameter (σ) and t₀ is the time shift.
cart2compass
Convert Cartesian slowness components to compass bearing and slowness magnitude:
bearing_deg, slowness = utils.cart2compass(Ux, Uy)
box_smooth
Apply a simple box-car (moving-average) smoother to a 1-D array:
smoothed = utils.box_smooth(distortion_curve, n=3)