Commit 94d26fa3 authored by Cecilia Nievas's avatar Cecilia Nievas
Browse files

full_files set to True when calling get_admin_level_definition in...

full_files set to True when calling get_admin_level_definition in SERA_mapping_admin_units_to_cells; full_files made explicit input parameter of give_totals_SERA_per_country in GDE_TOOLS_read_SERA
parent c3978f5b
......@@ -225,8 +225,8 @@ def check_number_points_per_admin_level(country_name, path):
return exposure_cases, actual_levels_list, have_one_point_per_ID
def give_totals_SERA_per_country(country_name, path, cols_to_add=['number','structural','night'], output_dfs=False):
_, _, _, df= get_admin_level_definition(country_name, path, output_dfs=True)
def give_totals_SERA_per_country(country_name, path, cols_to_add=['number','structural','night'], full_files=False, output_dfs=False):
_, _, _, df= get_admin_level_definition(country_name, path, output_dfs=True, full_files=full_files)
for case in ['Res','Com','Ind']:
for col in cols_to_add:
print(country_name+', '+case+', '+col+': '+'{:,.2f}'.format(df[case][col].values.sum()))
......
......@@ -67,7 +67,7 @@ def run_this_file(config_dict):
print('\n')
print('Working on '+country_name+', country '+str(k+1)+' of '+str(len(countries))+'\n')
# There is repetition of admin levels across Res/Com/Ind. I pre-analyse the case so as to carry out spatial intersections only once.
admin_levels, level_groups, level_groups_levels, dfs_dict= gdet_sera.get_admin_level_definition(country_name, sera_models_path, output_dfs=True)
admin_levels, level_groups, level_groups_levels, dfs_dict= gdet_sera.get_admin_level_definition(country_name, sera_models_path, full_files = True, output_dfs=True)
for j in range(0,len(level_groups)): # Group of any combination of Res/Com/Ind with the same admin level definition (given by level_groups_levels)
try:
adm_boundary = gpd.GeoDataFrame.from_file(os.path.join(sera_shp_path,'Adm'+str(level_groups_levels[j])+'_'+country_name+'.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