Repository: obspy/obspy

Issue:
IRIS federator routing client does not match https:// URLs — affects RASPISHAKE
### Avoid duplicates

- [X] I searched existing issues

### Bug Summary

I noticed that the `RoutingClient('iris-federator')` was never returning stations / data from the RASPISHAKE data center. Digging in, I found this line in the **federator** `_split_routing_response()` method: https://github.com/obspy/obspy/blob/9659cf3e4499fe15fa71bd0bd3a9600aca7f180e/obspy/clients/fdsn/routing/federator_routing_client.py#L167

Compare to this line in the **eidaws** `_split_routing_response()` method:
https://github.com/obspy/obspy/blob/9659cf3e4499fe15fa71bd0bd3a9600aca7f180e/obspy/clients/fdsn/routing/eidaws_routing_client.py#L195

Note the difference is that the **federator** ignores `https://` URLs. Well, RASPISHAKE's URL is `https://`, see [here](http://service.iris.edu/irisws/fedcatalog/1/query?net=AM&sta=RAF63&format=request&includeoverlaps=false&nodata=404):

> ```
> DATASELECTSERVICE=https://fdsnws.raspberryshakedata.com/fdsnws/dataselect/1/
> STATIONSERVICE=https://fdsnws.raspberryshakedata.com/fdsnws/station/1/
> ```

### Possible fix?

I imagine this is a quick fix, changing `"http://"` to `"http"` on line 167 to match how the **eidaws** URLs are handled. If this is indeed the case, I'm happy to make a PR.

### Code to Reproduce

```python
from obspy.clients.fdsn import Client, RoutingClient

kwargs = dict(network='AM', station='RAF63')

Client('RASPISHAKE').get_stations(**kwargs)  # GOOD: Returns Inventory with "Sending institution: SeisComP (RaspberryShake)"
RoutingClient('iris-federator').get_stations(**kwargs)  # BAD: Raises FDSNNoDataException, see attached error traceback
```


### Error Traceback

```Python traceback
---------------------------------------------------------------------------
FDSNNoDataException                       Traceback (most recent call last)
Input In [7], in <cell line: 1>()
----> 1 RoutingClient('iris-federator').get_stations(**kwargs)

File ~/miniconda3/envs/sonify/lib/python3.9/site-packages/decorator.py:232, in decorate.<locals>.fun(*args, **kw)
    230 if not kwsyntax:
    231     args, kw = fix(args, kw, sig)
--> 232 return caller(func, *(extras + args), **kw)

File ~/miniconda3/envs/sonify/lib/python3.9/site-packages/obspy/clients/fdsn/routing/routing_client.py:78, 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)

File ~/miniconda3/envs/sonify/lib/python3.9/site-packages/obspy/clients/fdsn/routing/federator_routing_client.py:105, in FederatorRoutingClient.get_stations(self, **kwargs)
     88 @_assert_filename_not_in_kwargs
     89 def get_stations(self, **kwargs):
     90     """
     91     Get stations from multiple data centers.
     92
   (...)
    103     for details.
    104     """
--> 105     return super(FederatorRoutingClient, self).get_stations(**kwargs)

File ~/miniconda3/envs/sonify/lib/python3.9/site-packages/decorator.py:232, in decorate.<locals>.fun(*args, **kw)
    230 if not kwsyntax:
    231     args, kw = fix(args, kw, sig)
--> 232 return caller(func, *(extras + args), **kw)

File ~/miniconda3/envs/sonify/lib/python3.9/site-packages/obspy/clients/fdsn/routing/routing_client.py:78, 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)

File ~/miniconda3/envs/sonify/lib/python3.9/site-packages/obspy/clients/fdsn/routing/routing_client.py:367, in BaseRoutingClient.get_stations(self, **kwargs)
    363 # Just pass these to the bulk request.
    364 bulk = [kwargs.pop(key, '*') for key in (
    365         "network", "station", "location", "channel", "starttime",
    366         "endtime")]
--> 367 return self.get_stations_bulk([bulk], **kwargs)

File ~/miniconda3/envs/sonify/lib/python3.9/site-packages/decorator.py:232, in decorate.<locals>.fun(*args, **kw)
    230 if not kwsyntax:
    231     args, kw = fix(args, kw, sig)
--> 232 return caller(func, *(extras + args), **kw)

File ~/miniconda3/envs/sonify/lib/python3.9/site-packages/obspy/clients/fdsn/routing/routing_client.py:78, 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)

File ~/miniconda3/envs/sonify/lib/python3.9/site-packages/obspy/clients/fdsn/routing/federator_routing_client.py:142, in FederatorRoutingClient.get_stations_bulk(self, bulk, **kwargs)
    138 r = self._download(self._url + "/query", data=bulk_str)
    139 split = self._split_routing_response(
    140     r.content.decode() if hasattr(r.content, "decode") else r.content,
    141     service="station")
--> 142 return self._download_stations(split, **kwargs)

File ~/miniconda3/envs/sonify/lib/python3.9/site-packages/obspy/clients/fdsn/routing/routing_client.py:238, in BaseRoutingClient._download_stations(self, split, **kwargs)
    237 def _download_stations(self, split, **kwargs):
--> 238     return self._download_parallel(split, data_type="station", **kwargs)

File ~/miniconda3/envs/sonify/lib/python3.9/site-packages/obspy/clients/fdsn/routing/routing_client.py:245, in BaseRoutingClient._download_parallel(self, split, data_type, **kwargs)
    242 split = self._filter_requests(split)
    244 if not split:
--> 245     raise FDSNNoDataException(
    246         "Nothing remains to download after the provider "
    247         "inclusion/exclusion filters have been applied.")
    249 if data_type not in ["waveform", "station"]:  # pragma: no cover
    250     raise ValueError("Invalid data type.")

FDSNNoDataException: Nothing remains to download after the provider inclusion/exclusion filters have been applied.
```


### ObsPy Version?

1.3.0

### Operating System?

macOS

### Python Version?

3.9.12

### Installation Method?

conda


Discussion:
> Well, RASPISHAKE's URL is `https://`, see [here](http://service.iris.edu/irisws/fedcatalog/1/query?net=AM&sta=RAF63&format=request&includeoverlaps=false&nodata=404):

...and it looks like that's the only case of `https://` in the fedcatalog.

<img width="1273" alt="Screen Shot 2022-08-12 at 3 13 07 AM" src="https://user-images.githubusercontent.com/38269494/184343409-1a9a24a4-954e-4f2c-98b7-7192fd73a4f6.png">
> I imagine this is a quick fix, changing `"http://"` to `"http"` on line 167 to match how the **eidaws** URLs are handled. If this is indeed the case, I'm happy to make a PR.

Nail on head, I'd say. Please go ahead with a PR, based on `maintenance_1.3.x` please. =)
Personally, I'd probably change it to `if "http://" in line or "https://" in line:` which feels a bit more robust compared to leaving away the slashes, but probably it's all the same.

Resolving patch:
diff --git a/obspy/clients/fdsn/routing/federator_routing_client.py b/obspy/clients/fdsn/routing/federator_routing_client.py
--- a/obspy/clients/fdsn/routing/federator_routing_client.py
+++ b/obspy/clients/fdsn/routing/federator_routing_client.py
@@ -164,7 +164,7 @@ def _split_routing_response(data, service):
             line = line.strip()
             if not line:
                 continue
-            if "http://" in line:
+            if "http://" in line or "https://" in line:
                 if key not in line:
                     continue
                 current_key = line[len(key) + 1:line.rfind("/fdsnws")]


Test patch: