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

[1pt] PR: nws_lid creation (Dev-nws-lid-creation) #372

Merged
merged 82 commits into from
May 3, 2021

Conversation

TrevorGrout-NOAA
Copy link
Contributor

@TrevorGrout-NOAA TrevorGrout-NOAA commented Apr 30, 2021

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:

  1. all sites attributed with rfc_forecast_point = True
  2. all evaluated sites not included in (1)
  3. all sites in HI/PR/VI

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

  • Creation of nws_lid geopackage layer with attributes denoting whether a site is a headwater site or is co-located with another site (at least referencing same nwm feature_id).

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
image

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

Another example of Headwater points also co-located
image

@TrevorGrout-NOAA
Copy link
Contributor Author

TrevorGrout-NOAA commented Apr 30, 2021

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.

BrianAvant
BrianAvant previously approved these changes Apr 30, 2021
Copy link

@BrianAvant BrianAvant left a 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.

@TrevorGrout-NOAA
Copy link
Contributor Author

@BrianAvant-NOAA I have merged with the dev-local-headwaters FB. I also updated the Changelog

@BradfordBates-NOAA
Copy link
Member

@TrevorGrout-NOAA I can merge this in once it's approved. It looks like it has conflicts with the base branch, though.

BrianAvant
BrianAvant previously approved these changes May 3, 2021
@BradfordBates-NOAA BradfordBates-NOAA merged commit 25c3ec1 into dev May 3, 2021
@BradfordBates-NOAA BradfordBates-NOAA deleted the dev-nws-lid-creation branch May 3, 2021 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants