def test_make_trace(self): """ Test if the ten first samples of the waveform are read correctly and if the output is a Trace object. """ with open(THREE_CHAN_FCNT, 'rb') as fi: trace_3 = rc._make_trace(fi, 288, False, False, False) trace_z = rc._make_trace(fi, 241648, False, True, False) expected = np.array([-0.18864873, -0.30852857, -0.35189095, -0.22547323, -0.12023376, -0.14336781, -0.11712314, 0.04060567, 0.18024819, 0.17769636]) all_close = np.allclose(trace_3.data[:len(expected)], expected) self.assertTrue(all_close) self.assertIsInstance(trace_3, obspy.core.trace.Trace) expected = np.array([-0.673309, -0.71590775, -0.54966664, -0.33980238, -0.29999766, -0.3031269, -0.12762846, 0.08782373, 0.11377038, 0.09888785]) all_close = np.allclose(trace_z.data[:len(expected)], expected) self.assertTrue(all_close)
def test_make_trace(self): """ Test if the ten first samples of the waveform are read correctly and if the output is a Trace object. """ with open(THREE_CHAN_FCNT, 'rb') as fi: trace_3 = rc._make_trace(fi, 288, False, False, False) trace_z = rc._make_trace(fi, 241648, False, True, False) expected = np.array([ -0.18864873, -0.30852857, -0.35189095, -0.22547323, -0.12023376, -0.14336781, -0.11712314, 0.04060567, 0.18024819, 0.17769636 ]) all_close = np.allclose(trace_3.data[:len(expected)], expected) self.assertTrue(all_close) self.assertIsInstance(trace_3, obspy.core.trace.Trace) expected = np.array([ -0.673309, -0.71590775, -0.54966664, -0.33980238, -0.29999766, -0.3031269, -0.12762846, 0.08782373, 0.11377038, 0.09888785 ]) all_close = np.allclose(trace_z.data[:len(expected)], expected) self.assertTrue(all_close)