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

PR: Refactor NHDPlus HR preprocessing workflow #371

Merged
merged 69 commits into from
Apr 30, 2021

Conversation

BrianAvant
Copy link

@BrianAvant BrianAvant commented Apr 28, 2021

Refactor NHDPlus HR preprocessing workflow. Resolves issue #238

Changes

  • NHD streams, NWM catchments, and headwaters input layers are consolidated for MS and FR. HUC8 intersections are now included in the input headwaters layer and there are attributes that define the type of each point. Both streams and headwater points have a mainstem attribute.

  • clip_vectors_to_wbd.py checks stream segments that intersect with the WBD boundary and removes incoming streams from the selected layers. This is to prevent them from being routed out of the HUC during the flow direction calculation.

  • Some gaps/overlap in coverage exist at the confluences of HUC8s. This is not likely to be fixed. FIM4 may provide a solution to this issue if we process FIM on a reach scale instead of HUC8s.

Screenshots

FIM v3.0.15.5 MS HUC 03150107
image

FIM v3.0.15.8 MS HUC 03150107
image

Fixes MS deviation
image

Testing

Marginal improvements are observed at BLE and NWS sites whereas a slight regression is observed across all thresholds of the USGS sites.
image

image

image

Looking at metrics of individual USGS sites, it seems the regression in aggregate CSI score may be caused by two specific sites. These sites show a reduction in related to the adjustment in catchment size of the incoming stream segments.
For example, NWS LID IOWI4 in HUC 07080209 shows a ~0.2 drop in CSI across all thresholds:
image

Further inspections reveals that the changes in the new version result in more complete mapping of the upstream boundary.
image

So even thought there is a regression in USGS CSI scores, the subsetting method produces a better output from a hydrologic and visual perspective.

@BrianAvant BrianAvant added the bug Something isn't working label Apr 28, 2021
@BrianAvant BrianAvant added this to the FIM v3.X milestone Apr 28, 2021
@BrianAvant BrianAvant changed the title Refactor NHDPlus HR preprocessing workflow PR: Refactor NHDPlus HR preprocessing workflow Apr 28, 2021
@TrevorGrout-NOAA
Copy link
Contributor

TrevorGrout-NOAA commented Apr 29, 2021

When calculating aggregate scores across all ahps sites (nws & usgs) there are some small fluctuations but overall very similar scores:

  3_0_15_3 3_0_15_8
Action 0.450 0.447
Minor 0.483 0.483
Moderate 0.542 0.544
Major 0.603 0.602

It has been observed that odd, and often unrealistic mapping can occur when a stream segment doesn't traverse the entire catchment. FIM 3.0.15.2 exhibits this:
image

Note how the Agreement raster indicates overprediction for catchments that are fully traversed by the stream centerline. Note how there is underprediction for the upstream most basin.
image

This feature branch exhibits much more realistic catchments and mapping:
image
The overprediction noted in 3.0.15.2 on the downstream catchments is now evident throughout.
image

Despite this site have reduced CSI, I would argue the output is more realistic and consistent. Altering Manning "n" would likely produce more agreeable results.

@TrevorGrout-NOAA
Copy link
Contributor

I was able to check out the feature branch (dev-local-headwaters) and successfully run HUC 03150107 and verified that the catchments appear as indicated. I also inspected IOWI4 and agree that this feature branch, although a reduction in CSI, produces more consistent and realistic results by changing how the catchments are made. Additionally, when viewing the aggregate CSI of all AHPS sites (NWS & USGS) they are only vary by up to 0.3% between 3.0.15.3 vs this feature branch.

@@ -45,8 +45,6 @@ def agreedem(rivers_raster, dem, output_raster, workspace, grass_workspace, buff
# Import dem layer and river layer and get dem profile.
elev = rasterio.open(dem)
dem_profile = elev.profile
if elev.nodata == 0.0:
dem_profile.update(nodata = -999)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Brian, Can you please elaborate why this change was added? Was this an oversight from earlier that is also fixed?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes in PR #358 make this code redundant.

@TrevorGrout-NOAA
Copy link
Contributor

TrevorGrout-NOAA commented Apr 29, 2021

@BrianAvant-NOAA , please make sure this FB is up to date with dev prior to merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants