Exemple #1
0
 def test_get_spoint(self):
     stime = UTCDateTime(1970, 1, 1, 0, 0)
     etime = UTCDateTime(1970, 1, 1, 0, 0) + 10
     data = np.empty(20)
     # sampling rate defaults to 1 Hz
     st = Stream([
         Trace(data, {'starttime': stime - 1}),
         Trace(data, {'starttime': stime - 4}),
         Trace(data, {'starttime': stime - 2}),
     ])
     spoint, epoint = get_spoint(st, stime, etime)
     self.assertTrue(np.allclose([1, 4, 2], spoint))
     self.assertTrue(np.allclose([8, 5, 7], epoint))
Exemple #2
0
 def test_get_spoint(self):
     stime = UTCDateTime(1970, 1, 1, 0, 0)
     etime = UTCDateTime(1970, 1, 1, 0, 0) + 10
     data = np.empty(20)
     # sampling rate defaults to 1 Hz
     st = Stream([
         Trace(data, {'starttime': stime - 1}),
         Trace(data, {'starttime': stime - 4}),
         Trace(data, {'starttime': stime - 2}),
     ])
     spoint, epoint = get_spoint(st, stime, etime)
     self.assertTrue(np.allclose([1, 4, 2], spoint))
     self.assertTrue(np.allclose([8, 5, 7], epoint))