RtTrace.trigger(type, **options)

Run a triggering algorithm on the data of the current trace.

  • 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 trace object. This also makes an entry with information on the applied processing in stats.processing of this 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()
>>> tr = st[0]
>>> tr.filter("highpass", freq=1.0)  
<...Trace object at 0x...>
>>> tr.plot()  
>>> tr.trigger("recstalta", sta=1, lta=4)  
<...Trace object at 0x...>
>>> tr.plot()  

(Source code, png, hires.png)