obspy.core.stream.Stream.clear

Stream.clear()[source]

Clear trace list (convenient method).

Replaces Stream’s trace list by an empty one creating an empty Stream object. Useful if there are references to the current Stream object that should not break. Otherwise simply use a new Stream() instance.

Example

>>> from obspy import read
>>> st = read()
>>> len(st)
3
>>> st.clear()
>>> st.traces
[]

This Page