Beispiel #1
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)
Beispiel #2
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)