Skip to content

Conversation

RyanSpies-NOAA
Copy link
Collaborator

@RyanSpies-NOAA RyanSpies-NOAA commented Jul 22, 2025

Added new optional input argument to inundate scripts and synthesize_test_cases.py to use the precalb_discharge_cms values in the hydrotable instead of the default discharge_cms. Closes #1618

Changes

  • tools/inundate_gms.py: added "precalb_option", specify "precalb_discharge_cms" as an req input column and force the hydrotable input to be the csv file ("precalb_discharge_cms" is not currently one of the outputs in the feather file). Note that there is logic to fill the "precalb_discharge_cms" with "discharge_cms" when the precalb_discharge is null (this happens for hucs/branches where the calibration routines do not run - not benchmark data to calibrate to)
  • tools/inundate_mosaic_wrapper.py: added the "precalb_option" argument for passing to downstream functions
  • tools/inundation.py: added the "precalb_option" argument and added logic to use the "precalb_discharge_cms" data for interpolating the stages.
  • tools/run_test_case.py: added the "precalb_option" argument for passing to downstream functions
  • tools/synthesize_test_cases.py: added the "precalb_option" as an optional input argument and pass to the appropriate downstream functions

Testing

Example usage (note -p arg):
python3 foss_fim/tools/synthesize_test_cases.py -c DEV -p -v hand_4_8_7_2_precalb -jh 12 -jb 5 -o -m data/previous_fim/hand_4_8_7_2_precalb/eval_4_8_7_2_precalb/hand_4_8_7_2_metrics_precalb.csv -pcsv data/previous_fim/hand_4_8_7_2_precalb/hand_4_8_7_2_metrics.csv

Example of precalb vs regular eval metrics:
image

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

@RyanSpies-NOAA RyanSpies-NOAA self-assigned this Jul 22, 2025
@RyanSpies-NOAA RyanSpies-NOAA added the enhancement New feature or request label Jul 22, 2025
@RyanSpies-NOAA RyanSpies-NOAA marked this pull request as ready for review September 2, 2025 15:42
@hhs732
Copy link
Contributor

hhs732 commented Sep 5, 2025

This PR has been tested by running fim_pipeline on 3 HUCs of 02050101, 07080208, and 12100302. Then, the 10-year fim was created for pre-calibration and final discharge. Eval_plots and stacked bars were generated for these HUCs. For example:

image image image image

Copy link
Contributor

@hhs732 hhs732 left a comment

Choose a reason for hiding this comment

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

This PR was succefully tested with 3 HUCs and approved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[5pt] Add an optional input argument to synthesize_test_cases.py to use precalb_discharge_cms
3 participants