Data not available to Download

Hi there,

I tried to download the data for an earthquake in NZ. But it always throws the following error. It worked fine a few months ago now the FDSN is not working. Could you please help me with that?

Error Trace:
Traceback (most recent call last):
File “/Users/chanthujan/PycharmProjects/RaspberryShake/earthquake_data_download_RPI.py”, line 41, in
c = Client(“RASPISHAKE”)
File “/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/obspy/clients/fdsn/client.py”, line 263, in init
self._discover_services()
File “/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/obspy/clients/fdsn/client.py”, line 1549, in _discover_services
raise FDSNException(msg)
obspy.clients.fdsn.header.FDSNException: No FDSN services could be discovered at ‘http://fdsnws.raspberryshakedata.com’. This could be due to a temporary service outage or an invalid FDSN service address.

Process finished with exit code 1

2 Likes

You need to change the server to:
https://data.raspberryshake.org/
It was changed without notice around 30 Jan.

1 Like

Thanks, that’s really helpful. Do you know where we should have been getting this information?

Hello all,

the applied solution is that the old URI returns a 301 (HTTP redirect, this remains en force) where the application would respond to this properly.

It was not anticipated that there would be applications that did not know how to gracefully make the switch as it was always the intent that when the old service is turned off, far into the future, there would be a formal announcement.

We apologize for the inconvenience caused and will, in the future, always announce any changes of this nature regardless of our thoughts on whether or not clients should understand how to handle HTML return codes or not.

