obspy.core.stream.Stream.cutout

Stream.cutout(starttime, endtime)[source]

Cut the given time range out of all traces of this Stream object.

Parameters:
  • starttime (UTCDateTime) – Start of time span to remove from stream.

  • endtime (UTCDateTime) – End of time span to remove from stream.

Example

>>> st = read()
>>> print(st)  
3 Trace(s) in Stream:
BW.RJOB..EHZ | 2009-08-24T00:20:03.000000Z ... | 100.0 Hz, 3000 samples
BW.RJOB..EHN | 2009-08-24T00:20:03.000000Z ... | 100.0 Hz, 3000 samples
BW.RJOB..EHE | 2009-08-24T00:20:03.000000Z ... | 100.0 Hz, 3000 samples
>>> t1 = UTCDateTime("2009-08-24T00:20:06")
>>> t2 = UTCDateTime("2009-08-24T00:20:11")
>>> st.cutout(t1, t2)  
<...Stream object at 0x...>
>>> print(st)  
6 Trace(s) in Stream:
BW.RJOB..EHZ | 2009-08-24T00:20:03.000000Z ... | 100.0 Hz, 301 samples
BW.RJOB..EHN | 2009-08-24T00:20:03.000000Z ... | 100.0 Hz, 301 samples
BW.RJOB..EHE | 2009-08-24T00:20:03.000000Z ... | 100.0 Hz, 301 samples
BW.RJOB..EHZ | 2009-08-24T00:20:11.000000Z ... | 100.0 Hz, 2200 samples
BW.RJOB..EHN | 2009-08-24T00:20:11.000000Z ... | 100.0 Hz, 2200 samples
BW.RJOB..EHE | 2009-08-24T00:20:11.000000Z ... | 100.0 Hz, 2200 samples