uafgeotools / waveform_collection

Collect seismic/infrasound waveforms and metadata from IRIS/WATC/AVO servers, local miniSEED files, etc.
https://uaf-waveform-collection.readthedocs.io/
MIT License
11 stars 6 forks source link

WATC FDSN ip address #5

Closed davidfee5 closed 4 years ago

davidfee5 commented 4 years ago

From my office I typically point to http://10.30.6.3:8080 for the WATC FDSN server, while 10.30.5.10:8080 is for when I'm out of the office and connected via vpn. Should we allow for both ips or maybe make the user connect through a vpn? Or maybe mess with my routing tables?

atwinkelman commented 4 years ago

There are several options for how to do this.

I'd be in favor of making the server address an argument in the FDSN Client so it can be pointed anywhere, but you'd need to know the address you want to go to. Knowing/remembering the addresses is easy, just define them in your system's /etc/hosts file. Here's a snippet of mine:

[andrew@winkelman ~]$ cat /etc/hosts | grep supersonic
10.30.6.3           supersonic
10.30.5.10          supersonic-nagnet

When I want to address the FDSN server thorugh the faster connection, if available, I'll call

client = Client(base_url='http://supersonic:8080')

but if I'm connected to the VPN, I'll call

client = Client(base_url='http://supersonic-nagnet:8080')

instead. This relies on setting up a hosts file (most systems already have one, just add two entries) and requires the base_url of the FDSN client call to be an argument.

The other option is to put an option in the get_waveforms() function to switch between the hard-coded addresses in the WATC part of the function. In this case, the 10.30.5.10 address would be the default.

Which would be more favorable?

davidfee5 commented 4 years ago

I like the first option. It requires the user to do a bit more work at first but seems cleaner.

liamtoney commented 4 years ago

Addressed in 80c0b2657ff1825edba3dfc2d5678c155c642828

liamtoney commented 3 years ago

Just a note that I tried this recently and supersonic-nagnet didn't work for me — I got this error:

ValueError: The FDSN service base URL `http://supersonic-nagnet:8080` is not a valid URL.

Looks like their URL validator doesn't like hyphens. Changing to supersonic_nagnet worked for me.