5.2.6.1.1. eqcorrscan.utils.despike.median_filter¶
- eqcorrscan.utils.despike.median_filter(tr, multiplier=10, windowlength=0.5, interp_len=0.05)[source]¶
Filter out spikes in data above a multiple of MAD of the data.
Currently only has the ability to replaces spikes with linear interpolation. In the future we would aim to fill the gap with something more appropriate. Works in-place on data.
- Parameters:
tr (obspy.core.trace.Trace) – trace to despike
multiplier (float) – median absolute deviation multiplier to find spikes above.
windowlength (float) – Length of window to look for spikes in in seconds.
interp_len (float) – Length in seconds to interpolate around spikes.
- Returns:
Warning
Not particularly effective, and may remove earthquake signals, use with caution.