DOI-USGS / dataretrieval-python

Python package for retrieving water data from USGS or the multi-agency Water Quality Portal
https://doi-usgs.github.io/dataretrieval-python/
Other
165 stars 41 forks source link

Extend the wqp search to nearby sites #148

Closed thodson-usgs closed 2 months ago

thodson-usgs commented 3 months ago

@kjdoore,

Extend wqp.get_results to filter data from nearby sites. 1) given a search, as well as neighborhood search parameters, search sites in the neighborhood for matching data 1) The neighborhood search will use the NLDI. First look within the search radius for any matching sites upstream and downstream. 2) Apply some additional filter, mainly drainage area to filter out watersheds with drastically different sizes. 3) For example, you may search within an initial radius, then use nwis.get_info(site) to return the drainage area, then square root to come up with a distance measure and multiply that by some factor, say 0.1, then keep only sites within that distance that have similar area. 4) Finally, pull data from each of those sites and combine them into single dataframe, optionally add a boolean flag to indicate whether the data are "artificial",

Notes

thodson-usgs commented 2 months ago

Closed for now with demo in #151

elbeejay commented 2 months ago

Wouldn't you want to incorporate this example + readme into the hosted documentation? Feels a bit like it is stranded out on its own with a readme that's best viewed in GitHub unlike the rest of the examples.

thodson-usgs commented 2 months ago

ah, I take it we're building the demos into the doc? Then yes, I should move this somewhere else. Maybe to an examples directory which is a standard home for stand-alones like this.

elbeejay commented 2 months ago

Yeah they show up like this: https://doi-usgs.github.io/dataretrieval-python/examples/index.html based on the files in /docs/source/examples - might be worth translating the readme for this example into a .rst file and adding it there (like https://github.com/DOI-USGS/dataretrieval-python/blob/master/docs/source/examples/siteinfo_examples.rst?plain=1)