Commit 96b307f2 authored by Laura LINDEPERG's avatar Laura LINDEPERG
Browse files

Clean code

parent c0924b3a
No related merge requests found
Showing with 7 additions and 6 deletions
+7 -6
...@@ -40,7 +40,8 @@ shp_contour = gpd.read_file(shp_contour_filepath) ...@@ -40,7 +40,8 @@ shp_contour = gpd.read_file(shp_contour_filepath)
watershed_code = df_stations.loc[:,'Code'] watershed_code = df_stations.loc[:,'Code']
# Get a sample of them for test # Get a sample of them for test
code_for_test = watershed_code.loc[1:2] code_for_test = watershed_code.loc[1:2]
# code_for_test = ['A1080330'] # code_for_test = ['A1072010', 'A1080330']
# code_for_test = ['A1072010', 'A1080330', 'A3472010', 'I0102010', 'J3413030']
# # extract safran gpd # # extract safran gpd
# from HydroClimaticFluxes import HydroClimaticFluxes # from HydroClimaticFluxes import HydroClimaticFluxes
...@@ -57,7 +58,7 @@ code_for_test = watershed_code.loc[1:2] ...@@ -57,7 +58,7 @@ code_for_test = watershed_code.loc[1:2]
studied_watersheds = pd.DataFrame() studied_watersheds = pd.DataFrame()
for i in code_for_test: for i in code_for_test:
#for i in watershed_code: #for i in watershed_code:
print(i)
# Get the station's name # Get the station's name
watershed_stations_i = df_stations[df_stations.loc[:, 'Code'] == i] watershed_stations_i = df_stations[df_stations.loc[:, 'Code'] == i]
watershed_name_i = watershed_stations_i.loc[:, 'Nom'].values[0] watershed_name_i = watershed_stations_i.loc[:, 'Nom'].values[0]
...@@ -66,18 +67,18 @@ for i in code_for_test: ...@@ -66,18 +67,18 @@ for i in code_for_test:
watershed_i = Watershed(i, watershed_name_i) watershed_i = Watershed(i, watershed_name_i)
watershed_i.extract_watershed_contour_from_filename(shp_contour_filepath, 'Code') watershed_i.extract_watershed_contour_from_filename(shp_contour_filepath, 'Code')
watershed_i.extract_banquehydro_discharge_timeseries(banquehydro_foldername) watershed_i.extract_banquehydro_discharge_timeseries(banquehydro_foldername)
# watershed_i.extract_SAFRAN_forcings(safran_foldername, safran_grid_shpfilename) # watershed_i.extract_SAFRAN_forcings(safran_foldername, safran_grid_shpfilename)
# watershed_i.hydro_climatic_fluxes.intersect_safran_gpd_and_contour(Ptot_gpd, watershed_i.contour,'Ptot') # watershed_i.hydro_climatic_fluxes.intersect_safran_gpd_and_contour(Ptot_gpd, watershed_i.contour,'Ptot')
# watershed_i.hydro_climatic_fluxes.intersect_safran_gpd_and_contour(ET0_gpd, watershed_i.contour, 'ET0') # watershed_i.hydro_climatic_fluxes.intersect_safran_gpd_and_contour(ET0_gpd, watershed_i.contour, 'ET0')
# watershed_i.hydro_climatic_fluxes.intersect_safran_gpd_and_contour(Tair_gpd, watershed_i.contour, 'Tair') # watershed_i.hydro_climatic_fluxes.intersect_safran_gpd_and_contour(Tair_gpd, watershed_i.contour, 'Tair')
# watershed_i.hydro_climatic_fluxes.intersect_safran_gpd_and_contour(Snow_gpd, watershed_i.contour, 'Snow') # watershed_i.hydro_climatic_fluxes.intersect_safran_gpd_and_contour(Snow_gpd, watershed_i.contour, 'Snow')
# watershed_i.hydro_climatic_fluxes.intersect_safran_gpd_and_contour(Rain_gpd, watershed_i.contour, 'Rain') # watershed_i.hydro_climatic_fluxes.intersect_safran_gpd_and_contour(Rain_gpd, watershed_i.contour, 'Rain')
# watershed_i.hydro_climatic_fluxes.safran_timeseries['Ptot'] = watershed_i.hydro_climatic_fluxes.safran_timeseries['Snow'] + watershed_i.hydro_climatic_fluxes.safran_timeseries['Rain'] # watershed_i.hydro_climatic_fluxes.safran_timeseries['Ptot'] = watershed_i.hydro_climatic_fluxes.safran_timeseries['Snow'] + watershed_i.hydro_climatic_fluxes.safran_timeseries['Rain']
safran_timeseries_i = pd.read_csv(safran_foldername+i+'_safran_timeseries.csv') safran_timeseries_i = pd.read_csv(safran_foldername+i+'_safran_timeseries.csv')
watershed_i.hydro_climatic_fluxes.safran_timeseries = safran_timeseries_i watershed_i.hydro_climatic_fluxes.safran_timeseries = safran_timeseries_i
#watershed_i.hydro_climatic_fluxes.safran_timeseries['Datetime'] = pd.Timestamp.asm8
#print(pd.api.types.is_datetime64_ns_dtype(watershed_i.hydro_climatic_fluxes.safran_timeseries['Datetime']))
#print(pd.api.types.is_datetime64_ns_dtype(watershed_i.hydro_climatic_fluxes.discharge_timeseries['Datetime']))
watershed_i.extract_hydrological_signatures() watershed_i.extract_hydrological_signatures()
watershed_i.extract_geologic_properties_from_filename(BDLisa_shp) watershed_i.extract_geologic_properties_from_filename(BDLisa_shp)
watershed_i.geologic_properties.extract_average_age_geology(BRGM_geol_map, watershed_i.contour) watershed_i.geologic_properties.extract_average_age_geology(BRGM_geol_map, watershed_i.contour)
......
Supports Markdown
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