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: Stop trimming outlet levelpaths in waterbodies outside of HUC #1284

Closed
wants to merge 2 commits into from

Conversation

mluck
Copy link
Contributor

@mluck mluck commented Sep 12, 2024

Segments of levelpaths that terminate in waterbodies are removed from the levelpath (#671). If there is a waterbody downstream of the HUC then the outlet reaches may be trimmed such that the outlet no longer reaches the edge of the DEM, which causes a number of cascading issues originating in the pit-filling such that reverse flow in the DEM-derived reaches can result in erroneous flowlines and inundation. This PR stops trimming levelpaths outside of the HUC. Fixes #1280.

Changes

  • src/
    • derive_level_paths.py: Adds WBD as an input to stream_network.trim_branches_in_waterbodies()
    • stream_network.py: Selects only segments intersecting the WBD as candidates for removal if they end in waterbodies

Testing

Tested on branch 1477000010 of HUC 12010005.

Deployment Plan (For developer use)

How does the changes affect the product?

  • Code only?
  • If applicable, has a deployment plan be created with the deployment person/team?
  • Require new or adjusted data inputs? Does it have start, end and duration code (in UTC)?
  • If new or updated data sets, has the FIM code been updated and tested with the new/adjusted data (subset is fine, but must be a subset of the new data)?
  • Require new pre-clip set?
  • Has new or updated python packages?

Issuer Checklist (For developer use)

You may update this checklist before and/or after creating the PR. If you're unsure about any of them, please ask, we're here to help! These items are what we are going to look for before merging your code.

  • Informative and human-readable title, using the format: [_pt] PR: <description>
  • Links are provided if this PR resolves an issue, or depends on another other PR
  • If submitting a PR to the dev branch (the default branch), you have a descriptive Feature Branch name using the format: dev-<description-of-change> (e.g. dev-revise-levee-masking)
  • Changes are limited to a single goal (no scope creep)
  • The feature branch you're submitting as a PR is up to date (merged) with the latest dev branch
  • pre-commit hooks were run locally
  • Any change in functionality is tested
  • New functions are documented (with a description, list of inputs, and expected output)
  • Placeholder code is flagged / future todos are captured in comments
  • CHANGELOG updated with template version number, e.g. 4.x.x.x
  • Add yourself as an assignee in the PR as well as the FIM Technical Lead

Merge Checklist (For Technical Lead use only)

  • Update CHANGELOG with latest version number and merge date
  • Update the Citation.cff file to reflect the latest version number in the CHANGELOG
  • If applicable, update README with major alterations

@mluck mluck added bug Something isn't working FIM4 labels Sep 12, 2024
@mluck
Copy link
Contributor Author

mluck commented Sep 12, 2024

Branch 1477000010 (v4.5.2.11) has an incomplete flowline (yellow) due to its outlet being clipped by a lake outside of the HUC boundary. There are missing catchments (brown polygons) where the DEM-derived reaches (yellow line) deviate from the NWM streams (blue) leaving the red dashed reaches remaining after snapping the crosswalk from the middle of the DEM-derived reach to the nearest NWM stream with a 100 meter max snap distance.
image

After this patch, the DEM-derived reaches and catchments are complete all the way down to the outlet at the HUC boundary.
image

@mluck
Copy link
Contributor Author

mluck commented Sep 27, 2024

This has been merged into #1306.

@mluck mluck closed this Sep 27, 2024
@mluck mluck deleted the dev-lake-outlets branch October 25, 2024 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working FIM4
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[8pt] GMS catchment being dropped
2 participants