Stream.trigger(type, **options)[source]

Run a triggering algorithm on all traces in the stream.

  • 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) Arguments sta and lta (seconds) will be mapped to nsta and nlta (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)


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 in stats.processing of every trace.

Supported Trigger


Computes the classic STA/LTA characteristic function (uses obspy.signal.trigger.classic_sta_lta()).


Recursive STA/LTA (uses obspy.signal.trigger.recursive_sta_lta()).


Recursive STA/LTA written in Python (uses obspy.signal.trigger.recursive_sta_lta_py()).


Delayed STA/LTA. (uses obspy.signal.trigger.delayed_sta_lta()).


Computes the carl_sta_trig characteristic function (uses obspy.signal.trigger.carl_sta_trig()).


Z-detector (uses obspy.signal.trigger.z_detect()).


>>> 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()  

(Source code)