def __init__(self, combined_data, parameters=None): """ parameters: Dict of IHACRES, Routing, Dam, Network parameters """ self.Data = combined_data self.Climate = combined_data['climate'] self.network = combined_data['network'] # self.IHACRESparams = combined_data['IHACRESparams'] self.Routingparams = combined_data["Routingparams"] self.Damparams = combined_data['Damparams'] self.climate_prep = time.time() self.prepClimateDataForNetwork() self.climate_prep = time.time() - self.climate_prep self.Routing = Routing(self.Climate, combined_data['water_volume']) self.IHACRES = IHACRES(self.Climate, combined_data['water_deficit'], combined_data['IHACRESparams']) self.Dam = Dam(self.Climate, combined_data['dam_volume']) self.prep_time = 0.0 self.calc_time = 0.0 self.dam = 0.0 self.route = 0.0 self.route_i = 0.0 self.inflow_time = 0.0 self.ih = 0.0
from integrated.Modules.Core.Handlers.FileHandler import FileHandler from integrated.Modules.Hydrology.IHACRES.IHACRES import IHACRES import pandas as pd if __name__ == '__main__': ClimateData = FileHandler().loadCSV('test_data/climate/Echuca.txt', columns=[0, 7, 9], skiprows=41, delimiter=r'\s*', engine='python') # ClimateData.index = pd.to_datetime(ClimateData[ClimateData.columns[0]], format='%Y%m%d') ClimateData.columns = ['Date', 'rainfall', 'ET'] RRmodel = IHACRES(ClimateData, 50) prev_storage = 50 inflow = 100 irrig_out = 25 evap = 10 local_inflow = 10 base_flow = 5 deep_drainage = 10 storage_coef = 0.5 ET_f = 1.1 #Test flow calculation print RRmodel.calcFlow(prev_storage, inflow, irrig_out, evap, local_inflow, base_flow, deep_drainage, storage_coef, ET_f)