For this specific case, and for the record, however, the current FDSNWS URI (https://data.raspberryshake.org/) will not ever change again, this was a one-time change that will no longer need to be considered.

Thank you very much for your understanding.

1 Like

Hi there,

Thanks for your reply. Still, I am not getting any data using the provided URL. It still throws the same error.
Could you please verify whether it is correct?

start_1 = “2022-09-22 09:07:00”
end = “2022-09-22 09:08:00”
starttime = UTCDateTime(start_1)
endtime = UTCDateTime(end)

c = Client(“https://data.raspberryshake.org/”)

for stn in our_stataion_list:
try:
#stn = “R9229”
st = c.get_waveforms(‘AM’, stn, ‘00’, ‘EN?’, starttime, endtime, attach_response=True)
#plot the tr data
st.plot()
plt.show()
except Exception as e:
print(“failed, for reason:\n{}”.format(e))
print(“failed station–” + str(stn))
continue

Trace log:
Traceback (most recent call last):
File “/Users/chanthujan/PycharmProjects/RaspberryShake/single_station_dwnld_RPI.py”, line 43, in
c = Client(“https://data.raspberryshake.org/”)
File “/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/obspy/clients/fdsn/client.py”, line 263, in init
self._discover_services()
File “/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/obspy/clients/fdsn/client.py”, line 1549, in _discover_services
raise FDSNException(msg)
obspy.clients.fdsn.header.FDSNException: No FDSN services could be discovered at ‘https://data.raspberryshake.org’. This could be due to a temporary service outage or an invalid FDSN service address.

Hello chanthuj,

I’ve tested the code you posted here:

start_1 = "2022-09-22 09:07:00"
end = "2022-09-22 09:08:00"
starttime = UTCDateTime(start_1)
endtime = UTCDateTime(end)

c = Client("https://data.raspberryshake.org/")

our_stataion_list = ['R9229']
for stn in our_stataion_list:
    try:
        #stn = “R9229”
        st = c.get_waveforms('AM', stn, '00', 'EN?', starttime, endtime, attach_response=True)
        #plot the tr data
        st.plot()
        plt.show()
    except Exception as e:
        print('failed, for reason:\n{}'.format(e))
        print('failed station–' + str(stn))
    continue

And it appears to work without issues, creating this plot for station R9229:

I would recommend restarting your Python kernel and clearing all your outputs before trying to run the code again. If that still doesn’t work, I would advise changing the c variable associated with the FDSN address with something else, for example:

client = Client(“https://data.raspberryshake.org”)
st = client.get_waveforms(‘AM’, stn, ‘00’, ‘EN?’, starttime, endtime, attach_response=True)

and see if this works.

Hi there,

Thanks for your prompt response. I tried many times with different IDE and versions of Python. Still, I am getting the same error. Please let me know the Python version you are using to run this. It would be great if you could share the complete code with the imports so I can also check it. Thanks in advance.

Hello chanthuj,

Here’s the complete code with the necessary imports:

from obspy import UTCDateTime
from obspy.clients.fdsn import Client

start_1 = "2022-09-22 09:07:00"
end = "2022-09-22 09:08:00"
starttime = UTCDateTime(start_1)
endtime = UTCDateTime(end)

c = Client("https://data.raspberryshake.org/")

our_stataion_list = ['R9229']
for stn in our_stataion_list:
    try:
        #stn = “R9229”
        st = c.get_waveforms('AM', stn, '00', 'EN?', starttime, endtime, attach_response=True)
        #plot the tr data
        st.plot()
        plt.show()
    except Exception as e:
        print('failed, for reason:\n{}'.format(e))
        print('failed station–' + str(stn))
    continue

In my environment, I am using:

Anaconda3 (with JupyterLab - operating on Windows 11)
Python 3.8.13
ObsPy 1.4.0

Thanks. It worked. The issue is with my Obspy and python versions.

Thanks for your prompt response

2 Likes

That’s great to hear!

No problem at all, you’re welcome chanthuj.

Hi Storm,

I have encountered the same issue of not being able to plot the data from the database for the same code with the same environmental settings. Did I make any mistakes again? or are there any changes in the Client?

from obspy import UTCDateTime
from obspy.clients.fdsn import Client

start_1 = “2022-09-22 09:07:00”
end = “2022-09-22 09:08:00”
starttime = UTCDateTime(start_1)
endtime = UTCDateTime(end)

c = Client(“https://data.raspberryshake.org/”)

our_stataion_list = [‘R9229’]
for stn in our_stataion_list:
try:
#stn = “R9229”
st = c.get_waveforms(‘AM’, stn, ‘00’, ‘EN?’, starttime, endtime, attach_response=True)
#plot the tr data
st.plot()
except Exception as e:
print(‘failed, for reason:\n{}’.format(e))
print(‘failed station–’ + str(stn))
continue

Error getting:

FDSNNoServiceException Traceback (most recent call last)
Cell In[2], line 12
9 starttime = UTCDateTime(start_1)
10 endtime = UTCDateTime(end)
—> 12 c = Client(“https://data.raspberryshake.org/”)
14 our_stataion_list = [‘R9229’]
15 for stn in our_stataion_list:

File ~/anaconda3/lib/python3.10/site-packages/obspy/clients/fdsn/client.py:277, in Client.init(self, base_url, major_versions, user, password, user_agent, debug, timeout, service_mappings, force_redirect, eida_token, _discover_services)
274 print(“Request Headers: %s” % str(self.request_headers))
276 if _discover_services:
→ 277 self._discover_services()
278 else:
279 self.services = DEFAULT_SERVICES

File ~/anaconda3/lib/python3.10/site-packages/obspy/clients/fdsn/client.py:1638, in Client._discover_services(self)
1633 raise FDSNRedirectException(", ".join(redirect_messages))
1635 msg = ("No FDSN services could be discovered at ‘%s’. This could "
1636 "be due to a temporary service outage or an invalid FDSN "
1637 “service address.” % self.base_url)
→ 1638 raise FDSNNoServiceException(msg)
1639 # Cache.
1640 if self.debug is True:

FDSNNoServiceException: No FDSN services could be discovered at ‘https://data.raspberryshake.org’. This could be due to a temporary service outage or an invalid FDSN service address.

I am getting the same error message for the Client, client = Client(‘RASPISHAKE’) as well.

I really appreciate any help you can provide.

2 Likes

G’Day Chanthuj,

Currently the FDSN server is unavailable. See here: Live Data Issues - #39 by Stormchaser

Al.

2 Likes

Thanks for the info @sheeny

1 Like