Commit 2900fab1 authored by Cecilia Nievas's avatar Cecilia Nievas
Browse files

Variable was misnamed after adapting code to running with config file

parent 1f1e87a7
......@@ -74,6 +74,8 @@ def run_this_file(config_dict):
out_name= 'exposure_grid_'+param_for_weighting+'_'+str(out_pd['cell_id'].values[0])+'_'+str(out_pd['cell_id'].values[-1])
elif grid_cells_def_method=='arbitrary':
out_name= 'exposure_grid_'+param_for_weighting+'_'+str(out_pd['cell_id'].values[0])+'_'+str(out_pd['cell_id'].values[-1])
elif grid_cells_def_method=='random_from_country':
out_name= 'exposure_grid_'+param_for_weighting+'_'+config_dict['Cells to Process']['country_name']+'_random'
else:
print('ERROR!!! METHOD FOR DEFINING LIST OF CELL IDs UNKNOWN. ERROR!!!')
# Add the current time to the out_name string:
......@@ -162,18 +164,20 @@ def run_this_file(config_dict):
print('\n')
print('Summary:')
out_csv= open(os.path.join(out_path, 'export_grids_QGIS', out_name+'_summary.txt'), "w")
if method=='country_in_DB':
if grid_cells_def_method=='country_in_DB':
out_csv.write('Country: '+country_name+'\n')
elif method=='admin_ID_in_country':
elif grid_cells_def_method=='admin_ID_in_country':
out_csv.write('Country: '+country_name+'\n')
out_csv.write('Admin ID in country: '+str(admin_id_in_country)+'\n')
elif method=='bbox':
elif grid_cells_def_method=='random_from_country':
out_csv.write(config_dict['Cells to Process']['num_random_cells']+' random cells selected from country: '+country_name+'\n')
elif grid_cells_def_method=='bbox':
out_csv.write('Bounding box used:\n')
out_csv.write('South-West Longitude: '+'{:.5f}'.format(bb_sw_lon)+'\n')
out_csv.write('South-West Latitude: '+'{:.5f}'.format(bb_sw_lat)+'\n')
out_csv.write('North-East Longitude: '+'{:.5f}'.format(bb_ne_lon)+'\n')
out_csv.write('North-East Latitude: '+'{:.5f}'.format(bb_ne_lat)+'\n')
elif method=='arbitrary':
elif grid_cells_def_method=='arbitrary':
out_csv.write('Arbitrary list of cells used:\n')
out_str= []
for cell_id in arbitr_list:
......
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