Skip to content

[1pt] PR: Add NFHL availability to floodplain adjustment #1588

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

Open
wants to merge 9 commits into
base: dev
Choose a base branch
from

Conversation

mluck
Copy link
Contributor

@mluck mluck commented Jul 7, 2025

Adds NFHL availability layer to floodplain adjustment outside of areas covered by NFHL floodplain data. If availability is missing, the NFHL flood hazard layer is not used and the default adjustment distance (3000 meters from the stream line) is used. Resolves #1553.

Changes

  • data/nfhl/download_fema_nfhl.py: Adds NFHL availability layer to download queue.
  • src/adjust_floodplains.py: Modifies to use NFHL availability where floodplain data exists but doesn't have coverage.

Testing

Tested on HUC 05120202 with results shown in #1553 (comment), #1553 (comment), and #1553 (comment).

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 requested a review from ZahraGhahremani July 7, 2025 16:05
@mluck mluck added the Inputs For getting new data, updating data, changing inputs, etc label Jul 7, 2025
Copy link
Contributor

@ZahraGhahremani ZahraGhahremani left a comment

Choose a reason for hiding this comment

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

Ran the dowload_fema_nfhl.py successfully for couple of HUCs. The results are as expected.
The floodplain adjustment is applied in the missing county:
image

image

  • Please update Changelog

ZahraGhahremani
ZahraGhahremani previously approved these changes Jul 7, 2025
@RobHanna-NOAA
Copy link
Contributor

Sounds like there is a new full input set to download? Can someone go ahead and take of it? It will also need to go to the other 4 enviros and I can help guide / take care of it. Watch for versioning and keep me posted as well please. :)

Copy link
Contributor

@ZahraGhahremani ZahraGhahremani left a comment

Choose a reason for hiding this comment

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

There are two situations where this script may raise errors related to the nfhl_huc.gpkg file:

1- Missing file:
If the nfhl_huc.gpkg file does not exist for a given HUC, the script will raise a FileNotFoundError at line 75:

nfhl_layers = gpd.list_layers(fema_flood_zones_file)['name'].tolist()

2- Missing availability layer:
If the file exists but does not contain the availability layer, the code block that initializes distance_grid is skipped. This leads to a NameError at:

distance = np.where(distance_grid <= distance_threshold, distance_grid, np.nan)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Inputs For getting new data, updating data, changing inputs, etc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[8pt] Catchments dropping in branch that has partial FEMA NFHL
4 participants