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

seedlink client: add option to fetch available stations #2405

Open
wants to merge 1 commit into
base: master
from

Conversation

3 participants
@megies
Copy link
Member

commented May 24, 2019

What does this PR do?

Adds a method to seedlink client to be able to fetch a list of network/stations for which waveform streams are provided.

Why was it initiated? Any relevant Issues?

This can help in applications to resolve wildcards in stations/networks, e.g. when using seedlink-plotter with "GR_*:HHZ" as seedlink string because the realtime version of the seedlink client can not handle wildcards in network/station.

PR Checklist

  • Correct base branch selected? master for new features, maintenance_... for bug fixes
  • This PR is not directly related to an existing issue (which has no PR yet).
  • If the PR is making changes to documentation, docs pages can be built automatically.
    Just remove the space in the following string after the + sign: "+ DOCS"
  • If any network modules should be tested for the PR, add them as a comma separated list
    (e.g. clients.fdsn,clients.arclink) after the colon in the following magic string: "+TESTS:clients.seedlink"
    (you can also add "ALL" to just simply run all tests across all modules)
  • All tests still pass.
  • Any new features or fixed regressions are be covered via new tests.
  • Any new or changed features have are fully documented.
  • Significant changes have been added to CHANGELOG.txt .
  • First time contributors have added your name to CONTRIBUTORS.txt .

@megies megies added this to the 1.2.0 milestone May 24, 2019

@megies megies self-assigned this May 24, 2019

@megies megies force-pushed the seedlink_get_stations branch from e8b0386 to 7ec4328 May 24, 2019

@megies megies force-pushed the seedlink_get_stations branch from 7ec4328 to 8cd49e6 May 24, 2019

@megies

This comment has been minimized.

Copy link
Member Author

commented May 24, 2019

Maybe should rename the method, because other get_stations() methods usually return Inventory objects..

@d-chambers

This comment has been minimized.

Copy link
Member

commented May 24, 2019

Maybe should rename the method, because other get_stations() methods usually return Inventory objects

Yes, I think this is important for maintaining a consistent API.

I am not very familiar with the seedlink client but would it make sense to also return channel level info? or maybe have a level keyword argument?

Also, is the cache really merited? I don't imagine users calling this method more than a small number of times (probably once) in the same python process, but maybe there is a use case I am overlooking.

@megies

This comment has been minimized.

Copy link
Member Author

commented May 28, 2019

Yes, I think this is important for maintaining a consistent API.

Yeah, I totally agree and I only thought about it when I was sending the PR. How about renaming it to get_contents() or get_station_information?

But actually, I checked again and we can also query down to full SEED ID level, so maybe I change it to return an Inventory object and have the level keyword.

Also, is the cache really merited? I don't imagine users calling this method more than a small number of times (probably once) in the same python process, but maybe there is a use case I am overlooking.

I agree that most use cases will only do a single or some few request and that users could do the same caching easily in their programs. But it's a low hanging fruit, not very complex implementation, users tend to be lazy and just call the method again and the station request actually takes pretty long (several seconds), so I think it should stay in for use cases we might not have on the radar.

@Jollyfant

This comment has been minimized.

Copy link
Contributor

commented May 28, 2019

How does this work? Does it use the CAT command on seedlink?

@megies

This comment has been minimized.

@megies

This comment has been minimized.

Copy link
Member Author

commented May 28, 2019

INFO level
    requests an INFO packet containing XML data embedded in a Mini-SEED log record. level should be one of the following: ID, CAPABILITIES, STATIONS, STREAMS, GAPS, CONNECTIONS, ALL. The XML document conforms to the Document Type Definition (DTD) shown in section ???. The amount of info available depends on the configuration of the SeedLink server. 

https://www.seiscomp3.org/doc/applications/seedlink.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.