Skip to content

[3pt] PR: Update ngvd_to_navd_ft conversion function to fix lat/lon bug and incorporate Alaska #1574

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

Merged
merged 16 commits into from
Jul 14, 2025

Conversation

EmilyDeardorff
Copy link
Contributor

@EmilyDeardorff EmilyDeardorff commented Jun 25, 2025

Resolves #1551.

This pull requests updates the ngvd_to_navd_ft() function which uses the Vdatum API to convert elevation from NGVD29 to NAVD88 in feet.

Previously, this function would only run for the contiguous US and it produced a conversion value of -1.04 ft for every single site. This is due to the coordinates being fed incorrectly into the API (using 'lat' and 'lon' parameters rather than the correct 's_x' and 's_y').

The value of -1.04 that was being produced was essentially a default value (which we know because when we comment out the coordinate inputs, we also just get the value of -1.04).

This update corrects the coordinate input values and adds a check for whether the site is in Alaska. If the site is in Alaska, it is provided with the correct geoid.

Changes

  • tools/tools_shared_functions.py: Updated vertical datum conversion function (ngvd_to_navd_ft()) to fix input coordinate error and made it able to run in Alaska (as well as CONUS).
  • tools/catfim/generate_categorical_fim.py: Updated ngvd_to_navd_ft() inputs.
  • data/nws/preprocess_ahps_nws.py: Updated ngvd_to_navd_ft() inputs.
  • data/usgs/preprocess_ahps_usgs.py: Updated ngvd_to_navd_ft() inputs.
  • data/usgs/rating_curve_get_usgs_curves.py: Updated ngvd_to_navd_ft() inputs.

Note: This does trigger a need to download new usgs_rating curves (rating_curve_get_usgs_curves.py), but we will do that after this PR is merged due to time constraints. We can make adjustments if needed later. However, the fixes here are needed for CatFIM as well.

Testing

These changes were merged into a different PR, 1573 Fix CatFIM inundate gms errors and tested against CatFIM there successfully.

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

@EmilyDeardorff EmilyDeardorff self-assigned this Jun 25, 2025
@EmilyDeardorff EmilyDeardorff added the bug Something isn't working label Jun 25, 2025
@RobHanna-NOAA RobHanna-NOAA self-requested a review July 1, 2025 20:24
@RobHanna-NOAA RobHanna-NOAA changed the title WIP [3pt] Update ngvd_to_navd_ft conversion function to fix lat/lon bug and incorporate Alaska [3pt] PR: Update ngvd_to_navd_ft conversion function to fix lat/lon bug and incorporate Alaska Jul 3, 2025
@RobHanna-NOAA RobHanna-NOAA marked this pull request as ready for review July 3, 2025 01:16
@CarsonPruitt-NOAA CarsonPruitt-NOAA merged commit 37b8c55 into dev Jul 14, 2025
1 check passed
@CarsonPruitt-NOAA CarsonPruitt-NOAA deleted the dev-update-ak-usgs-download branch July 14, 2025 19:34
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.

[5pt] Update USGS data download script to ensure that it handles the Alaska data properly
3 participants