diff --git a/src/troute-network/troute/AbstractNetwork.py b/src/troute-network/troute/AbstractNetwork.py index 1942e89c1..0c1cf231d 100644 --- a/src/troute-network/troute/AbstractNetwork.py +++ b/src/troute-network/troute/AbstractNetwork.py @@ -742,11 +742,11 @@ def build_forcing_sets(self,): t1 = datetime.strptime(t1, "%Y-%m-%d_%H:%M:%S") t2 = nhd_io.get_param_str(second_file, "model_output_valid_time") t2 = datetime.strptime(t2, "%Y-%m-%d_%H:%M:%S") - elif forcing_glob_filter=='*.nc': - t1_str = first_file.name.removeprefix('qlat_').removesuffix('.nc') - t1 = datetime.strptime(t1_str, '%Y-%m-%d %H:%M:%S') - t2_str = second_file.name.removeprefix('qlat_').removesuffix('.nc') - t2 = datetime.strptime(t2_str, '%Y-%m-%d %H:%M:%S') + elif forcing_glob_filter.startswith('*NEXOUT'): + t1_str = first_file.name.split('NEXOUT', 1)[0] + t1 = datetime.strptime(t1_str, '%Y%m%d%H%M') + t2_str = second_file.name.split('NEXOUT', 1)[0] + t2 = datetime.strptime(t2_str, '%Y%m%d%H%M') else: df = read_file(first_file) t1_str = pd.to_datetime(df.columns[1]).strftime("%Y-%m-%d_%H:%M:%S") @@ -755,7 +755,6 @@ def build_forcing_sets(self,): t2_str = pd.to_datetime(df.columns[1]).strftime("%Y-%m-%d_%H:%M:%S") t2 = datetime.strptime(t2_str,"%Y-%m-%d_%H:%M:%S") - dt_qlat_timedelta = t2 - t1 dt_qlat = dt_qlat_timedelta.seconds @@ -816,8 +815,12 @@ def build_forcing_sets(self,): final_qlat = qlat_input_folder.joinpath(run_sets[j]['qlat_files'][-1]) if forcing_glob_filter=="*.CHRTOUT_DOMAIN1": final_timestamp_str = nhd_io.get_param_str(final_qlat,'model_output_valid_time') - elif forcing_glob_filter=='*.nc': - final_timestamp_str = final_qlat.name.removeprefix('qlat_').removesuffix('.nc').replace(' ', '_') + elif forcing_glob_filter.startswith('*NEXOUT'): + + final_timestamp_str = datetime.strptime( + final_qlat.name.split('NEXOUT', 1)[0], + "%Y%m%d%H%M" + ).strftime("%Y-%m-%d_%H:%M:%S") else: df = read_file(final_qlat) final_timestamp_str = pd.to_datetime(df.columns[1]).strftime("%Y-%m-%d_%H:%M:%S") diff --git a/test/hf/qlat/201512010000NEXOUT.csv b/test/hf/qlat/201512010000NEXOUT.csv new file mode 100644 index 000000000..d63c64266 --- /dev/null +++ b/test/hf/qlat/201512010000NEXOUT.csv @@ -0,0 +1,4 @@ +feature_id,segment_id,q_lateral +nex-34,cat-34,8.5397760015846 +nex-26,cat-26,7.4514116053885 +nex-68,cat-68,5.809017708628 diff --git a/test/hf/qlat/201512010000NEXOUT.nc b/test/hf/qlat/201512010000NEXOUT.nc new file mode 100644 index 000000000..e855c7df7 Binary files /dev/null and b/test/hf/qlat/201512010000NEXOUT.nc differ diff --git a/test/hf/qlat/201512010100NEXOUT.csv b/test/hf/qlat/201512010100NEXOUT.csv new file mode 100644 index 000000000..6129122fb --- /dev/null +++ b/test/hf/qlat/201512010100NEXOUT.csv @@ -0,0 +1,4 @@ +feature_id,segment_id,q_lateral +nex-34,cat-34,8.5367897507005 +nex-26,cat-26,7.4383755467321 +nex-68,cat-68,5.800884801632 diff --git a/test/hf/qlat/201512010100NEXOUT.nc b/test/hf/qlat/201512010100NEXOUT.nc new file mode 100644 index 000000000..2e4b76e07 Binary files /dev/null and b/test/hf/qlat/201512010100NEXOUT.nc differ diff --git a/test/hf/qlat/201512010200NEXOUT.csv b/test/hf/qlat/201512010200NEXOUT.csv new file mode 100644 index 000000000..45da755e3 --- /dev/null +++ b/test/hf/qlat/201512010200NEXOUT.csv @@ -0,0 +1,4 @@ +feature_id,segment_id,q_lateral +nex-34,cat-34,8.515880525188 +nex-26,cat-26,7.4253394880757 +nex-68,cat-68,5.7846183671391 diff --git a/test/hf/qlat/201512010200NEXOUT.nc b/test/hf/qlat/201512010200NEXOUT.nc new file mode 100644 index 000000000..2517c278f Binary files /dev/null and b/test/hf/qlat/201512010200NEXOUT.nc differ diff --git a/test/hf/qlat/201512010300NEXOUT.csv b/test/hf/qlat/201512010300NEXOUT.csv new file mode 100644 index 000000000..fe2e7bf08 --- /dev/null +++ b/test/hf/qlat/201512010300NEXOUT.csv @@ -0,0 +1,4 @@ +feature_id,segment_id,q_lateral +nex-34,cat-34,8.480036399039 +nex-26,cat-26,7.4018739459679 +nex-68,cat-68,5.7703859350215 diff --git a/test/hf/qlat/201512010300NEXOUT.nc b/test/hf/qlat/201512010300NEXOUT.nc new file mode 100644 index 000000000..bbb85b767 Binary files /dev/null and b/test/hf/qlat/201512010300NEXOUT.nc differ diff --git a/test/hf/qlat/201512010400NEXOUT.csv b/test/hf/qlat/201512010400NEXOUT.csv new file mode 100644 index 000000000..20e8b3f0f --- /dev/null +++ b/test/hf/qlat/201512010400NEXOUT.csv @@ -0,0 +1,4 @@ +feature_id,segment_id,q_lateral +nex-34,cat-34,8.4651014984026 +nex-26,cat-26,7.3836239412437 +nex-68,cat-68,5.758186264277 diff --git a/test/hf/qlat/201512010400NEXOUT.nc b/test/hf/qlat/201512010400NEXOUT.nc new file mode 100644 index 000000000..c69cee50f Binary files /dev/null and b/test/hf/qlat/201512010400NEXOUT.nc differ diff --git a/test/hf/qlat/201512010500NEXOUT.csv b/test/hf/qlat/201512010500NEXOUT.csv new file mode 100644 index 000000000..33242ae91 --- /dev/null +++ b/test/hf/qlat/201512010500NEXOUT.csv @@ -0,0 +1,4 @@ +feature_id,segment_id,q_lateral +nex-34,cat-34,8.4531537602043 +nex-26,cat-26,7.3731952534501 +nex-68,cat-68,5.7459865935326 diff --git a/test/hf/qlat/201512010500NEXOUT.nc b/test/hf/qlat/201512010500NEXOUT.nc new file mode 100644 index 000000000..8848a7bc2 Binary files /dev/null and b/test/hf/qlat/201512010500NEXOUT.nc differ diff --git a/test/hf/qlat/201512010600NEXOUT.csv b/test/hf/qlat/201512010600NEXOUT.csv new file mode 100644 index 000000000..b0f66a3a4 --- /dev/null +++ b/test/hf/qlat/201512010600NEXOUT.csv @@ -0,0 +1,4 @@ +feature_id,segment_id,q_lateral +nex-34,cat-34,8.441206022006 +nex-26,cat-26,7.3679805117244 +nex-68,cat-68,5.7439532116583 diff --git a/test/hf/qlat/201512010600NEXOUT.nc b/test/hf/qlat/201512010600NEXOUT.nc new file mode 100644 index 000000000..c20500c13 Binary files /dev/null and b/test/hf/qlat/201512010600NEXOUT.nc differ diff --git a/test/hf/qlat/201512010700NEXOUT.csv b/test/hf/qlat/201512010700NEXOUT.csv new file mode 100644 index 000000000..facaf510c --- /dev/null +++ b/test/hf/qlat/201512010700NEXOUT.csv @@ -0,0 +1,4 @@ +feature_id,segment_id,q_lateral +nex-34,cat-34,8.4322454462457 +nex-26,cat-26,7.3575518239309 +nex-68,cat-68,5.7378536865366 diff --git a/test/hf/qlat/201512010700NEXOUT.nc b/test/hf/qlat/201512010700NEXOUT.nc new file mode 100644 index 000000000..3e8ecb97f Binary files /dev/null and b/test/hf/qlat/201512010700NEXOUT.nc differ diff --git a/test/hf/qlat/201512010800NEXOUT.csv b/test/hf/qlat/201512010800NEXOUT.csv new file mode 100644 index 000000000..d51452f60 --- /dev/null +++ b/test/hf/qlat/201512010800NEXOUT.csv @@ -0,0 +1,4 @@ +feature_id,segment_id,q_lateral +nex-34,cat-34,8.4232839589315 +nex-26,cat-26,7.3523370822052 +nex-68,cat-68,5.7337869227882 diff --git a/test/hf/qlat/201512010800NEXOUT.nc b/test/hf/qlat/201512010800NEXOUT.nc new file mode 100644 index 000000000..ba9bf1aea Binary files /dev/null and b/test/hf/qlat/201512010800NEXOUT.nc differ diff --git a/test/hf/qlat/201512010900NEXOUT.csv b/test/hf/qlat/201512010900NEXOUT.csv new file mode 100644 index 000000000..939e44a30 --- /dev/null +++ b/test/hf/qlat/201512010900NEXOUT.csv @@ -0,0 +1,4 @@ +feature_id,segment_id,q_lateral +nex-34,cat-34,8.4202967964934 +nex-26,cat-26,7.3497297113423 +nex-68,cat-68,5.7297207795407 diff --git a/test/hf/qlat/201512010900NEXOUT.nc b/test/hf/qlat/201512010900NEXOUT.nc new file mode 100644 index 000000000..dcdd187c1 Binary files /dev/null and b/test/hf/qlat/201512010900NEXOUT.nc differ diff --git a/test/hf/qlat/201512011000NEXOUT.csv b/test/hf/qlat/201512011000NEXOUT.csv new file mode 100644 index 000000000..d3cd6021e --- /dev/null +++ b/test/hf/qlat/201512011000NEXOUT.csv @@ -0,0 +1,4 @@ +feature_id,segment_id,q_lateral +nex-34,cat-34,8.4143233831712 +nex-26,cat-26,7.3471231361373 +nex-68,cat-68,5.7276873976664 diff --git a/test/hf/qlat/201512011000NEXOUT.nc b/test/hf/qlat/201512011000NEXOUT.nc new file mode 100644 index 000000000..ded76a35e Binary files /dev/null and b/test/hf/qlat/201512011000NEXOUT.nc differ diff --git a/test/hf/qlat/201512011100NEXOUT.csv b/test/hf/qlat/201512011100NEXOUT.csv new file mode 100644 index 000000000..d3cd6021e --- /dev/null +++ b/test/hf/qlat/201512011100NEXOUT.csv @@ -0,0 +1,4 @@ +feature_id,segment_id,q_lateral +nex-34,cat-34,8.4143233831712 +nex-26,cat-26,7.3471231361373 +nex-68,cat-68,5.7276873976664 diff --git a/test/hf/qlat/201512011100NEXOUT.nc b/test/hf/qlat/201512011100NEXOUT.nc new file mode 100644 index 000000000..ded76a35e Binary files /dev/null and b/test/hf/qlat/201512011100NEXOUT.nc differ diff --git a/test/hf/qlat/201512011200NEXOUT.csv b/test/hf/qlat/201512011200NEXOUT.csv new file mode 100644 index 000000000..3db6a99dc --- /dev/null +++ b/test/hf/qlat/201512011200NEXOUT.csv @@ -0,0 +1,4 @@ +feature_id,segment_id,q_lateral +nex-34,cat-34,8.4143233831712 +nex-26,cat-26,7.3445157652745 +nex-68,cat-68,5.7256540157922 diff --git a/test/hf/qlat/201512011200NEXOUT.nc b/test/hf/qlat/201512011200NEXOUT.nc new file mode 100644 index 000000000..0f2c19cb6 Binary files /dev/null and b/test/hf/qlat/201512011200NEXOUT.nc differ diff --git a/test/hf/qlat/201512011300NEXOUT.csv b/test/hf/qlat/201512011300NEXOUT.csv new file mode 100644 index 000000000..939e44a30 --- /dev/null +++ b/test/hf/qlat/201512011300NEXOUT.csv @@ -0,0 +1,4 @@ +feature_id,segment_id,q_lateral +nex-34,cat-34,8.4202967964934 +nex-26,cat-26,7.3497297113423 +nex-68,cat-68,5.7297207795407 diff --git a/test/hf/qlat/201512011300NEXOUT.nc b/test/hf/qlat/201512011300NEXOUT.nc new file mode 100644 index 000000000..dcdd187c1 Binary files /dev/null and b/test/hf/qlat/201512011300NEXOUT.nc differ diff --git a/test/hf/qlat/201512011400NEXOUT.csv b/test/hf/qlat/201512011400NEXOUT.csv new file mode 100644 index 000000000..442f54352 --- /dev/null +++ b/test/hf/qlat/201512011400NEXOUT.csv @@ -0,0 +1,4 @@ +feature_id,segment_id,q_lateral +nex-34,cat-34,8.4262711213696 +nex-26,cat-26,7.354944453068 +nex-68,cat-68,5.7358203046624 diff --git a/test/hf/qlat/201512011400NEXOUT.nc b/test/hf/qlat/201512011400NEXOUT.nc new file mode 100644 index 000000000..dff07e619 Binary files /dev/null and b/test/hf/qlat/201512011400NEXOUT.nc differ diff --git a/test/hf/qlat/201512011500NEXOUT.csv b/test/hf/qlat/201512011500NEXOUT.csv new file mode 100644 index 000000000..176ce6e11 --- /dev/null +++ b/test/hf/qlat/201512011500NEXOUT.csv @@ -0,0 +1,4 @@ +feature_id,segment_id,q_lateral +nex-34,cat-34,8.4322454462457 +nex-26,cat-26,7.354944453068 +nex-68,cat-68,5.7378536865366 diff --git a/test/hf/qlat/201512011500NEXOUT.nc b/test/hf/qlat/201512011500NEXOUT.nc new file mode 100644 index 000000000..be81ee3a0 Binary files /dev/null and b/test/hf/qlat/201512011500NEXOUT.nc differ diff --git a/test/hf/qlat/201512011600NEXOUT.csv b/test/hf/qlat/201512011600NEXOUT.csv new file mode 100644 index 000000000..a94f4ba56 --- /dev/null +++ b/test/hf/qlat/201512011600NEXOUT.csv @@ -0,0 +1,4 @@ +feature_id,segment_id,q_lateral +nex-34,cat-34,8.444193184444 +nex-26,cat-26,7.3705878825873 +nex-68,cat-68,5.7480199754068 diff --git a/test/hf/qlat/201512011600NEXOUT.nc b/test/hf/qlat/201512011600NEXOUT.nc new file mode 100644 index 000000000..d91f32585 Binary files /dev/null and b/test/hf/qlat/201512011600NEXOUT.nc differ diff --git a/test/hf/qlat/201512011700NEXOUT.csv b/test/hf/qlat/201512011700NEXOUT.csv new file mode 100644 index 000000000..af3856d1c --- /dev/null +++ b/test/hf/qlat/201512011700NEXOUT.csv @@ -0,0 +1,4 @@ +feature_id,segment_id,q_lateral +nex-34,cat-34,8.4501665977662 +nex-26,cat-26,7.3705878825873 +nex-68,cat-68,5.7480199754068 diff --git a/test/hf/qlat/201512011700NEXOUT.nc b/test/hf/qlat/201512011700NEXOUT.nc new file mode 100644 index 000000000..3f13b4c85 Binary files /dev/null and b/test/hf/qlat/201512011700NEXOUT.nc differ diff --git a/test/hf/qlat/201512011800NEXOUT.csv b/test/hf/qlat/201512011800NEXOUT.csv new file mode 100644 index 000000000..e2a48c040 --- /dev/null +++ b/test/hf/qlat/201512011800NEXOUT.csv @@ -0,0 +1,4 @@ +feature_id,segment_id,q_lateral +nex-34,cat-34,8.4651014984026 +nex-26,cat-26,7.3862313121065 +nex-68,cat-68,5.7561528824028 diff --git a/test/hf/qlat/201512011800NEXOUT.nc b/test/hf/qlat/201512011800NEXOUT.nc new file mode 100644 index 000000000..4ab3aac31 Binary files /dev/null and b/test/hf/qlat/201512011800NEXOUT.nc differ diff --git a/test/hf/qlat/201512011900NEXOUT.csv b/test/hf/qlat/201512011900NEXOUT.csv new file mode 100644 index 000000000..21a3898c2 --- /dev/null +++ b/test/hf/qlat/201512011900NEXOUT.csv @@ -0,0 +1,4 @@ +feature_id,segment_id,q_lateral +nex-34,cat-34,8.4949712996754 +nex-26,cat-26,7.4096960585565 +nex-68,cat-68,5.7764854601432 diff --git a/test/hf/qlat/201512011900NEXOUT.nc b/test/hf/qlat/201512011900NEXOUT.nc new file mode 100644 index 000000000..130363c7f Binary files /dev/null and b/test/hf/qlat/201512011900NEXOUT.nc differ diff --git a/test/hf/qlat/201512012000NEXOUT.csv b/test/hf/qlat/201512012000NEXOUT.csv new file mode 100644 index 000000000..c05d7a541 --- /dev/null +++ b/test/hf/qlat/201512012000NEXOUT.csv @@ -0,0 +1,4 @@ +feature_id,segment_id,q_lateral +nex-34,cat-34,8.5099062003118 +nex-26,cat-26,7.4279460632807 +nex-68,cat-68,5.7907185127618 diff --git a/test/hf/qlat/201512012000NEXOUT.nc b/test/hf/qlat/201512012000NEXOUT.nc new file mode 100644 index 000000000..e9baea923 Binary files /dev/null and b/test/hf/qlat/201512012000NEXOUT.nc differ diff --git a/test/hf/qlat/201512012100NEXOUT.csv b/test/hf/qlat/201512012100NEXOUT.csv new file mode 100644 index 000000000..11e32af1b --- /dev/null +++ b/test/hf/qlat/201512012100NEXOUT.csv @@ -0,0 +1,4 @@ +feature_id,segment_id,q_lateral +nex-34,cat-34,8.5099062003118 +nex-26,cat-26,7.4253394880757 +nex-68,cat-68,5.7886851308876 diff --git a/test/hf/qlat/201512012100NEXOUT.nc b/test/hf/qlat/201512012100NEXOUT.nc new file mode 100644 index 000000000..4b54f9c60 Binary files /dev/null and b/test/hf/qlat/201512012100NEXOUT.nc differ diff --git a/test/hf/qlat/201512012200NEXOUT.csv b/test/hf/qlat/201512012200NEXOUT.csv new file mode 100644 index 000000000..eef610a7e --- /dev/null +++ b/test/hf/qlat/201512012200NEXOUT.csv @@ -0,0 +1,4 @@ +feature_id,segment_id,q_lateral +nex-34,cat-34,8.515880525188 +nex-26,cat-26,7.4305534341435 +nex-68,cat-68,5.7907185127618 diff --git a/test/hf/qlat/201512012200NEXOUT.nc b/test/hf/qlat/201512012200NEXOUT.nc new file mode 100644 index 000000000..d6fb08483 Binary files /dev/null and b/test/hf/qlat/201512012200NEXOUT.nc differ diff --git a/test/hf/qlat/201512012300NEXOUT.csv b/test/hf/qlat/201512012300NEXOUT.csv new file mode 100644 index 000000000..1347be22d --- /dev/null +++ b/test/hf/qlat/201512012300NEXOUT.csv @@ -0,0 +1,4 @@ +feature_id,segment_id,q_lateral +nex-34,cat-34,8.5128933627499 +nex-26,cat-26,7.4305534341435 +nex-68,cat-68,5.7927512741351 diff --git a/test/hf/qlat/201512012300NEXOUT.nc b/test/hf/qlat/201512012300NEXOUT.nc new file mode 100644 index 000000000..070a7bd22 Binary files /dev/null and b/test/hf/qlat/201512012300NEXOUT.nc differ