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, testing=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 aobspy.core.utcdatetime.UTCDateTime
object. Thersudp.p_producer.Producer
will see this flag and send anALARM
message to the queues with the time set here. Likewise, when thealarm_reset
flag is set with aobspy.core.utcdatetime.UTCDateTime
, the Producer will send aRESET
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
orlist
) – 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 aobspy.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.