-
Notifications
You must be signed in to change notification settings - Fork 29
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] Update CatFIM metadata API pulls and add duplicate site filtering, add CatFIM vis files #1379
Open
EmilyDeardorff
wants to merge
13
commits into
dev
Choose a base branch
from
dev-catfim-v2-2-site-filtering
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
EmilyDeardorff
added
bug
Something isn't working
CatFIM
NWS Flood Categorical HAND FIM
labels
Dec 16, 2024
EmilyDeardorff
changed the title
WIP Update CatFIM metadata API pulls and add duplicate site filtering
[1pt] Update CatFIM metadata API pulls and add duplicate site filtering
Dec 20, 2024
EmilyDeardorff
changed the title
[1pt] Update CatFIM metadata API pulls and add duplicate site filtering
[1pt] Update CatFIM metadata API pulls and add duplicate site filtering, add CatFIM vis files
Jan 2, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There are many sites in non-CONUS regions (AK, PR, HI) where we would like to run CatFIM but they are being excluded because they are not NWM forecast points. This PR brings back the double API pull and adds in some code to filter out duplicate (and NULL) lids from the metadata lists.
Additions
inundation-mapping/tools/catfim/vis_categorical_fim.py
: Functions for reading in, processing, and visualizing CatFIM results. Functions should be run in vis_catfim_cross_section.ipynb.inundation-mapping/tools/catfim/notebooks/vis_catfim_cross_section.ipynb
: A new Jupyter notebook for viewing and analyzing CatFIM results at a given site.inundation-mapping/tools/catfim/notebooks/eval_catfim_metadata.ipynb
: A new Jupyter notebook for evaluating metadata and results from CatFIM runs.inundation-mapping/tools/catfim/notebooks/.ipynb_checkpoints/vis_catfim_cross_section-checkpoint.ipynb
: Checkpoint file for vis_catfim_cross_section.ipynb.inundation-mapping/tools/catfim/notebooks/.ipynb_checkpoints/eval_catfim_metadata-checkpoint.ipynb
: Checkpoint file for eval_catfim_metadata.ipynbChanges
inundation-mapping/tools/catfim/generate_categorical_fim_flows.py
: Re-implements the dual API call, with the first API call getting all forecast points and the second API call getting all points (regardless of forecast point status). Adds code to filter out duplicate sites.Testing
I ran some tests with the updated API method (two API pulls + filtering out duplicate sites) and summarized the results below. It seems like this update handles the duplicate point issue well while still widening the selection criteria enough to produce more CatFIM results for AK, HI, and PR.
It will be worth separately looking into why HI and PR are not producing any stage-based CatFIM.
Flow-based, Number of sites (Mapped | Unmapped)
Stage-based, Number of sites (Mapped | Unmapped)
*FIM 4.5.2.11 has no CatFIM points for Alaska because it was added later, in FIM 4.5.11.1
** Unmapped sites weren’t tallied because the test did not produce any mapped sites for the region.
Further Testing
It would be good to test this on stage-based and flow-based a dozen or so HUCs, including some from Alaska, Puerto Rico, and Hawaii. When testing, it would be good to view the CatFIM outputs after the runs to make sure the CatFIM sites and CatFIM libraries look good, especially in AK, PR, and HI.
It would also be good to run
inundation-mapping/tools/catfim/notebooks/vis_catfim_cross_section.ipynb
to make sure that you can get the visualization scripts to run.Deployment Plan (For developer use)
How does the changes affect the product?
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 locally4.x.x.x
Merge Checklist (For Technical Lead use only)