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
Add support for the IRIS Federated Catalog Service #1779
Conversation
apveyor seems to befailing on test_future_imports_in_every_file, even though the imports exist... |
|
Those imports need to be at top of files and grouped together otherwise our regex checks dont pick it up properly. I've added some commits that should fix the future imports, @CelsoReyes please remember to pull in changes to your local branch. |
Looks like this is might be ready-ish already, so I'll add it to 1.1.0 for now.. |
Something just went wrong here ;-) Did you merge |
Hi Tobias, Lion, I haven't made any changes other than trying to get things synced, so feel free to do whatever you need to to untangle me (sorry!). Then, once we're all in a good place, I will make any still-needed changes to my branch |
c543fb2
to
7257edf
Compare
Rebased on current master and force-pushed.. btw @CelsoReyes if you add your ETH email address to your list of mail addresses in github those commits should be properly connected to your user account. |
Hi, Just checking on the status. It looks like it's tripping over some core stuff? I'm not making too much sense out of a couple of these reports. Moving forward, issues regarding this feature will be handled by Chad Trabant and the guys at IRIS. Of course, I'm still here and at your service for questions |
I'm still working on one other thing - once that is done I'll have a look at this PR. Sorry for taking so long but this is a big PR and I need to find a big chunk of time to do it. |
The files that were removed in this commit (0f39d1a) need to be removed from history for good, just removing them with another commit doesn't cut it, this will need some history cleanup/squashing. |
… for resending and for not duplicating in the XML
From what I'm reading here this would mean additional dependencies? Dunno.. |
@megies, you are right for I might be missing something. Curious as to the reason @CelsoReyes or @nick-iris or @adam-iris have for doing this. |
I agree, going to https and ignoring warnings is not really an option. If https doesn't work properly we should either figure out why or fall back to http. |
The normal (non-federated) obspy.clients.fdsn.Client does not trim samples outside of the requested start and end times. I think this is also an issue with the normal Client and not the FederatedClient exclusively. For example, the following dataselect request for 10 seconds of data returned a result containing data before and after the requested start and end times.
ObsPy Client Version: from obspy import UTCDateTime
from obspy.clients import fdsn
c = fdsn.client.Client(
service_mappings={
'dataselect': \
'http://eida.ipgp.fr/fdsnws/dataselect/1'
},
debug=True
)
stream = c.get_waveforms('G', 'PEL',
'*', 'LHZ',
UTCDateTime('2016-11-01T00:00:00'),
UTCDateTime('2016-11-01T00:00:10'))
print stream produces this output
|
…llib3. FederatedClient now follows the same design as Client. - Simplify parallel request test in test_federatedclient to speed things up.
- Update FederatedClient to use CustomRedirectHandler the class defined in the ~obspy.clients.fdsn.client module.
Per #1254, I think we are trying to move toward |
I think moving to |
We're trying to finally get to a 1.1.0 release, so I think it's OK for now if it's not using requests exclusively. (CC @krischer)
Interesting. This should indeed then also be fixed in the regular FDSN client. At least for the normal request (not for the direct output request using |
---------------------------------- | ||
|
||
The | ||
:mod:`FDSN fedcatalog_client <obspy.clients.fdsn.routers.fedcatalog_client>` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This link seems broken in the docs build, I think the reason is that the new submodules are not added to the sphinx package skeleton: https://github.com/obspy/obspy/blob/master/misc/docs/source/packages/obspy.clients.fdsn.rst
See also the build log for respective warnings/errors: http://docs.obspy.org/pull-requests/1779/log.txt
obspy/clients/fdsn/__init__.py
Outdated
`FDSN Station and Dataselect web service definitions | ||
<https://www.fdsn.org/webservices/>`_. | ||
|
||
The first step is always to initialize a :class:`FederatedClient` object. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This link sees broken as well.. this should work, hopefully: :class:`~obspy.clients.fdsn.FederatedClient`
if not you have to specify full submodule path..
>>> client = FederatedClient() | ||
|
||
(1) :meth:`~obspy.clients.fdsn.routers.fedcatalog_client. | ||
FederatedClient.get_waveforms()`: The following |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
broken link here too, likely due to aforementioned missing submodule entries in sphinx skeleton document (misc/docs/source/packages/obspy.clients.fdsn.rst
)
|
||
This FederatedClient first queries the FedCatalog service to determine where | ||
the data of interest reside. It then queries the individual web services from | ||
each provider using the FDSN Client routines to retrieve the resulting data. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove leading spaces for all these lines, it's interpreted as a block quote by sphix: http://docs.obspy.org/pull-requests/1779/packages/autogen/obspy.clients.fdsn.routers.html#module-obspy.clients.fdsn.routers
client = Client() | ||
t = UTCDateTime("2010-02-27T06:45:00.000") | ||
st = client.get_waveforms("IU", "ANMO", "00", "LHZ", t, t + 60 * 60) | ||
st.plot() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code is broken as it's importing FedClient and then trying to use normal client. Also, I think it's not necessary in this example to do a plot.. I would just have it print the st
after fetching the data in the doctest example above.
|
||
Retrieving Waveform Metadata | ||
--------------------------- | ||
Submitting a GET request to the federated catalog service. The service |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A lot of times I'm seeing these notes about doing GET
or POST
requests (FDSN API front page, fdsn/routers API front page etc)... this should be removed from the docs I think, that's a low level implementation aspect that's not interesting for the user.
recognizes not only the parameters normally accepted by the bulkdataselect web | ||
service, but also the parameters accepted by the station service. This | ||
includes geographic parameters. For more details, see the help for | ||
obspy.clients.fdsn |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please take the time to properly do sphinx links, i.e. :mod:`obspy.clients.fdsn`
. I know it's annoying to write up in the code base, but high quality across the documentation is not a cosmetics aspect, but it's vital for the usefulness of the docs. And once we start letting sloppy docs sections get through, it's all downhill from there.
|
||
caveats | ||
---- | ||
* duplicated metadata remains duplicated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this could use a bit more information
the duplications. example: | ||
>>> INV2 = fclient.get_stations(network="I?", station="AN*", | ||
... level="network", includeoverlaps="true") | ||
... #doctest: +SKIP |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This (deduplication) sounds like a (valid) feature request for Inventory
class. I'm not sure though if this is the right place to add this notice..
and then starttime by date. | ||
A contains B : This takes wildcards and time ranges into account to denote | ||
whether a request for A would include B's data too. | ||
A == B : all fields are the same (wildcards only match wildcards, for example) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This whole section renders pretty awkward in sphinx, can you please try to fix it? http://docs.obspy.org/pull-requests/1779/packages/autogen/obspy.clients.fdsn.routers.html#module-obspy.clients.fdsn.routers
@megies Is there a script in place for creating the Sphinx docs on my local computer? Thanks. |
@nick-iris There's a Makefile in |
Also see https://gist.github.com/megies/f3f639f575e0ca97fdfd9b41348da802 for the exact conda env currently used on our docs buildbot. I would recommend to start out with the same sphinx at least. Also, I fear building docs takes a long time, unfortunately.. :-/ |
Just a quick heads up so we don't do duplicate work: I'm currently working on finalizing this and I'll push my things early next week. |
Has been merged as part of #1919. I don't know why it did not automatically close it. |
IRIS has a Federated Catalog Webservice that I have been tasked with integrating into ObsPy.
From the webpage:
The use of this module is similar to the existing fdsn Client.
These would behave much like the normal versions, except that they would retrieve data from any number of data centers (providers), depending on the response of the fedcatalog service
one can also get the routing information without downloading the data
I have attached a diagram that shows how the parts interact:
FederatedClient.pdf