Package to analyze seismic data based on obspy and spicypy packages.
Project description
GraviLab
Package to analyze seismic data based on obspy and spicypy packages.
Installation
git clone https://git.physnet.uni-hamburg.de/gwd/gravilab.git
cd gravilab
pip install .
Usage
The main element of the package is Seismometer
class, which represents a seismic instrument.
It can be created by loading seismic data with open
function and specifying channels,
both their names in the file and "human-readable" names. The folder is then scanned for any suitable data
and only those channels are loaded. All functionality related to seismic time series data is
provided by the underlying obspy package (specifically obspy.Trace
).
Seismometer
class also supports calculating spectrum
(Seismometer.asd()
, Seismometer.psd()
) using spicypy package.
Spectrum can be adjusted by the response of specific instrument specified by pole-zero model,
and units can be converted between displacement, velocity
and acceleration by specifying the omega
factor. Resulting spectrum is spicypy.FrequencySeries
. Additionally,
time series can also be converted to spicypy.TimeSeries
to profit from its rich signal processing functionality.
Minimal example:
import gravilab as gl
Seismometer1 = gl.open("seismic", channels = {"vertical":"HNZ","north":"HNY","east":"HNX"}, name="seismometer1")
Seismometer1.time_series["north"].plot()
response = {"poles" : [-0.036614 +0.037059j, -0.036614 -0.037059j, -32.55, -142, -364 +404j, -364 -404j, -1260, -4900 +5200j, -4900 -5200j, -7100 +1700j, -7100 -1700j],
"zeros" : [0, 0, -31.63, -160, -350, -3177],
"scale_factor" : 1202.5 * 8.31871e17 * 400000, #V/(m/s) times gain times counts/V
"omega_exponent": -1, #convert from m/s to m
}
Seismometer1.response = response
Seismometer1.asd()["north"].plot()
More detailed usage examples are provided in gravilab/examples folder.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.