-
Notifications
You must be signed in to change notification settings - Fork 33
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
[1pt] PR: nws_lid creation (Dev-nws-lid-creation) #372
Conversation
…out nws_lid to geopackage
There is another PR (#371) in progress. When that is merged, I will make sure this FB is up to date with dev and the changelog is updated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @TrevorGrout-NOAA. I will create a new feature branch so I can incorporate these features into the vector preprocessing pipeline. Can you merge in dev-local-headwaters
so this is ready to merge after PR #371? I already updated the changelog in that branch to v3.0.15.8
.
@BrianAvant-NOAA I have merged with the dev-local-headwaters FB. I also updated the Changelog |
@TrevorGrout-NOAA I can merge this in once it's approved. It looks like it has conflicts with the base branch, though. |
This PR addresses #368
Creates the nws_lid layer with attributes that denote whether a site is a headwater and whether it is co-located (on the same nwm_feature_id) with another site.
This is created by retrieving all NWS_LID sites:
It then sorts through the WRDS metadata for all these sites and compiles the feature_id associated with the site as well as the most downstream feature_id immediately upstream of the ocean. This information is compiled into a dictionary.
Reads in the nwm_flows.gpkg layer used in FIM run to obtain the NWM river network. It then loops through all the sites based on the downstream feature_id to group sites that would flow into each other. For example, all sites associated with the Mississippi River would be selected at once. The network is then traversed and headwater sites are identified.
It then does a check to see if sites are co-located, based on having the same feature_id assignment.
It then creates a spatial GeoDataFrame of all nws_lid points and then the headwater/co-located attributes are joined. The spatial data is then written out to file.
Additions
Testing
1.Example run is:
python3 foss_fim/tools/generate_nws_lid.py -w /path/to/workspace
Screenshots
nws_lid points are attributed with a "is_headwater" column that indicates whether it is a headwater lid location or not.
Headwater points are in black

Headwater points also denoted as co-located (assigned same nwm feature_id from WRDS)

Another example of Headwater points also co-located
