rsudp.c_alert (STA/LTA alarm)

class rsudp.c_alert.Alert(q, sta=5, lta=30, thresh=1.6, reset=1.55, bp=False, debug=True, cha='HZ', sound=False, deconv=False, *args, **kwargs)

A data consumer class that listens to a specific incoming data channel and calculates a recursive STA/LTA (short term average over long term average). If a threshold of STA/LTA ratio is exceeded, the class sets the alarm flag to the alarm time as a obspy.core.utcdatetime.UTCDateTime object. The rsudp.p_producer.Producer will see this flag and send an ALARM message to the queues with the time set here. Likewise, when the alarm_reset flag is set with a obspy.core.utcdatetime.UTCDateTime, the Producer will send a RESET message to the queues.

Parameters
  • sta (float) – short term average (STA) duration in seconds.

  • lta (float) – long term average (LTA) duration in seconds.

  • thresh (float) – threshold for STA/LTA trigger.

  • bp (bool or list) – bandpass filter parameters. if set, should be in the format [highpass, lowpass]

  • debug (bool) – whether or not to display max STA/LTA calculation live to the console.

  • cha (str) – listening channel (defaults to [S,E]HZ)

  • q (queue.Queue) – queue of data and messages sent by rsudp.c_consumer.Consumer

run()

Reads data from the queue into a obspy.core.stream.Stream object, then runs a obspy.signal.trigger.recursive_sta_lta() function to determine whether to raise an alert flag (rsudp.c_alert.Alert.alarm). The producer reads this flag and uses it to notify other consumers.


Back to top ↑