Update method for filtering to active GW levels sites
The app currently uses the waterservices argument 'aw' to select for active GW sites. This is not the most robust way to filter the data as it relies on users setting the agency use code correctly. Context from the back-end team on how they manage this potential mismatch for static tables being generated by NWIS annually to update viewers on GW levels, streamflow data and lake levels data:
This may require significant refactoring, which is not something we can currently do, but I wanted to document the need for this refactor and outline the approach suggested by Janell Fry in a Teams chat on September 27, 2023:
So there are different data types:
And it looks like aw is active water levels, according to the test tool, looks like you can also output the period of record by selecting "Show period of record information about these data types" to see the dates and counts.
https://waterservices.usgs.gov/nwis/site/?format=rdb&stateCd=va&outputDataTypeCd=aw&siteStatus=active&hasDataTypeCd=aw
Also, according to the routine we've been discussing that tries to help keep the active/inactive flag current, it's looking for active uv's, dv's, pk's, gw's, qw's, sv's. So in this case, the aw data type may be relegated to the user setting the agency use code correctly. If you're actually looking for groundwater levels, you might be better off using the gw data type
https://code.chs.usgs.gov/wma/nwisweb/uietl/nwisweb-db/-/blob/master/src/sutil/set_site_active_fg?ref_type=heads#L120