Пример #1
0
haz_real.check()
haz_synth.check()

if plot_img:
    haz_real.plot_intensity(event=0)
    haz_real.plot_fraction(event=0)

#%% Impact_function
# Set impact function (see tutorial climada_entity_ImpactFuncSet)
ifset_hail = ImpactFuncSet()
for imp_fun_dict in imp_fun_parameter:
    imp_fun = fct.create_impact_func(haz_type, imp_fun_dict["imp_id"],
                                     imp_fun_dict["L"], imp_fun_dict["x_0"],
                                     imp_fun_dict["k"])
    ifset_hail.append(imp_fun)
ifset_hail.plot()

#%% Exposure

exp_infr = fct.load_exp_infr(force_new_hdf5_generation, name_hdf5_file,
                             input_folder, haz_real)
exp_meshs = fct.load_exp_agr(force_new_hdf5_generation, name_hdf5_file,
                             input_folder, haz_real)
exp_dur = exp_meshs.copy()
exp_dur["if_HL"] = exp_dur[
    "if_HL"] + 3  #change if_HL to match the corresponding imp_id
if plot_img:
    exp_infr.plot_basemap()
    #This takes to long. Do over night!!!
    #exp_agr.plot_basemap()
Пример #2
0
    imp_fun = fct.create_impact_func(haz_type, imp_fun_dict["imp_id"],
                                     imp_fun_dict["L"], imp_fun_dict["x_0"],
                                     imp_fun_dict["k"])
    imp_fun.mdd[:] = 0.1
    ifset_hail.append(imp_fun)

if True:  #plot_img:
    axis = None
    if True:
        num_plts = ifset_hail.size()
        num_row, num_col = u_plot._get_row_col_size(num_plts)
        _, axis = plt.subplots(num_row, num_col)
        for ax in axis:
            ax.set_ylim([9.5, 10.5])
#    ifset_hail.plot(axis = axis)
    ifset_hail.plot(axis=axis)
#%% Exposure
exp_infr_meshs = fct.load_exp_infr(force_new_hdf5_generation, name_hdf5_file,
                                   input_folder, haz_real)
exp_infr_dur = exp_infr_meshs.copy()
exp_infr_dur["if_HL"] = 8  #change if_HL to match the corresponding imp_id
if plot_img:
    exp_infr_meshs.plot_basemap()
    exp_infr_meshs.plot_hexbin()
    exp_infr_meshs.plot_scatter()
    exp_infr_meshs.plot_raster()

#%% Impact
imp_infr_meshs = Impact()
imp_infr_meshs.calc(exp_infr_meshs, ifset_hail, haz_real, save_mat=True)
# imp_infr.plot_raster_eai_exposure()