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

Minor changes

parent d4100465
......@@ -22,11 +22,20 @@ shp_foldername = 'C:/Users/laura.lindeperg/Documents/DonneesLaura/Watersheds/GEO
shp_watersheds = gpd.read_file(shp_watersheds_path)
rrse_241_path = 'C:/Users/laura.lindeperg/Documents/DonneesLaura/STATIONS/Stations241_RRSE.csv'
rrse_241 = pd.read_csv(rrse_241_path)
# List of the stations'codes
watershed_code = shp_watersheds.loc[:,'Code']
# Get a sample of them for test
code_for_test = watershed_code.loc[0:3]
rrse_241 = rrse_241.rename(columns = {'RRSE':'Code'})
rrse_241 = rrse_241.loc[:, 'Code']
shared_codes = rrse_241.loc[rrse_241.isin(watershed_code) == True]
bv_for_test_path = 'C:/Users/laura.lindeperg/Documents/DonneesLaura/Watersheds/GEOMETRY/J4742020.shp'
bv_for_test = gpd.read_file(bv_for_test_path)
......
......@@ -12,7 +12,7 @@ from Watershed import Watershed
import pickle
computer = 'Laura'
computer = 'laura'
# **************************** Data *****************************
if(computer == 'laura'):
# Banque Hydro
......@@ -43,9 +43,9 @@ shp_watersheds = gpd.read_file(shp_watersheds_path)
# List of the stations'codes
watershed_code = shp_watersheds.loc[:,'Code']
# Get a sample of them for test
# code_for_test = watershed_code.loc[0:2]
code_for_test = watershed_code.loc[402:]
# code_for_test = ['V1015810']
code_for_test = ['V2814020', 'V5045020', 'H4033010', 'S4214010']
# code_for_test = ['V2814020', 'V5045020', 'H4033010', 'S4214010']
# code_for_test = ['E6456510', 'A7642010']
# *************************** Extract watersheds' properties ************************************
......@@ -78,14 +78,15 @@ for i in code_for_test:
studied_watersheds = studied_watersheds.append(watershed_dict, ignore_index=True)
# save object using pickle
filename_i = 'C:/Users/laura.lindeperg/Documents/INRAE_2021/CODE/fhysa/Object_watershed/watershed_'+i
# filename_i = 'C:/Users/laura.lindeperg/Documents/INRAE_2021/CODE/fhysa/Object_watershed/watershed_'+i
filename_i = 'C:/Users/laura.lindeperg/Documents/INRAE_2021/CODE/fhysa/Object_watershed/Adim/watershed_adim_'+i
outfile_i = open(filename_i, 'wb')
pickle.dump(watershed_i, outfile_i)
outfile_i.close()
# And save it
# studied_watersheds.to_csv('613_stations_hydrosig_df.csv', index=False)
# studied_watersheds.to_csv('616_stations_hydrosig_df.csv', index=False)
## Open stored watershed objects
# i = code_for_test[0]
......
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