Ejemplo n.º 1
0
 def test_integrate(self):
     """
     Testing integrate function.
     """
     trace = self.orig_trace.copy()
     # filtering manual
     self.filt_trace_data = signal.integrate(trace)
     # filtering real time
     process_list = [('integrate', {})]
     self._run_rt_process(process_list)
     # check results
     np.testing.assert_almost_equal(self.filt_trace_data,
                                    self.rt_trace.data)
Ejemplo n.º 2
0
 def test_integrate(self):
     """
     Testing integrate function.
     """
     trace = self.orig_trace.copy()
     # filtering manual
     self.filt_trace_data = signal.integrate(trace)
     # filtering real time
     process_list = [('integrate', {})]
     self._runRtProcess(process_list)
     # check results
     np.testing.assert_almost_equal(self.filt_trace_data,
                                    self.rt_trace.data)
Ejemplo n.º 3
0
 def test_combined(self):
     """
     Testing combining integrate and differentiate functions.
     """
     trace = self.orig_trace.copy()
     # filtering manual
     trace.data = signal.integrate(trace)
     self.filt_trace_data = signal.differentiate(trace)
     # filtering real time
     process_list = [('int', {}), ('diff', {})]
     self._run_rt_process(process_list)
     # check results
     trace = self.orig_trace.copy()
     np.testing.assert_almost_equal(self.filt_trace_data,
                                    self.rt_trace.data)
     np.testing.assert_almost_equal(trace.data[1:], self.rt_trace.data[1:])
     np.testing.assert_almost_equal(trace.data[1:],
                                    self.filt_trace_data[1:])
Ejemplo n.º 4
0
 def test_combined(self):
     """
     Testing combining integrate and differentiate functions.
     """
     trace = self.orig_trace.copy()
     # filtering manual
     trace.data = signal.integrate(trace)
     self.filt_trace_data = signal.differentiate(trace)
     # filtering real time
     process_list = [('int', {}), ('diff', {})]
     self._runRtProcess(process_list)
     # check results
     trace = self.orig_trace.copy()
     np.testing.assert_almost_equal(self.filt_trace_data,
                                    self.rt_trace.data)
     np.testing.assert_almost_equal(trace.data[1:], self.rt_trace.data[1:])
     np.testing.assert_almost_equal(trace.data[1:],
                                    self.filt_trace_data[1:])
Ejemplo n.º 5
0
 def test_mwp(self):
     """
     Testing Mwp calculation using two processing functions.
     """
     trace = self.orig_trace.copy()
     epicentral_distance = 30.0855
     options = {'mem_time': 240,
                'ref_time': trace.stats.starttime + 301.506,
                'max_time': 120,
                'gain': 1.610210e+09}
     # filtering manual
     trace.data = signal.integrate(trace)
     self.filt_trace_data = signal.mwpIntegral(trace, **options)
     # filtering real time
     process_list = [('integrate', {}), ('mwpIntegral', options)]
     self._runRtProcess(process_list)
     # check results
     peak = np.amax(np.abs(self.rt_trace.data))
     mwp = signal.calculateMwpMag(peak, epicentral_distance)
     self.assertAlmostEqual(mwp, 8.78902911791, 5)
     np.testing.assert_almost_equal(self.filt_trace_data,
                                    self.rt_trace.data)
Ejemplo n.º 6
0
 def test_mwp(self):
     """
     Testing Mwp calculation using two processing functions.
     """
     trace = self.orig_trace.copy()
     epicentral_distance = 30.0855
     options = {
         'mem_time': 240,
         'ref_time': trace.stats.starttime + 301.506,
         'max_time': 120,
         'gain': 1.610210e+09
     }
     # filtering manual
     trace.data = signal.integrate(trace)
     self.filt_trace_data = signal.mwpintegral(trace, **options)
     # filtering real time
     process_list = [('integrate', {}), ('mwpintegral', options)]
     self._run_rt_process(process_list)
     # check results
     peak = np.amax(np.abs(self.rt_trace.data))
     mwp = signal.calculate_mwp_mag(peak, epicentral_distance)
     self.assertAlmostEqual(mwp, 8.78902911791, 5)
     np.testing.assert_almost_equal(self.filt_trace_data,
                                    self.rt_trace.data)