cell_attrs_tot_num_bdgs, bdg_classes_names, bdg_classes_proportions, bdg_classes_proportions_per_admin, list_of_cols_of_country_adminIDs, list_of_country_adminIDs: all retrieved using the
function "retrieve_sera_hdf5_classes_and_vals" for the total of a cell (i.e. in_admin_id='Total').
cost_per_area_field: name of the field that contains the cost per area (e.g., 'cost_per_area_eur', 'cost_per_area_usd')
No assessment of the admin units and/or countries involved in the cell is made.
else:# this can happen because the SERA array might contain bdg classes that are only in one of the adm units it has, and in this case the function retrieve_parameters_for_taxonomy will not be able to provide values for classes in adm units that do not occur together
if(col!='buildings')and(col!='occupants_per_asset')and(col!='dwellings')and(col!='total_repl_cost_usd'):# col=='occupants_per_asset' and col=='dwellings' should not happen, written this way just in case we change our minds later
if(col!='buildings')and(col!='occupants_per_asset')and(col!='dwellings')and(col!='total_repl_cost_usd')and(col!='total_repl_cost_eur'):# col=='occupants_per_asset' and col=='dwellings' should not happen, written this way just in case we change our minds later
arr_floats[t,k]=in_df[col].values[which_t[j]]# values will be overwritten but they should be the same
log.append(' NO SERA BUILDINGS FOUND FOR CELL ID '+str(grid_cell_id)+' FROM '+os.path.join(out_path,'Europe_SERA_cells_'+sera_disaggregation_to_consider+'_'+case+'.hdf5'))
# Columns to distribute (TO DO: provide better description of this parameter):
columns_to_distribute=config_dict['SERA_distributing_exposure_to_cells']['columns_to_distribute'].split(', ')# ['buildings','dwell_per_bdg','area_per_dwelling_sqm','cost_per_area_usd','ppl_per_dwell'] # OLD VERSION (OQ files): columns_to_distribute=['number','structural','night']
This code carries out the following checks on the costs reported in the SERA model (full files):
CHECK 01
Is the “structural” column of the OpenQuake CSV the same as the “total_repl_cost_usd” column of the full CSV?
Is the “structural” column of the OpenQuake CSV the same as the “total_repl_cost” column of the full CSV?
CHECK 02
Is the “total_repl_cost_usd” column of the full CSV the same as the product of the columns “area_per_dwelling_sqm” by “cost_per_area_usd” by (“buildings” for Com/Ind or “dwellings” for Res)?
Is the “total_repl_cost” column of the full CSV the same as the product of the columns “area_per_dwelling_sqm” by “cost_per_area” by (“buildings” for Com/Ind or “dwellings” for Res)?
CHECK 03
Same as CHECK 02 but in Euros instead of USD.
Deprecated.
CHECK 04
Is the “total_repl_cost_usd” column of the full CSV the same as the sum of the columns “cost_structural_usd” plus “cost_nonstructural_usd” plus “cost_contents_usd”?
Is the “total_repl_cost” column of the full CSV the same as the sum of the columns “cost_structural” plus “cost_nonstructural” plus “cost_contents”?