def OF(Qobs, Qout, q_uz_routed, q_lz_trans, coordinates): Coello.ExtractDischarge() all_errors = [] # error for all internal stations for i in range(len(coordinates)): all_errors.append((PC.RMSE( Qobs.loc[:, Qobs.columns[0]], Coello.Qsim[:, i]))) #*coordinates.loc[coordinates.index[i],'weight'] print(all_errors) error = sum(all_errors) return error
def WrapperType2(Randpar, Route, RoutingFn, Qobs): Coello.Parameters = Randpar Run.RunLumped(Coello, Route, RoutingFn) rmse = PC.RMSE(Qobs, Coello.Qsim['q']) return rmse, Coello.Qsim['q']
# observed flow Coello.ReadDischargeGauges(Path + "Qout_c.csv", fmt="%Y-%m-%d") ### Routing Route = 1 # RoutingFn=Routing.TriangularRouting2 RoutingFn = Routing.Muskingum #%% ### run the model Run.RunLumped(Coello, Route, RoutingFn) #%% Metrics = dict() Qobs = Coello.QGauges[Coello.QGauges.columns[0]] Metrics['RMSE'] = PC.RMSE(Qobs, Coello.Qsim['q']) Metrics['NSE'] = PC.NSE(Qobs, Coello.Qsim['q']) Metrics['NSEhf'] = PC.NSEHF(Qobs, Coello.Qsim['q']) Metrics['KGE'] = PC.KGE(Qobs, Coello.Qsim['q']) Metrics['WB'] = PC.WB(Qobs, Coello.Qsim['q']) print("RMSE= " + str(round(Metrics['RMSE'], 2))) print("NSE= " + str(round(Metrics['NSE'], 2))) print("NSEhf= " + str(round(Metrics['NSEhf'], 2))) print("KGE= " + str(round(Metrics['KGE'], 2))) print("WB= " + str(round(Metrics['WB'], 2))) #%% """ first the SensitivityAnalysis method takes 4 arguments : 1-parameters:previous obtained parameters 2-LB: upper bound