Commit bde0a8fb authored by Laura LINDEPERG's avatar Laura LINDEPERG
Browse files
parents cf904dbe 19597db9
......@@ -42,17 +42,21 @@ class Watershed(object):
from HydroClimaticFluxes import HydroClimaticFluxes
self.hydro_climatic_fluxes.extract_safran_timeseries_from_contour(foldername, self.contour)
def extract_hydrological_signatures(self, option='all'):
def extract_hydrological_signatures(self, option='all', adimensioned='no'):
from HydrologicalSignatures import HydrologicalSignatures
self.hydrological_signatures = HydrologicalSignatures()
df_discharge = self.hydro_climatic_fluxes.discharge_timeseries
if(adimensioned=='yes'):
from numpy import nanmedian
df_discharge.Q = df_discharge.Q/nanmedian(df_discharge.Q)
if (option == 'all'):
self.hydrological_signatures.from_discharge_time_series(self.hydro_climatic_fluxes.discharge_timeseries,'Q')
self.hydrological_signatures.from_discharge_time_series(df_discharge,'Q')
df_obs_mod = self.hydro_climatic_fluxes.merge_time_series(merging_option='inner')
self.hydrological_signatures.from_discharge_and_climate_time_series(df_obs_mod, 'Q', 'Ptot')
self.hydrological_signatures.from_climate_time_series(self.hydro_climatic_fluxes.safran_timeseries,
'Ptot', 'ET0')
elif (option=='discharge_based'):
self.hydrological_signatures.from_discharge_time_series(self.hydro_climatic_fluxes.discharge_timeseries,'Q')
self.hydrological_signatures.from_discharge_time_series(df_discharge,'Q')
def extract_geologic_properties_from_filename(self, geol_foldername):
geol_shp = gpd.read_file(geol_foldername)
......
......@@ -12,23 +12,31 @@ from Watershed import Watershed
computer = 'jean'
# **************************** Data *****************************
if(computer == 'laura'):
# Banque Hydro
banquehydro_foldername = 'C:/Users/laura.lindeperg/Documents/DonneesLaura/BanqueHydro/Export2020/'
# SAFRAN
safran_foldername = 'C:/Users/laura.lindeperg/Documents/DonneesLaura/Watersheds/SAFRAN/'
# GEOL
BDLisa_filepath = 'C:/Users/laura.lindeperg/Documents/DonneesLaura/Watersheds/GEOL/BDLisa/'
BRGM_filepath = 'C:/Users/laura.lindeperg/Documents/DonneesLaura/Watersheds/GEOL/BRGM/'
# Watersheds
shp_watersheds_path = 'C:/Users/laura.lindeperg/Documents/DonneesLaura/Watersheds/complete_df_wrong_geometries.shp'
shp_foldername = 'C:/Users/laura.lindeperg/Documents/DonneesLaura/Watersheds/GEOMETRY/'
elif(computer== 'jean'):
# Banque Hydro
banquehydro_foldername = '/home/jean.marcais/Donnees/BanqueHydro/' #'/media/jean.marcais/My Passport/DonneesLaura/BanqueHydro/Export2020/'
# SAFRAN
safran_foldername = '/home/jean.marcais/Donnees/DonneesLaura/Watersheds/SAFRAN/' #'/media/jean.marcais/My Passport/DonneesLaura/SAFRAN/daily/'
# GEOL
BDLisa_filepath = '/home/jean.marcais/Donnees/DonneesLaura/Watersheds/GEOL/BDLisa/'
BRGM_filepath = '/home/jean.marcais/Donnees/DonneesLaura/Watersheds/GEOL/BRGM/'
# Watersheds
shp_watersheds_path = '/home/jean.marcais/Donnees/DonneesLaura/Watersheds/complete_df_wrong_geometries.shp'
shp_foldername = '/home/jean.marcais/Donnees/DonneesLaura/Watersheds/GEOMETRY/'
# Banque Hydro
banquehydro_foldername = 'C:/Users/laura.lindeperg/Documents/DonneesLaura/BanqueHydro/Export2020/'
# SAFRAN
safran_foldername = 'C:/Users/laura.lindeperg/Documents/DonneesLaura/Watersheds/SAFRAN/'
# GEOL
BDLisa_filepath = 'C:/Users/laura.lindeperg/Documents/DonneesLaura/Watersheds/GEOL/BDLisa/'
BRGM_filepath = 'C:/Users/laura.lindeperg/Documents/DonneesLaura/Watersheds/GEOL/BRGM/'
# Watersheds
shp_watersheds_path = 'C:/Users/laura.lindeperg/Documents/DonneesLaura/Watersheds/complete_df_wrong_geometries.shp'
shp_foldername = 'C:/Users/laura.lindeperg/Documents/DonneesLaura/Watersheds/GEOMETRY/'
shp_watersheds = gpd.read_file(shp_watersheds_path)
......@@ -42,6 +50,7 @@ code_for_test = watershed_code.loc[0:2]
# problematic_watersheds = pd.DataFrame()
studied_watersheds = pd.DataFrame()
for i in code_for_test:
# for i in watershed_code:
# Get the station's name
......@@ -56,7 +65,7 @@ for i in code_for_test:
watershed_i.extract_banquehydro_discharge_timeseries(banquehydro_foldername)
safran_timeseries_i = pd.read_csv(safran_foldername+i+'_safran_timeseries.csv')
watershed_i.hydro_climatic_fluxes.safran_timeseries = safran_timeseries_i
watershed_i.extract_hydrological_signatures()
watershed_i.extract_hydrological_signatures(adimensioned='yes')
# watershed_i.extract_geologic_properties_from_filename(BDLisa_filepath+i+'_BDLisa.shp')
# watershed_i.geologic_properties.extract_average_age_geology(BRGM_filepath+i+'_BRGM.shp')
......
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