Skip to content
Merged
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
8 changes: 6 additions & 2 deletions val/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ def stats(St,Sq_,Vt,Vq,gid,IDstr,figdir):
STST=[]
for algo in Sq_:
print(algo)

if algo =='consensus':
OUTconsensus=Sq_[algo]
else:
OUTconsensus=EMPTY

Sq=Sq_[algo]
if np.size(Sq)>3:#this will prevent failures on filled algo data
Expand Down Expand Up @@ -167,7 +170,8 @@ def stats(St,Sq_,Vt,Vq,gid,IDstr,figdir):
"nRMSE":nRMSEo[:],
"nBIAS":nBIASo[:],
"n":no[:],
"t": St
"t": St,
"consensus":OUTconsensus
}

return validout
Expand Down
12 changes: 12 additions & 0 deletions validation_confluence.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,7 @@ def validate(self):
# SWOT time
time = self.read_time_data()
algo_dim = int(self.NUM_ALGOS/2)
Tdim=len(time)
# Data fill values
data_flpe = {
"algorithm": np.full( algo_dim, fill_value=""),
Expand All @@ -551,6 +552,7 @@ def validate(self):
"nRMSE":np.full(algo_dim, fill_value=-9999),
"nBIAS":np.full(algo_dim, fill_value=-9999),
"t":np.full((self.NUM_ALGOS), fill_value=-9999),
"consensus":np.full(Tdim, fill_value=-9999),



Expand Down Expand Up @@ -586,6 +588,7 @@ def validate(self):
"nRMSE":np.full( algo_dim, fill_value=-9999),
"nBIAS":np.full( algo_dim, fill_value=-9999),
"t":np.full((self.NUM_ALGOS), fill_value=-9999),
"consensus":np.full(Tdim, fill_value=-9999),

}

Expand Down Expand Up @@ -619,6 +622,7 @@ def validate(self):
"nRMSE":np.full((self.NUM_ALGOS), fill_value=-9999),
"nBIAS":np.full((self.NUM_ALGOS), fill_value=-9999),
"t":np.full((self.NUM_ALGOS), fill_value=-9999),
"consensus":np.full(Tdim, fill_value=-9999),


}
Expand Down Expand Up @@ -714,6 +718,9 @@ def write(self, stats_flpe,stats_moi,stats_O, reach_id, gage_type,GO):
nb_v_flpe = out.createVariable("nBIAS_flpe", "f8", ("num_algos",), fill_value=fill)
nb_v_flpe.units = "none"
nb_v_flpe[:] = np.where(np.isclose(stats_flpe["nBIAS"], empty), fill, stats_flpe["nBIAS"])
consensus_flpe = out.createVariable("consensus_flpe", "f8", ("time",), fill_value=fill)
consensus_flpe.units = "m^3/s"
consensus_flpe[:] = np.where(np.isclose(stats_flpe["consensus"], empty), fill, stats_flpe["consensus"])
else:
a_v_flpe = out.createVariable("algorithm_flpe", 'S1', ("num_algos", "nchar_flpe"),)
a_v_flpe[:] = empty
Expand Down Expand Up @@ -741,6 +748,11 @@ def write(self, stats_flpe,stats_moi,stats_O, reach_id, gage_type,GO):
nb_v_flpe = out.createVariable("nBIAS_flpe", "f8", ("num_algos",), fill_value=fill)
nb_v_flpe.units = "none"
nb_v_flpe[:] = empty
consensus_flpe = out.createVariable("consensus_flpe", "f8", ("time",), fill_value=fill)
consensus_flpe.units = "m^3/s"
consensus_flpe[:] =empty





Expand Down