I noticed that trace.trim(start, end) does not seem to care if the start/end is
outside of the header bounds. i.e., if I request a start time before the
data start, it won't complain but will change the header start time to whatever
I requested.

This results in header start/end times that don't match the number of
data samples.

Is this the desired behavior ?


-Mike Hagerty

Hi Mike,

I can't reproduce your problem. Trace.trim() should only extend the time
range if you use "pad=True". Can you provide a self-contained example,
preferably based on the example stream ("st = read()")? Also.. what
ObsPy version are you on?


Oops! I was wrong about that.
I was handing trace.trim() start/end times out of range and it
wasn't complaining but it also wasn't updating the trace.stats.start/endtimes
like I thought.

So .. no problem there.

I want to thank you guys for developing obspy.
When your obspy article came out in 2010 I was busy programming in java and
didn't see what all the python fuss was about.

But obspy has allowed me to hook into all of my old c routines without
having to handle all the different data formats (sac, mseed, web services)
myself. Plus it has built in plotting. It's really sped up my development