Gaps in MiniSeed files

Dear all;

Does anybody knows how to extract a whole miniseed record when there are time gaps in the file ? I use read from the Obspy.core and I am trying to read a day worth of data that has a few gaps inside, sometime there are long gaps (a few minutes) some times is just a sample or two, but when I read the file, I get a record that ends at the gap.
The trim routine has a fill_value to fill gaps, but I don’t see this option in the read.
If anybody has a way around this problem, I would really appreciate a hint.

Thank you, regards;

Javier Francisco Pacheco [02.05.2013 20:36]:

  Does anybody knows how to extract a whole miniseed record when there are time gaps in the file ? I use read from the Obspy.core and I am trying to read a day worth of data that has a few gaps inside, sometime there are long gaps (a few minutes) some times is just a sample or two, but when I read the file, I get a record that ends at the gap.

If your data are gappy read() will return more than one Trace object within a Stream, each containing a contiguous data segment. Try out something like this:

import obspy.core
trc=obspy.core.read("data.mseed")
len(trc)

7

In this case there were 7 contiguous segments separated by gaps. From here on, all depends on how your application shall/can deal with the gaps.

In the easiest case you can just search for the segment containing the (ideally complete) data time window of interest. However, if you are unlucky, the time window of interest is disrupted by gaps and is spread over several segments. In that case the further processing obviously becomes difficult and also very application specific, depending on the size of the gap(s), how to deal with them etc.

Saludos
Joachim