Commit 72985b91 authored by Laura LINDEPERG's avatar Laura LINDEPERG
Browse files

GLHYMPS investigation

parent f85ace18
......@@ -4,7 +4,7 @@ import pandas as pd
class GeologicProperties(object):
def __init__(self, code=-1, maingeol_id=-1, maingeol_description=-1, age=-1, proportion=-1, maingeol_age=-1, maingeol_age_proportion=-1, ks=-1, theta_d=-1):
def __init__(self, code=-1, maingeol_id=-1, maingeol_description=-1, age=-1, proportion=-1, maingeol_age=-1, maingeol_age_proportion=-1, ks=-1, theta_d=-1, k_glhymps = -1):
self.code = code
self.maingeol_id = maingeol_id
self.maingeol_description = maingeol_description
......@@ -12,8 +12,9 @@ class GeologicProperties(object):
self.age = age # [min, mean, max] age averaged from the 1/1000000e brgm map
self.maingeol_age = maingeol_age
self.maingeol_age_proportion = maingeol_age_proportion
self.ks = ks
self.ks = ks # [cm/day]
self.theta_d = theta_d
self.k_glhymps = k_glhymps # [cm/day]
def extract_main_geology_from_filename(self, geol_foldername, catchment_contour_shp):
geol_shp = gpd.read_file(geol_foldername)
......@@ -69,8 +70,22 @@ class GeologicProperties(object):
def compute_hydraulic_properties(self, ks_map, sat_map, fc_map):
self.compute_KS_mean(ks_map)
self.compute_drainage_porosity(sat_map, fc_map)
def extract_K_GLHYMPS(self, glhymps_file):
where_gum_k_0 = glhymps_file['GUM_K'].eq(0)
log_k = glhymps_file['logK_Ferr_']
log_k = log_k.where(~where_gum_k_0, np.nan)
k = pow(10,log_k/100) # k [m2] permeability
K = k*999.97*9.8/(1e-3)
K = np.nanmean(K)
# k = np.nanmean(k)
# K = k*999.97*9.8/(1e-3) # K [m/s] hydraulic conductivity
K = K*1e2*24*3600
self.k_glhymps = K
## From original BDLisa and BRGM files using clip function
......
......@@ -13,7 +13,7 @@ import pandas as pd
# **************************** Data *****************************
# Watersheds
shp_watersheds_path = 'C:/Users/laura.lindeperg/Documents/DonneesLaura/Watersheds/complete_df_wrong_geometries.shp'
shp_watersheds_path = 'C:/Users/laura.lindeperg/Documents/DonneesLaura/Watersheds/616_Catchments.shp'
shp_foldername = 'C:/Users/laura.lindeperg/Documents/DonneesLaura/Watersheds/GEOMETRY/'
shp_watersheds = gpd.read_file(shp_watersheds_path)
......@@ -33,7 +33,8 @@ SAT_foldername = 'C:/Users/laura.lindeperg/Documents/DonneesLaura/Watersheds/GEO
# FC - Water retention of topsoil: water content at field capacity - cm3/cm3 no units
FC_foldername = 'C:/Users/laura.lindeperg/Documents/DonneesLaura/Watersheds/GEOL/JRC-ESDAC/FC/'
#GLHYMPS
GLHYMPS_foldername = 'C:/Users/laura.lindeperg/Documents/DonneesLaura/Watersheds/GEOL/GLHYMPS/'
# List of the stations'codes
watershed_code = shp_watersheds.loc[:,'Code']
......@@ -50,15 +51,17 @@ geol_indicators = pd.DataFrame()
# for i in code_for_test:
for i in watershed_code:
watershed_contour_i = gpd.read_file(shp_foldername+i+'.shp')
BDLisa_i = gpd.read_file(BDLisa_filepath+i+'_BDLisa.shp')
ks_i = rxr.open_rasterio(KS_foldername+i+'_KS.tif')
sat_i = rxr.open_rasterio(SAT_foldername+i+'_SAT.tif')
fc_i = rxr.open_rasterio(FC_foldername+i+'_FC.tif')
# BDLisa_i = gpd.read_file(BDLisa_filepath+i+'_BDLisa.shp')
# ks_i = rxr.open_rasterio(KS_foldername+i+'_KS.tif')
# sat_i = rxr.open_rasterio(SAT_foldername+i+'_SAT.tif')
# fc_i = rxr.open_rasterio(FC_foldername+i+'_FC.tif')
glhymps_i = gpd.read_file(GLHYMPS_foldername+i+'_GLHYMPS.shp')
geol_i = GeologicProperties(i)
geol_i.extract_main_geology(BDLisa_i)
geol_i.extract_average_age_geology(BRGM_filepath+i+'_BRGM.shp')
geol_i.compute_hydraulic_properties(ks_i, sat_i, fc_i)
# geol_i.extract_main_geology(BDLisa_i)
# geol_i.extract_average_age_geology(BRGM_filepath+i+'_BRGM.shp')
# geol_i.compute_hydraulic_properties(ks_i, sat_i, fc_i)
geol_i.extract_K_GLHYMPS(glhymps_i)
geol_indicators = geol_indicators.append(geol_i.__dict__, ignore_index=True)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment