Hi All,
I have a question regarding the initialization of the FDSN Client (osbpy.fdsn.client).
Often when I initialize a new instance, I get an error message. Most of the time, however, I'm still able to use services. Sometimes, however, the services fail.
For instance, this worked despite an error opening the Client:
In [1]: from obspy.fdsn import Client
In [2]: from obspy import UTCDateTime
In [3]: client=Client("IRIS")
Exception in thread Thread-3:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/dist-packages/obspy/fdsn/client.py", line 1045, in run
debug=debug)
File "/usr/lib/python2.7/dist-packages/obspy/fdsn/client.py", line 1239, in download_url
timeout=timeout, data=data)
File "/usr/lib/python2.7/urllib2.py", line 127, in urlopen
return _opener.open(url, data, timeout)
File "/usr/lib/python2.7/urllib2.py", line 404, in open
response = self._open(req, data)
File "/usr/lib/python2.7/urllib2.py", line 422, in _open
'_open', req)
File "/usr/lib/python2.7/urllib2.py", line 382, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/urllib2.py", line 1214, in http_open
return self.do_open(httplib.HTTPConnection, req)
File "/usr/lib/python2.7/urllib2.py", line 1184, in do_open
raise URLError(err)
URLError: <urlopen error [Errno -2] Name or service not known>
In [4]: cat=client.get_events(starttime=UTCDateTime("2010-01-01"),endtime=UTCDateTime("2010-12-31"),minmagnitude=6.5)
In [5]: print len(cat)
60
In [6]: print cat[0]
Event: 2010-12-25T13:16:38.180000Z | -19.837, +167.938 | 7.3 MW
resource_id: ResourceIdentifier(id="smi:service.iris.edu/fdsnws/event/1/query?eventid=3207318")
event_type: 'earthquake'