From 426efa49cce32d4b8d7c31fd4ae4cc9e47c9402e Mon Sep 17 00:00:00 2001 From: Laura LINDEPERG <laura.lindeperg@irstea.priv> Date: Wed, 14 Apr 2021 16:16:07 +0200 Subject: [PATCH] Minor changes --- clip_RequiredData.py | 6 ++++-- experiments_and_tests.py | 9 ++++++--- extract_HydroSig.py | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/clip_RequiredData.py b/clip_RequiredData.py index cbb5a93..c86f5d7 100644 --- a/clip_RequiredData.py +++ b/clip_RequiredData.py @@ -170,11 +170,13 @@ watershed_code = shp_watersheds.loc[:,'Code'] # watershed_code_IV = shp_BV_IV.loc[shp_BV_IV.loc[:,'Code'].isin(watershed_code)].loc[:, 'Code'] # Get a sample of them for test -code_for_test = watershed_code.loc[0:3] +code_for_test = watershed_code.loc[580:] # code_for_test = ['K9341810'] # code_for_test = ['J4742020'] +## TOPOGRAPHY +# BDAlti 25m for i in code_for_test: # for i in watershed_code: @@ -184,7 +186,7 @@ for i in code_for_test: raster_BDAlti = BDAlti_map.rio.clip(shp_contour_i.geometry.apply(mapping), shp_contour_i.crs) - raster_BDAlti.rio.to_raster('C:/Users/laura.lindeperg/Documents/DonneesLaura/Watersheds/TOPO/BDAlti_25m/'+i+'_BDAlti.tif') + raster_BDAlti.rio.to_raster('C:/Users/laura.lindeperg/Documents/DonneesLaura/Watersheds/TOPO/BDAlti_25m/'+i+'_BDAlti_25m.tif') ## Soil hydraulic properties diff --git a/experiments_and_tests.py b/experiments_and_tests.py index c37d157..d91afbe 100644 --- a/experiments_and_tests.py +++ b/experiments_and_tests.py @@ -32,6 +32,9 @@ bv_for_test_path = 'C:/Users/laura.lindeperg/Documents/DonneesLaura/Watersheds/G bv_for_test = gpd.read_file(bv_for_test_path) +## BDAlti 25m +BDAlti_path = 'C:/Users/laura.lindeperg/Documents/DonneesLaura/Watersheds/TOPO/BDAlti_25m/J4742020_BDAlti_25m.tif' +BDAlti_test = rxr.open_rasterio(BDAlti_path).squeeze() ## BDTopage @@ -143,7 +146,7 @@ FC_bv_test = extract_mean_hydraulic_property(FC_test) -# classesO, countsO = np.unique(ZHp_map, return_counts=True) +classesO, countsO = np.unique(BDAlti_test, return_counts=True) # ZHp_test.rio.resolution() # BV_W3315010.geometry.area @@ -172,11 +175,11 @@ plt.show() -ZHp_test.plot.hist() +BDAlti_test.plot.hist() plt.show() f, ax = plt.subplots(figsize=(10, 4)) -ZHp_test.plot(ax=ax, +BDAlti_test.plot(ax=ax, cmap='Greys') ax.set(title="Final Clipped ZHp") ax.set_axis_off() diff --git a/extract_HydroSig.py b/extract_HydroSig.py index 0dac6eb..4444778 100644 --- a/extract_HydroSig.py +++ b/extract_HydroSig.py @@ -12,7 +12,7 @@ from Watershed import Watershed -computer = 'jean' +computer = 'Laura' # **************************** Data ***************************** if(computer == 'laura'): # Banque Hydro -- GitLab