Timing of stream slice/trim

Hi all,

I'm triming/slicing a stream, but the resulting stream does not start at the exact time as it should. According to the online documentation (https://docs.obspy.org/packages/autogen/obspy.core.stream.Stream.slice.html#obspy.core.stream.Stream.slice)
it should cut at exact times.

For me, there's a second delay:

In [52]: dt = UTCDateTime("2017-01-26T17:14:00.0000")

In [53]: st.slice(dt, dt + 10)
Out[53]:
1 Trace(s) in Stream:
.SEO2..stream10000 | 2017-01-26T17:13:59.000000Z - 2017-01-26T17:14:09.000000Z | 1000.0 Hz, 10001 samples

Is that a bug or a problem with my data packaging? The stream was read from Reftek 130 raw files.

Cheers
Tanja

Hi Tanja,

I can't reproduce this behavior:

In [1]: st = read()

In [2]: st
Out[2]:
3 Trace(s) in Stream:
BW.RJOB..EHZ | 2009-08-24T00:20:03.000000Z - 2009-08-24T00:20:32.990000Z

100.0 Hz, 3000 samples

BW.RJOB..EHN | 2009-08-24T00:20:03.000000Z - 2009-08-24T00:20:32.990000Z

100.0 Hz, 3000 samples

BW.RJOB..EHE | 2009-08-24T00:20:03.000000Z - 2009-08-24T00:20:32.990000Z

100.0 Hz, 3000 samples

In [3]: t = UTCDateTime('2009-08-24T00:20:06.410Z')

In [4]: st.trim(t, t+10)
Out[4]:
3 Trace(s) in Stream:
BW.RJOB..EHZ | 2009-08-24T00:20:06.410000Z - 2009-08-24T00:20:16.410000Z

100.0 Hz, 1001 samples

BW.RJOB..EHN | 2009-08-24T00:20:06.410000Z - 2009-08-24T00:20:16.410000Z

100.0 Hz, 1001 samples

BW.RJOB..EHE | 2009-08-24T00:20:06.410000Z - 2009-08-24T00:20:16.410000Z

100.0 Hz, 1001 samples

Can you please provide a self-contained example, including data to
reproduce (short data file please).

cheers,
T