Beispiel #1
0
 def test_copy(self):
     """
     Testing copy of RtTrace object.
     """
     rtr = RtTrace()
     rtr.copy()
     # register predefined function
     rtr.registerRtProcess('integrate', test=1, muh='maeh')
     rtr.copy()
     # register ObsPy function call
     rtr.registerRtProcess(filter.bandpass, freqmin=0, freqmax=1, df=0.1)
     rtr.copy()
     # register NumPy function call
     rtr.registerRtProcess(np.square)
     rtr.copy()
Beispiel #2
0
 def test_copy(self):
     """
     Testing copy of RtTrace object.
     """
     rtr = RtTrace()
     rtr.copy()
     # register predefined function
     rtr.registerRtProcess('integrate', test=1, muh='maeh')
     rtr.copy()
     # register ObsPy function call
     rtr.registerRtProcess(filter.bandpass, freqmin=0, freqmax=1, df=0.1)
     rtr.copy()
     # register NumPy function call
     rtr.registerRtProcess(np.square)
     rtr.copy()
    def test_rt_kurtosis_dec(self):

        win = 5.0

        data_trace = self.data_trace_filt.copy()
        data_trace_dec = self.data_trace_filt.copy()
        # no need to filter as we're using a pre-filtered trace
        data_trace_dec.decimate(5, no_filter=True)

        rt_trace = RtTrace()
        rt_dec = RtTrace()
        rt_trace.registerRtProcess('kurtosis', win=win)
        rt_dec.registerRtProcess('kurtosis', win=win)

        rt_trace.append(data_trace, gap_overlap_check=True)
        rt_dec.append(data_trace_dec, gap_overlap_check=True)

        newtr = rt_trace.copy()
        newtr.decimate(5, no_filter=True)

        #assert_array_almost_equal(rt_dec.data, newtr.data, 0)
        diff = (np.max(rt_dec.data) - np.max(newtr.data)) / np.max(rt_dec.data)
        self.assertAlmostEquals(np.abs(diff), 0.0, 2)
Beispiel #4
0
    def test_rt_kurtosis_dec(self):

        win=5.0

        data_trace=self.data_trace_filt.copy()
        data_trace_dec=self.data_trace_filt.copy()
        # no need to filter as we're using a pre-filtered trace
        data_trace_dec.decimate(5,no_filter=True)


        rt_trace=RtTrace()
        rt_dec=RtTrace()
        rt_trace.registerRtProcess('kurtosis',win=win)
        rt_dec.registerRtProcess('kurtosis',win=win)

        rt_trace.append(data_trace, gap_overlap_check = True)
        rt_dec.append(data_trace_dec, gap_overlap_check = True)

        newtr=rt_trace.copy()
        newtr.decimate(5, no_filter=True)

        #assert_array_almost_equal(rt_dec.data, newtr.data, 0)
        diff=(np.max(rt_dec.data)-np.max(newtr.data)) / np.max(rt_dec.data)
        self.assertAlmostEquals(np.abs(diff) , 0.0, 2)