obspy.core.stream.Stream._cleanup

Stream._cleanup()[source]

Merge consistent trace objects but leave everything else alone.

This can mean traces with matching header that are directly adjacent or are contained/equal/overlapping traces with exactly the same waveform data in the overlapping part.

Notes

Traces with overlapping data parts that do not match are not merged:

before:
Trace 1: AAAAAAAA
Trace 2:     BBBBBBBB

after:
Trace 1: AAAAAAAA
Trace 2:     BBBBBBBB

Traces with overlapping data parts that do match are merged:

before:
Trace 1: AAAAAAAA
Trace 2:     AAAABBBB

after:
Trace 1: AAAAAAAABBBB

Contained traces are handled the same way. If common data does not match, nothing is done:

before:
Trace 1: AAAAAAAAAAAA
Trace 2:     BBBB

after:
Trace 1: AAAAAAAAAAAA
Trace 2:     BBBB

If the common data part matches they are merged:

before:
Trace 1: AAAAAAAAAAAA
Trace 2:     AAAA

after:
Trace 1: AAAAAAAAAAAA

Directly adjacent traces are merged:

before:
Trace 1: AAAAAAA
Trace 2:        BBBBB

after:
Trace 1: AAAAAAABBBBB

This Page