-
Notifications
You must be signed in to change notification settings - Fork 26
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
Request site data from NWIS for stations #70
Comments
It turns out that different sites have different data on their stream stats pages ("gagepage"). Some sites have lots of data. One original source is an old thing called the "Basin Characteristics File" that was first created in 1986! I found mentions of the file here: https://catalog.data.gov/dataset/watstore-stream-flow-basin-characteristics-file. This has links to the file on WATSTORE. It is in really old formats like .e00 and SDTS! These can be opened, but it doesn't seem worth it. I checked several other packages to see if they have a way to access the gagepages:
Since there doesn't seem to be anything that reads these pages, we could try to do it ourselves. To read directly from the "gagepage" at streamstats, we could use Beautiful Soup, which parses HTML. I've never used it before, but here is a nice guide: https://www.pluralsight.com/guides/extracting-data-html-beautifulsoup It seems relatively easy to do:
import requests
from bs4 import BeautifulSoup as bs
url = "https://streamstatsags.cr.usgs.gov/gagepages/html/03335000.htm"
html_content = requests.get(url).text
soup = bs(html_content, "lxml") The soup object has a few methods that allow you to select things...
|
The site file is retrieved by hf.site_file(site) with commit 76f92cf. |
Description
It would be nice to be able to request site information for USGS stream gauges.
It is possible to get:
from waterdata.usgs.gov. The StreamStats station data site pulls drainage area from this source.
What I Did
returns:
The text was updated successfully, but these errors were encountered: