Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FDSN Mass Downloader supporting restricted data #1350

Merged
merged 2 commits into from Aug 22, 2016

Conversation

krischer
Copy link
Member

It could be useful if "FDSN Mass Downloader" would support downloading restricted data apart from public one.

Could be something like this:

providers = [
[http://fdsn.service, username, password],
[http://fdsn.service2, username2, password2],
[http://fdsn.service3, username3, password3]
]

@megies
Copy link
Member

megies commented Jun 2, 2016

Should not be too hard to add, I guess?

@krischer
Copy link
Member

krischer commented Jun 2, 2016

Yea that's super simple to add.

@krischer
Copy link
Member

krischer commented Jun 2, 2016

I guess in practice most people will usually only have credentials for a single provider. So how about the following API:

providers = [
   "IRIS",
   obspy.clients.fdsn.Client("my_provider", user="me", password="my_password),
   "ORFEUS"]

Then its less logic and IMHO clearer what is going on.

@michael-afanasiev
Copy link

Hey guys,

Has this been added anywhere?

@krischer
Copy link
Member

krischer commented Aug 3, 2016

Not yet - if you need it right now you can just hack it into this line here:

this_client = Client(client_name, debug=self.debug)

@megies megies added this to the 1.1.0 milestone Aug 3, 2016
These can then also work with authenticated requests and what not.
Also improves the existing documentation.
@krischer
Copy link
Member

This is now a PR including tests and documentation. It now works like this:

from obspy.clients.fdsn import Client

client_orfeus = Client("ORFEUS", user="random", password="some_pw")
client_eth = Client("ETH", user="from_me", password="to_you")

mdl = MassDownloader(providers=[client_orfeus, "IRIS", client_eth])

This is nice because its quite general and will also work if we potentially support other authentication methods in the future. It will just reuse the passed client instance.

@krischer
Copy link
Member

No reviews yet but I'm merging as this is a small change, mostly on a part of ObsPy that is my doing, and it has a test :-)

@krischer krischer merged commit c545d01 into obspy:master Aug 22, 2016
@megies megies deleted the mass-downloader-credentials branch August 23, 2016 08:28
@megies
Copy link
Member

megies commented Aug 23, 2016

@krischer, changelog maybe?

krischer added a commit that referenced this pull request Aug 23, 2016
@krischer
Copy link
Member

Oops. My bad - I just added it to the latest master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants