# functions import Hapi.rrm.hbv_bergestrom92 as HBVLumped from Hapi.run import Run from Hapi.catchment import Catchment from Hapi.rrm.routing import Routing import Hapi.statistics.performancecriteria as PC from Hapi.statistics.sensitivityanalysis import SensitivityAnalysis as SA Parameterpath = Path + "/data/Lumped/Coello_Lumped2021-03-08_muskingum.txt" Path = Path + "/data/Lumped/" #%% ### meteorological data start = "2009-01-01" end = "2011-12-31" name = "Coello" Coello = Catchment(name, start, end) Coello.ReadLumpedInputs(Path + "meteo_data-MSWEP.csv") ### Basic_inputs # catchment area CatArea = 1530 # temporal resolution # [Snow pack, Soil moisture, Upper zone, Lower Zone, Water content] InitialCond = [0, 10, 10, 10, 0] Coello.ReadLumpedModel(HBVLumped, CatArea, InitialCond) ### parameters # no snow subroutine Snow = 0 # if routing using Maxbas True, if Muskingum False
DEMF = path + "GIS/4000/dem4000.tif" RouteRiver = "Kinematic" #%% Meteorological data AreaCoeff = 1530 InitialCond = [0, 5, 5, 5, 0] Snow = 0 """ Create the model object and read the input data """ start = "2009-01-01" end = "2011-12-31" name = "Coello" Coello = Catchment(name, start, end, SpatialResolution="Distributed", RouteRiver=RouteRiver) Coello.ReadFlowAcc(FlowAccPath) Coello.ReadFlowDir(FlowDPath) Coello.ReadRiverGeometry(DEMF, BankfullDepthF, RiverWidthF, RiverRoughnessF, FloodPlainRoughnessF) Coello.ReadParameters(ParPathRun, Snow) Coello.ReadRainfall(PrecPath) Coello.ReadTemperature(TempPath) Coello.ReadET(Evap_Path) Coello.ReadLumpedModel(HBV, AreaCoeff, InitialCond) #%% Gauges Coello.ReadGaugeTable(path + "Discharge/stations/gauges.csv", FlowAccPath)
GaugesPath = "inputs/Hapi/meteodata/Gauges/" SaveTo = "" #%% Distributed Model Object AreaCoeff = 227.31 InitialCond = np.loadtxt("inputs/Hapi/meteodata/Initia-jiboa.txt", usecols=0).tolist() Snow = 0 Sdate = '2012-06-14 19:00:00' # Edate = '2014-11-17 00:00:00' Edate = '2013-12-23 00:00:00' name = "Jiboa" Jiboa = Catchment(name, Sdate, Edate, SpatialResolution="Distributed", TemporalResolution="Hourly", fmt='%Y-%m-%d %H:%M:%S') Jiboa.ReadRainfall(PrecPath) Jiboa.ReadTemperature(TempPath) Jiboa.ReadET(Evap_Path) Jiboa.ReadFlowAcc(FlowAccPath) Jiboa.ReadFlowDir(FlowDPath) Jiboa.ReadParameters(ParPath, Snow) Jiboa.ReadLumpedModel(HBV, AreaCoeff, InitialCond) #%% Lake Object """ lake meteorological data """ # where the lake discharges its flow (give the indices of the cell)
#%% Modules import Hapi.rrm.hbv_bergestrom92 as HBVLumped from Hapi.run import Run from Hapi.catchment import Catchment from Hapi.rrm.routing import Routing import Hapi.statistics.performancecriteria as PC #%% Paths Parameterpath = Comp + "/data/lumped/Coello_Lumped2021-03-08_muskingum.txt" MeteoDataPath = Comp + "/data/lumped/meteo_data-MSWEP.csv" Path = Comp + "/data/lumped/" #%% ### meteorological data start = "2009-01-01" end = "2011-12-31" name = "Coello" Coello = Catchment(name, start, end) Coello.ReadLumpedInputs(MeteoDataPath) #%% ### Basic_inputs # catchment area AreaCoeff = 1530 # [Snow pack, Soil moisture, Upper zone, Lower Zone, Water content] InitialCond = [0, 10, 10, 10, 0] Coello.ReadLumpedModel(HBVLumped, AreaCoeff, InitialCond) ### parameters Snow = 0 # no snow subroutine Coello.ReadParameters(Parameterpath, Snow) #%% observed flow Coello.ReadDischargeGauges(Path + "Qout_c.csv", fmt="%Y-%m-%d")