Beispiel #1
0
 def test_classicSTALTAPyC(self):
     """
     Test case for ctypes version of recursive_STALTA
     """
     nsta, nlta = 5, 10
     c1 = classic_STALTA(self.data, nsta, nlta)
     c2 = classic_STALTA_py(self.data, nsta, nlta)
     self.assertTrue(np.allclose(c1, c2, rtol=1e-10))
     ref = np.array([0.38012302, 0.37704431, 0.47674533, 0.67992292])
     self.assertTrue(np.allclose(ref, c2[99:103]))
import obspy
from obspy.signal.trigger import classic_STALTA, plot_trigger


trace = obspy.read("http://examples.obspy.org/ev0_6.a01.gse2")[0]
df = trace.stats.sampling_rate

cft = classic_STALTA(trace.data, int(5.0 * df), int(10.0 * df))
plot_trigger(trace, cft, 1.5, 0.5)
import obspy
from obspy.signal.trigger import classic_STALTA, plot_trigger

trace = obspy.read("http://examples.obspy.org/ev0_6.a01.gse2")[0]
df = trace.stats.sampling_rate

cft = classic_STALTA(trace.data, int(5. * df), int(10. * df))
plot_trigger(trace, cft, 1.5, 0.5)