Commit 43910cc8 authored by Laura LINDEPERG's avatar Laura LINDEPERG
Browse files

Add drainage porosity

parent f1989f34
......@@ -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, fc=-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):
self.code = code
self.maingeol_id = maingeol_id
self.maingeol_description = maingeol_description
......@@ -13,7 +13,7 @@ class GeologicProperties(object):
self.maingeol_age = maingeol_age
self.maingeol_age_proportion = maingeol_age_proportion
self.ks = ks
self.fc = fc
self.theta_d = theta_d
def extract_main_geology_from_filename(self, geol_foldername, catchment_contour_shp):
geol_shp = gpd.read_file(geol_foldername)
......@@ -55,15 +55,20 @@ class GeologicProperties(object):
ValAndCounts = ValAndCounts[ValAndCounts.loc[:, 'Values'] != -1.7e+308] # remove pixels outside the studied area (value -1.7e+308)
weight = ValAndCounts.Counts/(ValAndCounts.Counts.sum())
average = (ValAndCounts.Values*weight).sum()
return average
return average
def compute_drainage_porosity(self, saturated_water_content_map, field_capacity_map):
theta_s = self.extract_mean_hydraulic_property(saturated_water_content_map)
theta_fc = self.extract_mean_hydraulic_property(field_capacity_map)
self.theta_d = theta_s-theta_fc
def compute_KS_mean(self, hydraulic_property_map):
KS_mean_log10 = self.extract_mean_hydraulic_property(hydraulic_property_map)
self.ks = pow(10,KS_mean_log10)
def compute_hydraulic_properties(self, ks_map, fc_map):
def compute_hydraulic_properties(self, ks_map, sat_map, fc_map):
self.compute_KS_mean(ks_map)
self.fc = self.extract_mean_hydraulic_property(fc_map)
self.compute_drainage_porosity(sat_map, fc_map)
......
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