Hello,
I am trying to download data using EIDA routing client. However, when I use the get_waveforms method within the client class, I get the following error:
"TypeError: prepare() got an unexpected keyword argument ‘timeout’ "
Here is the code I am trying:
import obspy
from obspy.clients.fdsn import RoutingClient
from obspy.core import UTCDateTime
client = RoutingClient("eida-routing", credentials={'EIDA_TOKEN': './eidatoken.pgp'},debug=True)
print(client)
st = client.get_waveforms(network='HL', station='ATH',location='',channel='HHZ', starttime=UTCDateTime('2010-03-13T23:02:11.200000Z'), endtime=UTCDateTime('2010-03-14T23:03:31.200000Z'))
Here is the error log:
<obspy.clients.fdsn.routing.eidaws_routing_client.EIDAWSRoutingClient object at 0x7fa7bc77c950>
TypeError Traceback (most recent call last)
/tmp/ipykernel_143278/1458356547.py in
11 UTCDateTime(‘2010-03-13T23:02:11.200000Z’)
12
—> 13 st = client.get_waveforms(network=‘HL’, station=‘ATH’,location=‘’,channel=‘HHZ’, starttime=UTCDateTime(‘2010-03-13T23:02:11.200000Z’), endtime=UTCDateTime(‘2010-03-14T23:03:31.200000Z’))
~/.conda/envs/p37/lib/python3.7/site-packages/decorator.py in fun(*args, **kw)
230 if not kwsyntax:
231 args, kw = fix(args, kw, sig)
→ 232 return caller(func, *(extras + args), **kw)
233 fun.name = func.name
234 fun.doc = func.doc
~/.conda/envs/p37/lib/python3.7/site-packages/obspy/clients/fdsn/routing/routing_client.py in _assert_filename_not_in_kwargs(f, *args, **kwargs)
76 if “filename” in kwargs:
77 raise ValueError(“The filename
argument is not supported”)
—> 78 return f(*args, **kwargs)
79
80
~/.conda/envs/p37/lib/python3.7/site-packages/decorator.py in fun(*args, **kw)
230 if not kwsyntax:
231 args, kw = fix(args, kw, sig)
→ 232 return caller(func, *(extras + args), **kw)
233 fun.name = func.name
234 fun.doc = func.doc
~/.conda/envs/p37/lib/python3.7/site-packages/obspy/clients/fdsn/routing/routing_client.py in _assert_attach_response_not_in_kwargs(f, *args, **kwargs)
83 if “attach_response” in kwargs:
84 raise ValueError(“The attach_response
argument is not supported”)
—> 85 return f(*args, **kwargs)
86
87
~/.conda/envs/p37/lib/python3.7/site-packages/obspy/clients/fdsn/routing/routing_client.py in get_waveforms(self, starttime, endtime, **kwargs)
332 bulk.append(“*”)
333 bulk.extend([starttime, endtime])
→ 334 return self.get_waveforms_bulk([bulk], **kwargs)
335
336 def get_service_version(self):
~/.conda/envs/p37/lib/python3.7/site-packages/decorator.py in fun(*args, **kw)
230 if not kwsyntax:
231 args, kw = fix(args, kw, sig)
→ 232 return caller(func, *(extras + args), **kw)
233 fun.name = func.name
234 fun.doc = func.doc
~/.conda/envs/p37/lib/python3.7/site-packages/obspy/clients/fdsn/routing/routing_client.py in _assert_filename_not_in_kwargs(f, *args, **kwargs)
76 if “filename” in kwargs:
77 raise ValueError(“The filename
argument is not supported”)
—> 78 return f(*args, **kwargs)
79
80
~/.conda/envs/p37/lib/python3.7/site-packages/decorator.py in fun(*args, **kw)
230 if not kwsyntax:
231 args, kw = fix(args, kw, sig)
→ 232 return caller(func, *(extras + args), **kw)
233 fun.name = func.name
234 fun.doc = func.doc
~/.conda/envs/p37/lib/python3.7/site-packages/obspy/clients/fdsn/routing/routing_client.py in _assert_attach_response_not_in_kwargs(f, *args, **kwargs)
83 if “attach_response” in kwargs:
84 raise ValueError(“The attach_response
argument is not supported”)
—> 85 return f(*args, **kwargs)
86
87
~/.conda/envs/p37/lib/python3.7/site-packages/obspy/clients/fdsn/routing/eidaws_routing_client.py in get_waveforms_bulk(self, bulk, **kwargs)
98 # channel level and text to keep it fast.
99 inv = self.get_stations_bulk(_b, format=“text”,
→ 100 level=“channel”, **kwargs)
101 for c in sorted(set(inv.get_contents()[“channels”])):
102 new_bulk.append(c.split(“.”))
~/.conda/envs/p37/lib/python3.7/site-packages/decorator.py in fun(*args, **kw)
230 if not kwsyntax:
231 args, kw = fix(args, kw, sig)
→ 232 return caller(func, *(extras + args), **kw)
233 fun.name = func.name
234 fun.doc = func.doc
~/.conda/envs/p37/lib/python3.7/site-packages/obspy/clients/fdsn/routing/routing_client.py in _assert_filename_not_in_kwargs(f, *args, **kwargs)
76 if “filename” in kwargs:
77 raise ValueError(“The filename
argument is not supported”)
—> 78 return f(*args, **kwargs)
79
80
~/.conda/envs/p37/lib/python3.7/site-packages/obspy/clients/fdsn/routing/eidaws_routing_client.py in get_stations_bulk(self, bulk, **kwargs)
174 bulk_str = get_bulk_string(bulk, arguments)
175 r = self._download(self._url + “/query”, data=bulk_str,
→ 176 content_type=‘text/plain’)
177 split = self._split_routing_response(
178 r.content.decode() if hasattr(r.content, “decode”) else r.content)
~/.conda/envs/p37/lib/python3.7/site-packages/obspy/clients/base.py in _download(self, url, params, filename, data, content_type)
213 from requests import PreparedRequest # noqa
214 p = PreparedRequest()
→ 215 p.prepare(method=“GET”, **_request_args)
216 print(“Downloading %s …” % p.url)
217 if data is not None:
TypeError: prepare() got an unexpected keyword argument ‘timeout’
Please guide me how to fix this issue.
Thanks in advance