stream.read

Hi

Will stream.read() return blocked data as is in file or will the
stream.Stream._cleanup method (or similar) automatically be invoked?

My user case is that I have input files (mseed) that may contain
overlapping data blocks with identical data within the the overlaps and
would like to know if I explicitly should use the
stream.merge(method=-1) to remove these or if it is already taken care
of under the hood.

Thanks \p

Hi Peter,

`obspy.read()` will return whatever is found in the file. For miniSEED
it will merge adjacent miniSEED records if the samples match up within a
certain tolerance, otherwise it will split them and put them into
separate `obspy.Trace` objects. So you'll have to call the merging
method manually.

All the best,

Lion

Internal reading codes might behave a bit differently regarding this
aspect though, some file format plugins call a cleanup merge internally
already.

T

So I should have to look in the code (libmseed I guess) if the mseed
reader does a cleanup merge.

Personally I'd find it to be nice if the obspy.read() had an argument
cleanup that could be used to control whether or not a cleanup were
performed (In most cases a cleanup merge would be the desirable thing to
do but it may be handy to also be able to get the data as is in file,
e.g. I've used this to once to track down a bug in a software that
occasionally wrote the same data multiple times to the same file).

best \p

I wholeheartedly agree. Although, reality is that io reader plugins
come from dozens of different people, so it is a time sink to look at
the codes and make sure this is handled consistently. Any help
appreciated.

T