Trouble downloading RASPISHAKE data using MassDownloader

I am trying to download data from Raspishake, among other providers, using the MassDownloader. The MassDownloader doesn’t seem to be able to recognize Raspishake. Any help debugging this would be great. A minimal example for downloading stations near San Francisco, CA is below.

from obspy.clients.fdsn.mass_downloader import Restrictions, MassDownloader
from obspy.clients.fdsn.mass_downloader.domain import RectangularDomain
mdl = MassDownloader(providers=['RASPISHAKE'])
START = obspy.UTCDateTime(2018, 7, 30)
END = obspy.UTCDateTime(2018, 8, 1)
restrictions = Restrictions(
    starttime=START,
    endtime=END,
    # Chunk it to have one file per day.
    chunklength_in_sec=86400,
    network=None,
    station=None,
    location='',
    channel_priorities=["EHZ", "EH[NE]", "BHZ", "BH[NE]"],
    reject_channels_with_gaps=False,
    minimum_length= 0,
    minimum_interstation_distance_in_m=50.0,
    sanitize=True
)

mdl.download(domain, restrictions,
             stationxml_storage='.',
             mseed_storage='.',
             threads_per_client=3,
             download_chunk_size_in_mb=50
)

Running this yields the following output – note the “contact developer” part:

[2023-11-12 16:01:31,200] - obspy.clients.fdsn.mass_downloader - INFO: Total acquired or preexisting stations: 0
[2023-11-12 16:01:31,200] - obspy.clients.fdsn.mass_downloader - INFO: Total acquired or preexisting stations: 0
[2023-11-12 16:01:31,202] - obspy.clients.fdsn.mass_downloader - INFO: Client 'RASPISHAKE' - Requesting unreliable availability.
[2023-11-12 16:01:31,202] - obspy.clients.fdsn.mass_downloader - INFO: Client 'RASPISHAKE' - Requesting unreliable availability.
[2023-11-12 16:01:32,263] - obspy.clients.fdsn.mass_downloader - ERROR: Client 'RASPISHAKE' - Failed getting availability: Bad request. If you think your request was valid please contact the developers.
HTTP Status code: 400
Detailed response of server:


[2023-11-12 16:01:32,263] - obspy.clients.fdsn.mass_downloader - ERROR: Client 'RASPISHAKE' - Failed getting availability: Bad request. If you think your request was valid please contact the developers.
HTTP Status code: 400
Detailed response of server:


[2023-11-12 16:01:32,266] - obspy.clients.fdsn.mass_downloader - INFO: Client 'RASPISHAKE' - No data available.
[2023-11-12 16:01:32,266] - obspy.clients.fdsn.mass_downloader - INFO: Client 'RASPISHAKE' - No data available.
[2023-11-12 16:01:32,268] - obspy.clients.fdsn.mass_downloader - INFO: ============================== Final report
[2023-11-12 16:01:32,268] - obspy.clients.fdsn.mass_downloader - INFO: ============================== Final report
[2023-11-12 16:01:32,270] - obspy.clients.fdsn.mass_downloader - INFO: 0 MiniSEED files [0.0 MB] already existed.
[2023-11-12 16:01:32,270] - obspy.clients.fdsn.mass_downloader - INFO: 0 MiniSEED files [0.0 MB] already existed.
[2023-11-12 16:01:32,272] - obspy.clients.fdsn.mass_downloader - INFO: 0 StationXML files [0.0 MB] already existed.
[2023-11-12 16:01:32,272] - obspy.clients.fdsn.mass_downloader - INFO: 0 StationXML files [0.0 MB] already existed.
[2023-11-12 16:01:32,274] - obspy.clients.fdsn.mass_downloader - INFO: Client 'RASPISHAKE' - Acquired 0 MiniSEED files [0.0 MB].
[2023-11-12 16:01:32,274] - obspy.clients.fdsn.mass_downloader - INFO: Client 'RASPISHAKE' - Acquired 0 MiniSEED files [0.0 MB].
[2023-11-12 16:01:32,275] - obspy.clients.fdsn.mass_downloader - INFO: Client 'RASPISHAKE' - Acquired 0 StationXML files [0.0 MB].
[2023-11-12 16:01:32,275] - obspy.clients.fdsn.mass_downloader - INFO: Client 'RASPISHAKE' - Acquired 0 StationXML files [0.0 MB].
[2023-11-12 16:01:32,277] - obspy.clients.fdsn.mass_downloader - INFO: Downloaded 0.0 MB in total.
[2023-11-12 16:01:32,277] - obspy.clients.fdsn.mass_downloader - INFO: Downloaded 0.0 MB in total.

Note that I think there should be at least one station downloaded by this request: station AM R0CE3. Indeed, the following code runs and successfully accesses data from R0CE3:

from obspy.clients.fdsn.client import Client
client = Client('RASPISHAKE')
day = obspy.UTCDateTime(2018, 7, 30)
station = 'R0CE3'
st = client.get_waveforms(
                station=station,
                starttime=UTCDateTime(day)
                endtime=UTCDateTime(day)
                attach_response=True, 
               network='AM',
               channel='EHZ',
               location='00'
            )

Thanks in advance!

You can set MassDownloader(..., debug=True) to see more details

Thanks Tobias. When I add debug=True, I get the following additional output:

Downloading https://fdsnws.raspberryshakedata.com/fdsnws/station/1/query?starttime=1999-01-01T00%3A00%3A00.000000&endtime=2021-12-31T00%3A00%3A00.000000&location=--&minlatitude=37.3588457&maxlatitude=38.0238632&minlongitude=-122.5093153&maxlongitude=-121.8708717&level=channel&format=text with requesting gzip compression
Error while downloading: https://fdsnws.raspberryshakedata.com/fdsnws/station/1/query?starttime=1999-01-01T00%3A00%3A00.000000&endtime=2021-12-31T00%3A00%3A00.000000&location=--&minlatitude=37.3588457&maxlatitude=38.0238632&minlongitude=-122.5093153&maxlongitude=-121.8708717&level=channel&format=text

Any tips on how to interpret this? The base url is correct. Could the problem be that raspishake doesn’t accept queries in this format? I am having trouble sorting out what the problem is given this output. Thanks again for your help.

forgot this:

domain = RectangularDomain(minlatitude=37.7, maxlatitude=37.8,minlongitude=-122.5, maxlongitude=-122.3)

also be sure your location is set to ‘00’ to match the actual data…

try again with this, works for me

restrictions = Restrictions(
    starttime=obspy.UTCDateTime(2018,7,30),
    endtime=obspy.UTCDateTime(2018,8,1),
    # Chunk it to have one file per day.
    chunklength_in_sec=86400,
    network='AM',
    station='R0CE3',
    location='00',
    channel_priorities=["EHZ", "EH[NE]", "BHZ", "BH[NE]"],
    reject_channels_with_gaps=False,
    minimum_length= 0,
    minimum_interstation_distance_in_m=50.0,
    sanitize=True
)

Thanks filefolder. This works for me as well. It seems like the problem was indeed with the way I was specifying the network, station, and location arguments. However, my overall goal is to download all stations within an area, regardless of their network/station/location. So instead of specifying those arguments, I just removed them, and this now works as I had hoped.

1 Like