obspy.core.stream.Stream.trigger
- Stream.trigger(type, **options)[source]
Run a triggering algorithm on all traces in the stream.
- Parameters:
type – String that specifies which trigger is applied (e.g.
'recstalta'
). See the Supported Trigger section below for further details.options – Necessary keyword arguments for the respective trigger that will be passed on. (e.g.
sta=3
,lta=10
) Argumentssta
andlta
(seconds) will be mapped tonsta
andnlta
(samples) by multiplying with sampling rate of trace. (e.g.sta=3
,lta=10
would call the trigger with 3 and 10 seconds average, respectively)
Note
This operation is performed in place on the actual data arrays. The raw data is not accessible anymore afterwards. To keep your original data, use
copy()
to create a copy of your stream object. This also makes an entry with information on the applied processing instats.processing
of every trace.Supported Trigger
'classicstalta'
Computes the classic STA/LTA characteristic function (uses
obspy.signal.trigger.classic_sta_lta()
).'recstalta'
Recursive STA/LTA (uses
obspy.signal.trigger.recursive_sta_lta()
).'recstaltapy'
Recursive STA/LTA written in Python (uses
obspy.signal.trigger.recursive_sta_lta_py()
).'delayedstalta'
Delayed STA/LTA. (uses
obspy.signal.trigger.delayed_sta_lta()
).'carlstatrig'
Computes the carl_sta_trig characteristic function (uses
obspy.signal.trigger.carl_sta_trig()
).'zdetect'
Z-detector (uses
obspy.signal.trigger.z_detect()
).
Example
>>> from obspy import read >>> st = read() >>> st.filter("highpass", freq=1.0) <...Stream object at 0x...> >>> st.plot() >>> st.trigger('recstalta', sta=1, lta=4) <...Stream object at 0x...> >>> st.plot()