File tree Expand file tree Collapse file tree 8 files changed +342
-3
lines changed
Expand file tree Collapse file tree 8 files changed +342
-3
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ ARG depDir=/dependencies
5454ENV inputsDir=$dataDir/inputs
5555ENV outputsDir=/outputs
5656ENV srcDir=$projectDir/src
57+ ENV toolsDir=$projectDir/tools
5758ENV workDir=/fim_temp
5859ENV taudemDir=$depDir/taudem/bin
5960ENV taudemDir2=$depDir/taudem_accelerated_flowDirections/taudem/build/bin
Original file line number Diff line number Diff line change 11All notable changes to this project will be documented in this file.
22We follow the [ Semantic Versioning 2.0.0] ( http://semver.org/ ) format.
33
4+ ## v4.4.8.4 - 2024-01-12 - [ PR #1061 ] ( https://github.com/NOAA-OWP/inundation-mapping/pull/1061 )
5+
6+ Adds a post-processing tool to compare crosswalked (conflated) ` feature_id ` s between NWM stream network to DEM-derived reaches. The tool is run if the ` -x ` flag is added to ` fim_pipeline.sh ` . Results are computed for branch 0 and saved in a summary file in the HUC output folder.
7+
8+ ### Additions
9+
10+ - ` tools/evaluate_crosswalk.py ` : evaluates crosswalk accuracy using two methods:
11+ - intersections: the number of intersections between streamlines
12+ - network (or tree): compares the feature_ids of the immediate upstream segments
13+
14+ ### Changes
15+
16+ - ` Dockerfile ` : added ` toolsDir ` environment variable
17+ - ` fim_pipeline.sh ` : added ` -x ` flag to run crosswalk evaluation tool
18+ - ` fim_post_processing.sh ` : changed hardcoded ` /foss_fim/tools ` to ` toolsDir ` environment variable
19+ - ` fim_pre_processing.sh ` : added ` evaluateCrosswalk ` environment variable
20+ - ` src/ `
21+ - ` add_crosswalk.py ` : fix bug
22+ - ` delineate_hydros_and_produce_HAND.sh ` : added a call to ` verify_crosswalk.py ` if evaluateCrosswalk is True.
23+
24+ <br /><br />
25+
426## v4.4.8.3 - 2024-01-05 - [ PR #1059 ] ( https://github.com/NOAA-OWP/inundation-mapping/pull/1059 )
527
628Fixes erroneous branch inundation in levee-protected areas.
Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ usage()
4848 will be skipped.
4949 -isaws : If this param is included, AWS objects will be used where possible
5050 - Note: This feature is not yet implemented.
51+ -x : If this param is included, the crosswalk will be evaluated.
5152
5253
5354 Running 'fim_pipeline.sh' is a quicker process than running all three scripts independently; however,
Original file line number Diff line number Diff line change 210210echo -e $startDiv " Combining crosswalk tables"
211211# aggregate outputs
212212Tstart
213- python3 /foss_fim/tools /combine_crosswalk_tables.py \
213+ python3 $toolsDir /combine_crosswalk_tables.py \
214214 -d $outputDestDir \
215215 -o $outputDestDir /crosswalk_table.csv
216216Tcount
Original file line number Diff line number Diff line change 101101 -isaws)
102102 isAWS=1
103103 ;;
104+ -x)
105+ evaluateCrosswalk=1
106+ ;;
104107 * ) ;;
105108 esac
106109 shift
@@ -129,6 +132,7 @@ if [ "$jobBranchLimit" = "" ]; then jobBranchLimit=1; fi
129132if [ -z " $overwrite " ]; then overwrite=0; fi
130133if [ -z " $skipcal " ]; then skipcal=0; fi
131134if [ -z " $isAWS " ]; then isAWS=0; fi
135+ if [ -z " $evaluateCrosswalk " ]; then evaluateCrosswalk=0; fi
132136
133137# validate and set defaults for the deny lists
134138if [ " $deny_unit_list " = " " ]
@@ -234,6 +238,7 @@ echo "export deny_branch_zero_list=$deny_branch_zero_list" >> $args_file
234238echo " export has_deny_branch_zero_override=$has_deny_branch_zero_override " >> $args_file
235239echo " export isAWS=$isAWS " >> $args_file
236240echo " export skipcal=$skipcal " >> $args_file
241+ echo " export evaluateCrosswalk=$evaluateCrosswalk " >> $args_file
237242
238243echo " --- Pre-processing is complete"
239244
Original file line number Diff line number Diff line change @@ -258,7 +258,11 @@ def add_crosswalk(
258258 else :
259259 update_id = output_flows .loc [output_flows .HydroID == short_id ]['HydroID' ].item ()
260260
261- str_order = output_flows .loc [output_flows .HydroID == short_id ]['order_' ].item ()
261+ output_order = output_flows .loc [output_flows .HydroID == short_id ]['order_' ]
262+ if len (output_order ) == 1 :
263+ str_order = output_order .item ()
264+ else :
265+ str_order = output_order .max ()
262266 sml_segs = pd .concat (
263267 [
264268 sml_segs ,
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ T_total_start
1717
1818# # MASK LEVEE-PROTECTED AREAS FROM DEM ##
1919if [ " $mask_leveed_area_toggle " = " True" ] && [ -f $tempHucDataDir /LeveeProtectedAreas_subset.gpkg ]; then
20- echo -e $startDiv " Mask levee-protected areas from DEM (*Overwrite dem_meters.tif output) $hucNumber $branch_zero_id "
20+ echo -e $startDiv " Mask levee-protected areas from DEM (*Overwrite dem_meters.tif output) $hucNumber $current_branch_id "
2121 date -u
2222 Tstart
2323 python3 $srcDir /mask_dem.py \
@@ -303,3 +303,18 @@ python3 $srcDir/add_crosswalk.py \
303303 -e $min_catchment_area \
304304 -g $min_stream_length
305305Tcount
306+
307+ # # EVALUATE CROSSWALK ##
308+ if [ " $current_branch_id " = " $branch_zero_id " ] && [ " $evaluateCrosswalk " = " 1" ] ; then
309+ echo -e $startDiv " Evaluate crosswalk $hucNumber $current_branch_id "
310+ date -u
311+ Tstart
312+ python3 $toolsDir /evaluate_crosswalk.py \
313+ -a $tempCurrentBranchDataDir /demDerived_reaches_split_filtered_addedAttributes_crosswalked_$current_branch_id .gpkg \
314+ -b $b_arg \
315+ -c $tempHucDataDir /crosswalk_evaluation_$current_branch_id .csv \
316+ -d $tempHucDataDir /nwm_headwater_points_subset.gpkg \
317+ -u $hucNumber \
318+ -z $current_branch_id
319+ Tcount
320+ fi
You can’t perform that action at this time.
0 commit comments