rsudp.c_alert (STA/LTA alarm)
- class rsudp.c_alert.Alert(q, sta=5, lta=30, thresh=1.6, duration=0.0, 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
alarmflag to the alarm time as aobspy.core.utcdatetime.UTCDateTimeobject. Thersudp.p_producer.Producerwill see this flag and send anALARMmessage to the queues with the time set here. Likewise, when thealarm_resetflag is set with aobspy.core.utcdatetime.UTCDateTime, the Producer will send aRESETmessage to the queues.- Parameters:
:param float duration : duration for STA/LTA trigger. :type bp:
boolorlist:param bp: bandpass filter parameters. if set, should be in the format[highpass, lowpass]:param bool debug: whether or not to display max STA/LTA calculation live to the console. :param str cha: listening channel (defaults to [S,E]HZ) :param queue.Queue q: queue of data and messages sent byrsudp.c_consumer.Consumer- run()
Reads data from the queue into a
obspy.core.stream.Streamobject, 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.