Commit f39a2fb7 authored by Laura LINDEPERG's avatar Laura LINDEPERG
Browse files

drainage porosity and order 1 ratio updates

parent 4d2cd15e
......@@ -27,7 +27,10 @@ BRGM_filepath = 'C:/Users/laura.lindeperg/Documents/DonneesLaura/Watersheds/GEOL
# KS - Saturated hydraulic conductivity of topsoil - log10(cm/day)
KS_foldername = 'C:/Users/laura.lindeperg/Documents/DonneesLaura/Watersheds/GEOL/JRC-ESDAC/KS/'
# FC - Water retention of topsoil: water content at field capacity
# SATURATED - Water retention of topsoil: saturated water content - cm3/cm3 no units
SAT_foldername = 'C:/Users/laura.lindeperg/Documents/DonneesLaura/Watersheds/GEOL/JRC-ESDAC/SAT/'
# 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/'
......@@ -49,14 +52,15 @@ 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')
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, fc_i)
geol_i.compute_hydraulic_properties(ks_i, sat_i, fc_i)
geol_indicators = geol_indicators.append(geol_i.__dict__, ignore_index=True)
# And save it
# geol_indicators.to_csv('613_stations_geol_df.csv', index=False)
# geol_indicators.to_csv('616_stations_geol_df.csv', index=False)
......@@ -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)
......@@ -27,8 +27,8 @@ ZHp_foldername = 'C:/Users/laura.lindeperg/Documents/DonneesLaura/Watersheds/GEO
## BDTopage
topage_foldername = 'C:/Users/laura.lindeperg/Documents/DonneesLaura/Watersheds/GEOMORPHO/BDTopage/'
## BDCarthage
carthage_foldername = 'C:/Users/laura.lindeperg/Documents/DonneesLaura/Watersheds/GEOMORPHO/BDCarthage/'
# ## BDCarthage
# carthage_foldername = 'C:/Users/laura.lindeperg/Documents/DonneesLaura/Watersheds/GEOMORPHO/BDCarthage/'
## BDAlti 25m
bdalti_foldername = 'C:/Users/laura.lindeperg/Documents/DonneesLaura/Watersheds/GEOMORPHO/BDAlti_25m/'
......@@ -49,21 +49,28 @@ code_for_test = watershed_code.loc[0:3]
from GeomorphologicProperties import GeomorphologicProperties
geomorpho_indicators = pd.DataFrame()
for i in code_for_test:
# for i in watershed_code:
# for i in code_for_test:
for i in watershed_code:
watershed_contour_i = gpd.read_file(shp_foldername+i+'.shp')
ZHp_i = rxr.open_rasterio(ZHp_foldername+i+'_ZHp.tif')
hydro_sections_Topage_i = gpd.read_file(topage_foldername+i+'_BDTopage.shp')
hydro_sections_Carthage_i = gpd.read_file(carthage_foldername+i+'_BDCarthage.shp')
# hydro_sections_Carthage_i = gpd.read_file(carthage_foldername+i+'_BDCarthage.shp')
bdalti_i = rxr.open_rasterio(bdalti_foldername+i+'_BDAlti_25m.tif')
slope_i = rxr.open_rasterio(slope_foldername+i+'_slope_25m.tif')
geomorpho_i = GeomorphologicProperties(i)
# geomorpho_i.compute_ZHp_ratio(ZHp_i)
geomorpho_i.extract_geomorphologic_properties(watershed_contour_i, ZHp_i, hydro_sections_Topage_i, hydro_sections_Carthage_i)
geomorpho_i.extract_geomorphologic_properties(watershed_contour_i, ZHp_i, hydro_sections_Topage_i)
geomorpho_i.extract_mean_elevation(bdalti_i)
geomorpho_i.extract_median_slope(slope_i)
geomorpho_indicators = geomorpho_indicators.append(geomorpho_i.__dict__, ignore_index=True)
# And save it
# geomorpho_indicators.to_csv('616_stations_geomorpho_df.csv', index=False)
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