Obspy server timeout "get.waveforms" from INGV #2845

In the hopes I was wondering if there is any possibility how to bypass this error.

In essence, I’ve got a catalog of ~90 events and I want to get the waveforms from each of it from a seismic station of the IVNG in Italy. I want to loop the get.waveforms to get al stream list in the end, but after random amounds of streams, I get a error messange that connection was bad or server did not respond. I also tried to raise the timeout time of the client, but it did not help, I guess it’s the time limit of the INGV server then.

The code I use:

st = []
d = 0
while d < len(cat):
      st.append(c.get_waveforms("IV", "PRMA", "*", "HH*", t[d] - 60, t[d] + 90*60))
      d = d + 1

The error line after random amound of downloaded waveforms:

obspy.clients.fdsn.header.FDSNException: Unknown Error (URLError): <urlopen error [WinError 10060] Ein Verbindungsversuch ist fehlgeschlagen, da die Gegenstelle nach einer bestimmten Zeitspanne nicht richtig reagiert hat, oder die hergestellte Verbindung war fehlerhaft, da der verbundene Host nicht reagiert hat

I updated obspy in Pycharm and using the latest version.

Is there a possibility to maybe write the streams st whenever the connection gets lost, and then continuing at that event of the catalog where connection was lost, dynamically? E.g., first attempt I got the first 10 event streams until the error → write to st1. Then start again but after the first 10 events → write the next few until the error…and so on…

Sorry for bothering you, I’m not very good in Python yet and thanks for any input.

You could keep track of how many events you’ve downloaded successfully… here is a very very simple way

st = obspy.Stream()
done = 0 #don't reset this
d = 0
while done <= d < len(cat):
      st.append(c.get_waveforms("IV", "PRMA", "*", "HH*", t[d] - 60, t[d] + 90*60))
      done += 1
      d += 1

As for why the timeouts are occurring, you may be asking for too much data too quickly, but it’s impossible to say. Does it timeout if you shorten it to a few min?

Thanks for the reply!
No matter how short on long I set the timeout, there are always the same events missing on one station, on ther stations the same but other events. I think it’s not a server problem, but there actually is no data available?

Yeah I suspect it’s probably just not there, data gaps are more of a rule than exception.

1 Like