Skip to content
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

added yaml files and fixed notebook #13

Open
wants to merge 17 commits into
base: florence_test
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,580 changes: 2,547 additions & 33 deletions src/python_routing_v01/Florence_Test.ipynb

Large diffs are not rendered by default.

237 changes: 135 additions & 102 deletions src/python_routing_v01/compute_nhd_routing_SingleSeg.py

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions test/input/json/florence_933020089.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
"debuglevel": -2,
"break_network_at_waterbodies": true,
"assume_short_ts": true,
"qts_subdivisions": 12,
"dt": 300,
"nts": 2016,
"qts_subdivisions": 60,
"dt": 60,
"nts": 10080,
"cpu-pool": 4
},
"output_parameters":
Expand Down
87 changes: 87 additions & 0 deletions test/input/json/florence_933020089_dt10.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
{
"run_parameters":
{
"parallel_compute": true,
"verbose": true,
"showtiming": true,
"debuglevel": -2,
"break_network_at_waterbodies": true,
"assume_short_ts": true,
"qts_subdivisions": 360,
"dt": 10,
"nts": 108000,
"cpu-pool": 4
},
"output_parameters":
{
"csv_output":
{
"csv_output_folder": "../../test/output/text",
"csv_output_segments": [933020089]
},
"nc_output_folder": "../../test/output/text"
},
"supernetwork_parameters":
{
"title_string": "Hurricante Florence cutout",
"geo_file_path": "../../test/input/private/florence_cutout_v21/NWM/DOMAIN/Route_Link.nc",
"mask_file_path": "./933020089_mask.csv",
"mask_layer_string": "",
"mask_driver_string": "csv",
"mask_key_col": 0,
"key_col": 16,
"downstream_col": 22,
"length_col": 3,
"manningn_col": 18,
"manningncc_col": 19,
"slope_col": 8,
"bottomwidth_col": 0,
"waterbody_col": 6,
"waterbody_null_code": -9999,
"topwidth_col": 9,
"topwidthcc_col": 10,
"MusK_col": 4,
"MusX_col": 5,
"ChSlp_col": 1,
"terminal_code": 0,
"driver_string": "NetCDF",
"layer_string": 0
},
"waterbody_parameters": {
"level_pool":
{
"level_pool_waterbody_parameter_file_path": "../../test/input/private/florence_cutout_v21/NWM/DOMAIN/LAKEPARM.nc",
"level_pool_waterbody_id": "lake_id",
"level_pool_waterbody_area": "LkArea",
"level_pool_weir_elevation": "WeirE",
"level_pool_waterbody_max_elevation": "LkMxE",
"level_pool_outfall_weir_coefficient": "WeirC",
"level_pool_outfall_weir_length": "WeirL",
"level_pool_overall_dam_length": "DamL",
"level_pool_orifice_elevation": "OrificeE",
"level_pool_orifice_coefficient": "OrificeC",
"level_pool_orifice_area": "OrificeA"
}
},
"forcing_parameters":
{
"qlat_input_folder": "../../test/input/private/florence_cutout_v21/FORCING_AnA_channel-only/",
"qlat_file_pattern_filter": ["/2018091[456789]*.CHRTOUT_DOMAIN1", "/2018092*.CHRTOUT_DOMAIN1"],
"qlat_file_index_col": "feature_id",
"qlat_file_value_col": "q_lateral"
},
"restart_parameters":
{
"wrf_hydro_channel_restart_file": "../../test/input/private/florence_cutout_v21/NWM/RESTART_open-loop/HYDRO_RST.2018-09-14_00:00_DOMAIN1",
"wrf_hydro_channel_ID_crosswalk_file": "../../test/input/private/florence_cutout_v21/NWM/DOMAIN/Route_Link.nc",
"wrf_hydro_channel_ID_crosswalk_file_field_name": "link",
"wrf_hydro_channel_restart_upstream_flow_field_name": "qlink1",
"wrf_hydro_channel_restart_downstream_flow_field_name": "qlink2",
"wrf_hydro_channel_restart_depth_flow_field_name": "hlink",
"wrf_hydro_waterbody_restart_file": "../../test/input/private/florence_cutout_v21/NWM/RESTART_open-loop/HYDRO_RST.2018-09-14_00:00_DOMAIN1",
"wrf_hydro_waterbody_ID_crosswalk_file": "../../test/input/private/florence_cutout_v21/NWM/DOMAIN/LAKEPARM.nc",
"wrf_hydro_waterbody_ID_crosswalk_file_field_name": "lake_id",
"wrf_hydro_channel_ID_crosswalk_file": "../../test/input/private/florence_cutout_v21/NWM/DOMAIN/Route_Link.nc",
"wrf_hydro_waterbody_crosswalk_filter_file_field_name": "NHDWaterbodyComID"
}
}
87 changes: 87 additions & 0 deletions test/input/json/florence_933020089_dt300.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
{
"run_parameters":
{
"parallel_compute": true,
"verbose": true,
"showtiming": true,
"debuglevel": -2,
"break_network_at_waterbodies": true,
"assume_short_ts": true,
"qts_subdivisions": 12,
"dt": 300,
"nts": 3600,
"cpu-pool": 4
},
"output_parameters":
{
"csv_output":
{
"csv_output_folder": "../../test/output/text",
"csv_output_segments": [933020089]
},
"nc_output_folder": "../../test/output/text"
},
"supernetwork_parameters":
{
"title_string": "Hurricante Florence cutout",
"geo_file_path": "../../test/input/private/florence_cutout_v21/NWM/DOMAIN/Route_Link.nc",
"mask_file_path": "./933020089_mask.csv",
"mask_layer_string": "",
"mask_driver_string": "csv",
"mask_key_col": 0,
"key_col": 16,
"downstream_col": 22,
"length_col": 3,
"manningn_col": 18,
"manningncc_col": 19,
"slope_col": 8,
"bottomwidth_col": 0,
"waterbody_col": 6,
"waterbody_null_code": -9999,
"topwidth_col": 9,
"topwidthcc_col": 10,
"MusK_col": 4,
"MusX_col": 5,
"ChSlp_col": 1,
"terminal_code": 0,
"driver_string": "NetCDF",
"layer_string": 0
},
"waterbody_parameters": {
"level_pool":
{
"level_pool_waterbody_parameter_file_path": "../../test/input/private/florence_cutout_v21/NWM/DOMAIN/LAKEPARM.nc",
"level_pool_waterbody_id": "lake_id",
"level_pool_waterbody_area": "LkArea",
"level_pool_weir_elevation": "WeirE",
"level_pool_waterbody_max_elevation": "LkMxE",
"level_pool_outfall_weir_coefficient": "WeirC",
"level_pool_outfall_weir_length": "WeirL",
"level_pool_overall_dam_length": "DamL",
"level_pool_orifice_elevation": "OrificeE",
"level_pool_orifice_coefficient": "OrificeC",
"level_pool_orifice_area": "OrificeA"
}
},
"forcing_parameters":
{
"qlat_input_folder": "../../test/input/private/florence_cutout_v21/FORCING_AnA_channel-only/",
"qlat_file_pattern_filter": ["/2018091[456789]*.CHRTOUT_DOMAIN1", "/2018092*.CHRTOUT_DOMAIN1"],
"qlat_file_index_col": "feature_id",
"qlat_file_value_col": "q_lateral"
},
"restart_parameters":
{
"wrf_hydro_channel_restart_file": "../../test/input/private/florence_cutout_v21/NWM/RESTART_open-loop/HYDRO_RST.2018-09-14_00:00_DOMAIN1",
"wrf_hydro_channel_ID_crosswalk_file": "../../test/input/private/florence_cutout_v21/NWM/DOMAIN/Route_Link.nc",
"wrf_hydro_channel_ID_crosswalk_file_field_name": "link",
"wrf_hydro_channel_restart_upstream_flow_field_name": "qlink1",
"wrf_hydro_channel_restart_downstream_flow_field_name": "qlink2",
"wrf_hydro_channel_restart_depth_flow_field_name": "hlink",
"wrf_hydro_waterbody_restart_file": "../../test/input/private/florence_cutout_v21/NWM/RESTART_open-loop/HYDRO_RST.2018-09-14_00:00_DOMAIN1",
"wrf_hydro_waterbody_ID_crosswalk_file": "../../test/input/private/florence_cutout_v21/NWM/DOMAIN/LAKEPARM.nc",
"wrf_hydro_waterbody_ID_crosswalk_file_field_name": "lake_id",
"wrf_hydro_channel_ID_crosswalk_file": "../../test/input/private/florence_cutout_v21/NWM/DOMAIN/Route_Link.nc",
"wrf_hydro_waterbody_crosswalk_filter_file_field_name": "NHDWaterbodyComID"
}
}
87 changes: 87 additions & 0 deletions test/input/json/florence_933020089_dt60.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
{
"run_parameters":
{
"parallel_compute": true,
"verbose": true,
"showtiming": true,
"debuglevel": -2,
"break_network_at_waterbodies": true,
"assume_short_ts": true,
"qts_subdivisions": 60,
"dt": 60,
"nts": 10080,
"cpu-pool": 4
},
"output_parameters":
{
"csv_output":
{
"csv_output_folder": "../../test/output/text",
"csv_output_segments": [933020089]
},
"nc_output_folder": "../../test/output/text"
},
"supernetwork_parameters":
{
"title_string": "Hurricante Florence cutout",
"geo_file_path": "../../test/input/private/florence_cutout_v21/NWM/DOMAIN/Route_Link.nc",
"mask_file_path": "./933020089_mask.csv",
"mask_layer_string": "",
"mask_driver_string": "csv",
"mask_key_col": 0,
"key_col": 16,
"downstream_col": 22,
"length_col": 3,
"manningn_col": 18,
"manningncc_col": 19,
"slope_col": 8,
"bottomwidth_col": 0,
"waterbody_col": 6,
"waterbody_null_code": -9999,
"topwidth_col": 9,
"topwidthcc_col": 10,
"MusK_col": 4,
"MusX_col": 5,
"ChSlp_col": 1,
"terminal_code": 0,
"driver_string": "NetCDF",
"layer_string": 0
},
"waterbody_parameters": {
"level_pool":
{
"level_pool_waterbody_parameter_file_path": "../../test/input/private/florence_cutout_v21/NWM/DOMAIN/LAKEPARM.nc",
"level_pool_waterbody_id": "lake_id",
"level_pool_waterbody_area": "LkArea",
"level_pool_weir_elevation": "WeirE",
"level_pool_waterbody_max_elevation": "LkMxE",
"level_pool_outfall_weir_coefficient": "WeirC",
"level_pool_outfall_weir_length": "WeirL",
"level_pool_overall_dam_length": "DamL",
"level_pool_orifice_elevation": "OrificeE",
"level_pool_orifice_coefficient": "OrificeC",
"level_pool_orifice_area": "OrificeA"
}
},
"forcing_parameters":
{
"qlat_input_folder": "../../test/input/private/florence_cutout_v21/FORCING_AnA_channel-only/",
"qlat_file_pattern_filter": ["/2018091[456789]*.CHRTOUT_DOMAIN1", "/2018092*.CHRTOUT_DOMAIN1"],
"qlat_file_index_col": "feature_id",
"qlat_file_value_col": "q_lateral"
},
"restart_parameters":
{
"wrf_hydro_channel_restart_file": "../../test/input/private/florence_cutout_v21/NWM/RESTART_open-loop/HYDRO_RST.2018-09-14_00:00_DOMAIN1",
"wrf_hydro_channel_ID_crosswalk_file": "../../test/input/private/florence_cutout_v21/NWM/DOMAIN/Route_Link.nc",
"wrf_hydro_channel_ID_crosswalk_file_field_name": "link",
"wrf_hydro_channel_restart_upstream_flow_field_name": "qlink1",
"wrf_hydro_channel_restart_downstream_flow_field_name": "qlink2",
"wrf_hydro_channel_restart_depth_flow_field_name": "hlink",
"wrf_hydro_waterbody_restart_file": "../../test/input/private/florence_cutout_v21/NWM/RESTART_open-loop/HYDRO_RST.2018-09-14_00:00_DOMAIN1",
"wrf_hydro_waterbody_ID_crosswalk_file": "../../test/input/private/florence_cutout_v21/NWM/DOMAIN/LAKEPARM.nc",
"wrf_hydro_waterbody_ID_crosswalk_file_field_name": "lake_id",
"wrf_hydro_channel_ID_crosswalk_file": "../../test/input/private/florence_cutout_v21/NWM/DOMAIN/Route_Link.nc",
"wrf_hydro_waterbody_crosswalk_filter_file_field_name": "NHDWaterbodyComID"
}
}
3 changes: 2 additions & 1 deletion test/input/yaml/CustomInput.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ waterbody_parameters:
#WRF-Hydro output file
forcing_parameters:
qlat_input_folder: "../../test/input/geo/NWM_2.1_Sample_Datasets/Pocono_TEST1/example_CHRTOUT/"
qlat_file_pattern_filter: "/*.CHRTOUT_DOMAIN1"
qlat_file_pattern_filter:
- "/*.CHRTOUT_DOMAIN1"
qlat_file_index_col: feature_id
qlat_file_value_col: q_lateral
#WRF-Hydro restart files
Expand Down
98 changes: 98 additions & 0 deletions test/input/yaml/florence_933020089_dt10.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
---
run_parameters:
parallel_compute: true
verbose: true
showtiming: true
debuglevel: -2
break_network_at_waterbodies: true
assume_short_ts: true
qts_subdivisions: 360
dt: 10
nts: 60480
#qts, dt, and nts relationship.
#qts 12*n
#dt 300/n
#nts 3600*n
cpu-pool: 4
output_parameters:
csv_output:
csv_output_folder: "../../test/output/text"
csv_output_segments:
- 933020089
supernetwork_parameters:
title_string: Hurricante Florence cutout
geo_file_path: "../../test/input/private/florence_cutout_v21/NWM/DOMAIN/Route_Link.nc"
mask_file_path: "./933020089_mask.csv"
mask_layer_string: ''
mask_driver_string: csv
mask_key_col: 0
key_col: 16
downstream_col: 22
length_col: 3
manningn_col: 18
manningncc_col: 19
slope_col: 8
bottomwidth_col: 0
waterbody_col: 6
waterbody_null_code: -9999
topwidth_col: 9
topwidthcc_col: 10
MusK_col: 4
MusX_col: 5
ChSlp_col: 1
terminal_code: 0
driver_string: NetCDF
layer_string: 0
# "link",
# "to",
# "Length",
# "n",
# "nCC",
# "So",
# "BtmWdth",
# "TopWdth",
# "TopWdthCC",
# "NHDWaterbodyComID",
# "MusK",
# "MusX",
# "ChSlp",
#waterboy parameters and assignments from lake parm file
waterbody_parameters:
level_pool:
#WRF-Hydro lake parm file
level_pool_waterbody_parameter_file_path: "../../test/input/private/florence_cutout_v21/NWM/DOMAIN/LAKEPARM.nc"
level_pool_waterbody_id: lake_id
level_pool_waterbody_area: LkArea
level_pool_weir_elevation: WeirE
level_pool_waterbody_max_elevation: LkMxE
level_pool_outfall_weir_coefficient: WeirC
level_pool_outfall_weir_length: WeirL
level_pool_overall_dam_length: DamL
level_pool_orifice_elevation: OrificeE
level_pool_orifice_coefficient: OrificeC
level_pool_orifice_area: OrificeA
#WRF-Hydro output file
forcing_parameters:
qlat_input_folder: "../../test/input/private/florence_cutout_v21/FORCING_AnA_channel-only/"
qlat_file_pattern_filter:
- "/2018091[456789]*.CHRTOUT_DOMAIN1"
- "/2018092*.CHRTOUT_DOMAIN1"
qlat_file_index_col: feature_id
qlat_file_value_col: q_lateral
#WRF-Hydro restart files
restart_parameters:
#WRF-Hydro channels restart file
wrf_hydro_channel_restart_file: "../../test/input/private/florence_cutout_v21/NWM/RESTART_open-loop/HYDRO_RST.2018-09-14_00:00_DOMAIN1"
#WRF-Hydro channels ID crosswalk file
wrf_hydro_channel_ID_crosswalk_file: "../../test/input/private/florence_cutout_v21/NWM/DOMAIN/Route_Link.nc"
wrf_hydro_channel_ID_crosswalk_file_field_name: link
wrf_hydro_channel_restart_upstream_flow_field_name: qlink1
wrf_hydro_channel_restart_downstream_flow_field_name: qlink2
wrf_hydro_channel_restart_depth_flow_field_name: hlink
#WRF-Hydro waterbodies restart file
wrf_hydro_waterbody_restart_file: "../../test/input/private/florence_cutout_v21/NWM/RESTART_open-loop/HYDRO_RST.2018-09-14_00:00_DOMAIN1"
#WRF-Hydro waterbody ID crosswalk file
wrf_hydro_waterbody_ID_crosswalk_file: "../../test/input/private/florence_cutout_v21/NWM/DOMAIN/LAKEPARM.nc"
wrf_hydro_waterbody_ID_crosswalk_file_field_name: lake_id
#WRF-Hydro waterbody crosswalk filter file
wrf_hydro_waterbody_crosswalk_filter_file_field_name: NHDWaterbodyComID
Loading