save all waveform segments

Hi All,

I'm trying to download waveforms of 1 station.
in the time window I am interested, there are ~8 segments if I download waveforms from SOD.

but if I use obspy, I only can get 1 trace.

#!/usr/bin/env python
from obspy.iris import Client
from obspy import UTCDateTime
client = Client()

EQt = UTCDateTime("2011-03-11T05:46:24.120")
st = client.getWaveform("GE", "EIL", "", "BHZ", EQt - 2*60*60, EQt + 24*60*60)
print(st)

I can only get 1 trace in Stream.

is there any way I can get all waveform segments?

thank you.

Cheers,
Patty

Hi Patty,

in your code you request 1 specific channel from the station ( see http://www.iris.edu/mda/GE/EIL ).
Why would you expect to get 8 traces? If you are interested in all possible channels simply exchange ‘BHZ’ with ‘???’.

Cheers,
Martin

Hi Martin and obspy-users,

yes… I only request for 1 channel.
sometimes, the waveform data is not completed and has some gap.
usually several waveform segment files are retrieved from IRIS sever.
however, using obspy getwaveform commend, I only can get 1 trace.

So I’m wondering whether there is a way I can get all waveform segments.

Thank you.

Cheers,
Patty

Hi,

I've looked at this and isolated the problem. I've opened an issue for
it, you can follow it here: https://github.com/obspy/obspy/issues/623

best,
Tobias

This was fixed in master. If you want to avoid having to update your
installation a possible solution is to use "dataselect" directly instead
of "getWaveform" for single channel requests with obspy.iris:

st = client.dataselect("GE", "EIL", "", "BHZ", t - 5*60*60, t + 24*60*60)

or using "availibility" in connection with "bulkdataselect(...,
longestonly=False)" for requests containing wildcards.

best,
Tobias

Hi Tobias,

thank you so much. yes... it does work..

and the "client.availability" is important.. I can check the data availability before i use "dataselect".

Again, thank you so muck for your kindly help.

Cheers,
Patty