# catchment mask catchment_mask = np.ones(shape=dem.shape, dtype=bool) catchment_mask[np.where( dem < -10)] = False # -99999.0 is current value of dem for nodata points. # peel the dem. Only when dem is not surrounded by water boundary_mask = utilities.peel_raster(dem, catchment_mask) # after peeling, catchment_mask should only be the fruit: catchment_mask[boundary_mask] = False # soil types and soil physical properties and soil depth: peat_type_masked = peat_type_arr * catchment_mask peat_bottom_elevation = -peat_depth_arr * catchment_mask # meters with respect to dem surface. Should be negative! h_to_tra_and_C_dict, K = hydro_utils.peat_map_interp_functions( KADJUST) # Load peatmap soil types' physical properties dictionary #soiltypes[soiltypes==255] = 0 # 255 is nodata value. 1 is water (useful for hydrology! Maybe, same treatment as canals). #BOTTOM_ELE = -6.0 #peat_bottom_elevation = np.ones(shape=dem.shape) * BOTTOM_ELE #peat_bottom_elevation = peat_bottom_elevation*catchment_mask tra_to_cut = hydro_utils.peat_map_h_to_tra( soil_type_mask=peat_type_masked, gwt=peat_bottom_elevation, h_to_tra_and_C_dict=h_to_tra_and_C_dict) sto_to_cut = hydro_utils.peat_map_h_to_sto( soil_type_mask=peat_type_masked, gwt=peat_bottom_elevation, h_to_tra_and_C_dict=h_to_tra_and_C_dict) sto_to_cut = sto_to_cut * catchment_mask.ravel()
catchment_mask[np.where( dem < -10)] = False # -99999.0 is current value of dem for nodata points. # 'peel' the dem. Dirichlet BC will be applied at the peel. boundary_mask = utilities.peel_raster(dem, catchment_mask) # after peeling, catchment_mask should only be the fruit: catchment_mask[boundary_mask] = False # soil types, soil physical properties and soil depth: peat_type_masked = peat_type_arr * catchment_mask peat_bottom_elevation = -peat_depth_arr * catchment_mask # meters with respect to dem surface. Should be negative! # Load peatmap soil types' physical properties dictionary. # Kadjust is hydraulic conductivity multiplier for sapric peat h_to_tra_and_C_dict, K = hydro_utils.peat_map_interp_functions(Kadjust=KADJUST) # Transmissivity and storage are computed as: T(h) = T(h) - T(peat depth). # These quantities are the latter tra_to_cut = hydro_utils.peat_map_h_to_tra( soil_type_mask=peat_type_masked, gwt=peat_bottom_elevation, h_to_tra_and_C_dict=h_to_tra_and_C_dict) sto_to_cut = hydro_utils.peat_map_h_to_sto( soil_type_mask=peat_type_masked, gwt=peat_bottom_elevation, h_to_tra_and_C_dict=h_to_tra_and_C_dict) sto_to_cut = sto_to_cut * catchment_mask.ravel() # Water level in canals and list of pixels in canal network. srfcanlist = [dem[coords] for coords in c_to_r_list]