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: Unmask leveed areas update #1136

Merged
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,16 @@ This hotfix address a bug within the SRC adjustment routine to filter out USGS g

<br/><br/>

## v4.x.x.x - 2024-04-30 - [PR#1136](https://github.com/NOAA-OWP/inundation-mapping/pull/1136)

Levee-protected areas are associated with levelpaths based on a 1000 m buffer on each side of the levee line. However, not all levees are designed to protect against all associated levelpaths, especially where the levelpath flows through the levee-protected area. Levee-protected areas are unmasked by removing levelpaths from association that don't intersect levees but instead flow around them which allows inundation by these branches.

### Changes

- `src/associate_levelpaths_with_levees.py`: Finds levelpaths that don't intersect levees and removes them from their association with their levee-protected area.

<br/><br/>

## v4.4.15.0 - 2024-04-17 - [PR#1081](https://github.com/NOAA-OWP/inundation-mapping/pull/1081)

This enhancement includes changes to the SRC calibration routine that uses the USGS published rating curve database. The modifications attempt to mimic the technique used in the stage-based CatFIM where the USGS WSE/flow is propagated upstream and downstream of the gauge location. This closes #892
Expand Down
17 changes: 15 additions & 2 deletions src/associate_levelpaths_with_levees.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def associate_levelpaths_with_levees(
out_filename: str,
):
"""
Finds the level path associated with each levee. Ignores level paths that cross a levee exactly once.
Finds the levelpath(s) associated with each levee. Ignores levelpaths that cross a levee exactly once.

Parameters
----------
Expand Down Expand Up @@ -177,7 +177,6 @@ def associate_levelpaths_with_levees(
.reset_index(drop=True)
)

# Remove levelpaths that cross the levee exactly once
for j, row in out_df.iterrows():
# Intersect levees and levelpaths
row_intersections = gpd.overlay(
Expand All @@ -193,9 +192,23 @@ def associate_levelpaths_with_levees(
# Select Point geometry type
row_intersections = row_intersections[row_intersections.geom_type == 'Point']

# Remove levelpaths that cross the levee exactly once
if len(row_intersections) == 1:
out_df = out_df.drop(j)

# Find associated levelpaths that don't intersect levees
elif row_intersections.empty:
# Get levelpaths that intersect leveed areas
leveed_area_levelpaths = gpd.overlay(
levelpaths[levelpaths[branch_id_attribute] == row[branch_id_attribute]],
leveed_areas[leveed_areas[levee_id_attribute] == row[levee_id_attribute]],
how='intersection',
keep_geom_type=False,
)

if not leveed_area_levelpaths.empty:
out_df = out_df.drop(j)

out_df.to_csv(out_filename, columns=[levee_id_attribute, branch_id_attribute], index=False)


Expand Down
Loading