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

get active status from IOC-UNESCO stations #131

Closed
carolakaiser opened this issue Apr 29, 2024 · 3 comments
Closed

get active status from IOC-UNESCO stations #131

carolakaiser opened this issue Apr 29, 2024 · 3 comments

Comments

@carolakaiser
Copy link
Contributor

Hey guys,
I am looking for a way to get the status of the IOC-UNESCO stations (active or not) for real-time data retrieval.
There is the overview page here https://www.ioc-sealevelmonitoring.org/ and the status for each station is given there. What I am trying to accomplish is to get a list of station IDs that have been active within the last 2 days.
I cannot really remember but do you support this? And if so, would you maybe have a short line of code how to get into this?

@pmav99
Copy link
Member

pmav99 commented May 15, 2024

Hi Carola, do you mean something like this?

import searvey
import datetime

meta = searvey.get_stations(activity_threshold=datetime.timedelta(days=2))
meta[meta.provider == "IOC"]

For the record, this was discussed here: #41

@carolakaiser
Copy link
Contributor Author

Yes, that looks perfect.

@pmav99
Copy link
Member

pmav99 commented May 16, 2024

you can also do it like this:

meta = searvey.get_stations(providers=[searvey.Provider.IOC], activity_threshold=datetime.timedelta(days=2))
# or even
meta = searvey.get_stations(providers=searvey.Provider.IOC, activity_threshold=datetime.timedelta(days=2))

which should be slightly faster, too, since it doesn't retrieve the metadata of the other providers.

@pmav99 pmav99 closed this as completed May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants