Print gap/overlap list summary information of the Stream object.
Parameters: |
|
---|
Example
Our example stream has no gaps:
>>> from obspy import read, UTCDateTime
>>> st = read()
>>> st.getGaps()
[]
>>> st.printGaps()
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.getGaps()
[['BW', 'RJOB', '', 'EHZ', UTCDateTime(2009, 8, 24, 0, 20, 13), ...
>>> st.printGaps()
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.getGaps()
[['BW', 'RJOB', '', 'EHZ', UTCDateTime(2009, 8, 24, 0, 20, 13), ...
>>> st.printGaps()
Source Last Sample ...
BW.RJOB..EHZ 2009-08-24T00:20:13.000000Z ...
Total: 0 gap(s) and 1 overlap(s)