meas_fwd_data = pyres_utils.load_fwd_output(work_dir=work_dir) inv_protocol_dict = {'meas_data':meas_fwd_data} run_inv_r2_dict = {'protocol_dict':inv_protocol_dict, 'r2_in_dict':inv_r2_in_dict, 'run_bool':True} iR2_inv.run_all(**run_inv_r2_dict) #%% # Plot inverse model results plot_dict = {'work_dir':inv_work_dir, 'topog_xy':np.column_stack([xx_mesh,topog]), 'plt_opts':{'vmin':10**1.3,'vmax':10.**2}, 'invert_y':False, 'cmap':'rainbow','keep_log':True} fig,ax,[X,Y,ER] = plot_utils.plot_res(**plot_dict) ax.plot(electrode_x,topo_func(4.8/electrode_x[-1],electrode_x,0.),'k.-') # Plot target txy = np.array(target_xypos) txy = np.vstack([txy,txy[0,:]]) topo_y = pyres_utils.extrap(txy[:,0],xx_mesh,topog) ax.plot(txy[:,0],topo_y-txy[:,1],'k-') #%% Compare performance of inversion # Define normalized misfit equation errfunc = lambda obs,mod: (obs-mod)/obs obs_array = np.log10(main_res)*np.ones_like(ER) target_bool = (X>=txy[0,0]) & (X<=txy[1,0]) &\
#%% # Plot % difference of inverse model results plot_dict = { 'fname': os.path.join(inv_work_dir, 'f001_diffres.dat'), 'inv_col': 2, 'plt_opts': { 'vmin': -1e2, 'vmax': 1e2, 'aspect': 2 }, 'invert_y': False, 'nxny': [5e2, 1e2], 'cmap': 'rainbow', 'keep_log': False } fig, ax, _ = plot_utils.plot_res(**plot_dict) # Plot results of difference inversion for time 2 plot_dict = { 'work_dir': inv_work_dir, 'plt_opts': { 'vmin': 10**1.3, 'vmax': 10.**2, 'aspect': 2 }, 'invert_y': False, 'nxny': [5e2, 1e2], 'cmap': 'rainbow', 'keep_log': True } fig, ax, _ = plot_utils.plot_res(**plot_dict)
#%% ################## Plot inverse model results ################## plot_dict = { 'work_dir': work_dir, 'method': 'linear', 'topog_xy': mr2.topo_xyz, 'plt_opts': { 'vmin': 1.5, 'vmax': 200., 'ticks': [1.5, 5, 10, 50, 100, 200.] }, 'invert_y': False, 'cmap': 'rainbow', 'keep_log': False } fig, ax, [X, Y, ER] = plot_utils.plot_res(**plot_dict) c1 = ax.contour(X, Y, ER, [5, 10, 50, 100], colors='k') plot_utils.plt.clabel(c1, inline=0, fontsize=10, fmt='%3.1f') #ax.set_ylim([-6,2]) #ax.set_xlim([0,68.75]) #%% ################## Plot model sensitivity results ################## plot_dict = { 'fname': os.path.join(work_dir, 'f001_sen.dat'), 'method': 'linear', 'topog_xy': mr2.topo_xyz, 'plt_opts': { 'vmin': 1e-6, 'vmax': 1e1 }, 'invert_y': False,