obspy.core.stream.Stream.print_gaps¶
- Stream.print_gaps(min_gap=None, max_gap=None)[source]¶
Print gap/overlap list summary information of the Stream object.
Parameters: - min_gap All gaps smaller than this value will be omitted. The value is assumed to be in seconds. Defaults to None.
- max_gap All gaps larger than this value will be omitted. The value is assumed to be in seconds. Defaults to None.
Example
Our example stream has no gaps:
>>> from obspy import read, UTCDateTime >>> st = read() >>> st.get_gaps() [] >>> st.print_gaps() Source Last Sample Next Sample ... Total: 0 gap(s) and 0 overlap(s)
So let’s make a copy of the first trace and cut both so that we end up with a gappy stream:
>>> tr = st[0].copy() >>> t = UTCDateTime("2009-08-24T00:20:13.0") >>> st[0].trim(endtime=t) <...Trace object at 0x...> >>> tr.trim(starttime=t+1) <...Trace object at 0x...> >>> st.append(tr) <...Stream object at 0x...> >>> st.get_gaps() [[..., UTCDateTime(2009, 8, 24, 0, 20, 13), ... >>> st.print_gaps() Source Last Sample ... BW.RJOB..EHZ 2009-08-24T00:20:13.000000Z ... Total: 1 gap(s) and 0 overlap(s)
And finally let us create some overlapping traces:
>>> st = read() >>> tr = st[0].copy() >>> t = UTCDateTime("2009-08-24T00:20:13.0") >>> st[0].trim(endtime=t) <...Trace object at 0x...> >>> tr.trim(starttime=t-1) <...Trace object at 0x...> >>> st.append(tr) <...Stream object at 0x...> >>> st.get_gaps() [[...'EHZ', UTCDateTime(2009, 8, 24, 0, 20, 13), ... >>> st.print_gaps() Source Last Sample ... BW.RJOB..EHZ 2009-08-24T00:20:13.000000Z ... Total: 0 gap(s) and 1 overlap(s)