-
Notifications
You must be signed in to change notification settings - Fork 30
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: Remove GMS branch outlet backpools #1006
Conversation
…split_flows.py documentation.
I received this error when testing:
You should either instantiate the variable
|
An unforseen issue is that In order to move forward, we have to decide whether between a few options:
|
I'm thinking that option 2 might be the best here. The more I think about our current strategy (outlier pixel catchments), the more I think that we could be introducing errors in other places. I'll make a tagup for us on Monday to discuss. |
from utils.shared_functions import getDriver, mem_profile | ||
from utils.shared_variables import FIM_ID | ||
|
||
@mem_profile |
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.
@EmilyDeardorff This just caught my eye. The @mem_profile
decorator function has been removed in the latest dev branch. You would probably catch this after merging the latest dev, but figured I'd give you a heads up.
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.
Fixed this! Good catch,
Comparison Map I've run our current dev version and the dev-branch-outlet-backpools branch on HUC 13080002, which is the original HUC where this issue was pinpointed. Below is a visual comparison of inundation in branch 6077000088 from dev (on the left) compared to the dev-branch-outlet-backpools branch. This figure shows that the branch outlet backpools module mitigates the backpooling effect observed on the left. The middle panel shows the section of the branch catchments that was was causing the backpooling issue and was therefore removed (depicted by cross-hatching). |
…into dev-branch-outlet-backpools
…dation-mapping into dev-branch-outlet-backpools
…into dev-branch-outlet-backpools
There absolutely is a difference in the inundation that you can see in that map. However, I would expect it to go the opposite way - for there to be more inundation after the backpool fix due the change in SRC seen here. This is a good catch, Matt. It's still curious because we tested this FB before merging and there wasn't any difference in skill metrics. @EmilyDeardorff For both of these maps, are you using the standard, composited branch zero/GMS inundation? |
We're using |
I took a closer look at the four places I pointed out earlier. It seems that this PR is doing what it should with regards to inundation (and this is likely affecting the metrics but not sure about the increase in branch errors). Here are some detailed inundation images (left = before, right = after this PR). The red line in the first two images below are DEM-derived streams with My only remaining question is why in image (a) and the Laredo example (that I pointed out above) are the differences in inundation above the last reach, not in the last reach? At first I thought it was because the points might be digitized in the opposite direction (downstream to upstream) but it seems like that's not the case since the large catchment area on the mainstems are being removed correctly, while it seems that the change in inundation at (d) happens at the last reach. |
Hmm yeah, that's a very significant over-inundation on the Before map. I was looking at the |
@RyanSpies-NOAA Can you take a look at why the spatial calibration coefficient is so different in the newest version? This is HUC |
In some HUCs, an overly-large catchment appears at the outlet of the branch (as in issue #985). This catchment causes an artificially large amount of water to get routed to the smaller stream instead of the main stem, which means more of the water that could be causing flooding is coming from the small stream instead of going directly into the larger river. This issue can be mitigated by trimming the levelpath just above the outlet and removing the offending pixel catchment from the pixel catchments and catchment reaches files.
The branch outlet backpool issue is identified based on two criteria:
If both criteria are met for a branch, then the issue is mitigated by trimming the flowline to the third-to-last point. The script also reads in the pixel catchments raster and the reaches raster and removes the inforrectly large outlet pixel catchment. This mitigates the branch outlet backpool error.
Additions
src/mitigate_branch_outlet_backpool.py
Detecting the branch outlet backpool error:
catch_catchment_size_outliers()
function to catch catchment size outliers in the catchment pixels layerget_raster_value()
function to extract the catchment ID from the catchment_pixels geometry for a point feature (branch outlet backpool criteria 1)check_if_ID_is_outlet()
function to test whether any of the outlier catchments are occurring at the levelpath outlet (branch outlet backpool criteria 2)Mitigating the branch outlet backpool error:
gw_catchments_pixels_<id>.tif
andgw_catchments_reaches_<id>.tif
rasters by usinggdal_polygonize.py
to polygonize thegw_pixel_catchments_<id>.tif
file, creating a mask that excludes the problematic pixel catchment, and then using that mask to trim the pixel catchment and catchment reaches rasters.Changes
src/delineate_hydros_and_produce_HAND.sh
mitigate_branch_outlet_backpool.py
module to run after theGage Watershed for Pixels
step.src/split_flows.py
Testing
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.
[_pt] PR: <description>
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
)dev
branchpre-commit
hooks were run locally/foss_fim/
, run:pytest unit_tests/
)4.x.x.x
Merge Checklist (For Technical Lead use only)