ind_conductor = ind_conductor[ind_active] conductivity_model[ind_conductor] = conductor_conductivity ind_resistor = model_builder.getIndicesSphere(np.r_[120.0, -100.0], 60.0, mesh.gridCC) ind_resistor = ind_resistor[ind_active] conductivity_model[ind_resistor] = resistor_conductivity # Plot Conductivity Model fig = plt.figure(figsize=(9, 4)) plotting_map = maps.InjectActiveCells(mesh, ind_active, np.nan) norm = LogNorm(vmin=1e-3, vmax=1e-1) ax1 = fig.add_axes([0.14, 0.17, 0.68, 0.7]) mesh.plot_image( plotting_map * conductivity_model, ax=ax1, grid=False, pcolor_opts={"norm": norm} ) ax1.set_xlim(-600, 600) ax1.set_ylim(-600, 0) ax1.set_title("Conductivity Model") ax1.set_xlabel("x (m)") ax1.set_ylabel("z (m)") ax2 = fig.add_axes([0.84, 0.17, 0.03, 0.7]) cbar = mpl.colorbar.ColorbarBase(ax2, norm=norm, orientation="vertical") cbar.set_label(r"$\sigma$ (S/m)", rotation=270, labelpad=15, size=12) plt.show() ###############################################################
ind_resistor = model_builder.getIndicesSphere(np.r_[120.0, -180.0], 60.0, mesh.gridCC) true_conductivity_model[ind_resistor] = true_resistor_conductivity true_conductivity_model[~ind_active] = np.NaN # Plot True Model norm = LogNorm(vmin=1e-3, vmax=1e-1) fig = plt.figure(figsize=(9, 4)) ax1 = fig.add_axes([0.1, 0.12, 0.72, 0.8]) im = mesh.plot_image( true_conductivity_model, ax=ax1, grid=False, range_x=[-700, 700], range_y=[-700, 0], pcolor_opts={"norm": norm}, ) ax1.set_title("True Conductivity Model") ax1.set_xlabel("x (m)") ax1.set_ylabel("z (m)") ax2 = fig.add_axes([0.83, 0.12, 0.05, 0.8]) cbar = mpl.colorbar.ColorbarBase(ax2, norm=norm, orientation="vertical") cbar.set_label("$S/m$", rotation=270, labelpad=15, size=12) plt.show() # # Plot Recovered Model fig = plt.figure(figsize=(9, 4))
conductivity_model[ind_conductor] = conductor_conductivity ind_resistor = model_builder.getIndicesSphere(np.r_[120.0, -100.0], 60.0, mesh.gridCC) ind_resistor = ind_resistor[ind_active] conductivity_model[ind_resistor] = resistor_conductivity # Plot Conductivity Model fig = plt.figure(figsize=(9, 4)) plotting_map = maps.InjectActiveCells(mesh, ind_active, np.nan) norm = LogNorm(vmin=1e-3, vmax=1e-1) ax1 = fig.add_axes([0.14, 0.17, 0.68, 0.7]) mesh.plot_image(plotting_map * conductivity_model, ax=ax1, grid=False, pcolor_opts={"norm": norm}) ax1.set_xlim(-600, 600) ax1.set_ylim(-600, 0) ax1.set_title("Conductivity Model") ax1.set_xlabel("x (m)") ax1.set_ylabel("z (m)") ax2 = fig.add_axes([0.84, 0.17, 0.03, 0.7]) cbar = mpl.colorbar.ColorbarBase(ax2, norm=norm, orientation="vertical") cbar.set_label(r"$\sigma$ (S/m)", rotation=270, labelpad=15, size=12) plt.show() ############################################################### # Project Survey to Discretized Topography
ind_conductor = model_builder.getIndicesSphere(np.r_[-120.0, -180.0], 60.0, mesh.gridCC) true_conductivity_model[ind_conductor] = true_conductor_conductivity ind_resistor = model_builder.getIndicesSphere(np.r_[120.0, -180.0], 60.0, mesh.gridCC) true_conductivity_model[ind_resistor] = true_resistor_conductivity true_conductivity_model[~ind_active] = np.NaN # Plot True Model norm = LogNorm(vmin=1e-3, vmax=1e-1) fig = plt.figure(figsize=(9, 4)) ax1 = fig.add_axes([0.14, 0.17, 0.68, 0.7]) im = mesh.plot_image( true_conductivity_model, ax=ax1, grid=False, pcolor_opts={"norm": norm} ) ax1.set_xlim(-600, 600) ax1.set_ylim(-600, 0) ax1.set_title("True Conductivity Model") ax1.set_xlabel("x (m)") ax1.set_ylabel("z (m)") ax2 = fig.add_axes([0.84, 0.17, 0.03, 0.7]) cbar = mpl.colorbar.ColorbarBase(ax2, norm=norm, orientation="vertical") cbar.set_label("$S/m$", rotation=270, labelpad=15, size=12) plt.show() # Plot Recovered Model fig = plt.figure(figsize=(9, 4))
true_conductivity_model[ind_resistor] = true_resistor_conductivity true_conductivity_model[~ind_active] = np.NaN ############################################################ # Plotting True and Recovered Conductivity Model # ---------------------------------------------- # # Plot True Model norm = LogNorm(vmin=1e-3, vmax=1e-1) fig = plt.figure(figsize=(9, 4)) ax1 = fig.add_axes([0.14, 0.17, 0.68, 0.7]) im = mesh.plot_image(true_conductivity_model, ax=ax1, grid=False, pcolor_opts={"norm": norm}) ax1.set_xlim(-600, 600) ax1.set_ylim(-600, 0) ax1.set_title("True Conductivity Model") ax1.set_xlabel("x (m)") ax1.set_ylabel("z (m)") ax2 = fig.add_axes([0.84, 0.17, 0.03, 0.7]) cbar = mpl.colorbar.ColorbarBase(ax2, norm=norm, orientation="vertical") cbar.set_label(r"$\sigma$ (S/m)", rotation=270, labelpad=15, size=12) plt.show() # # Plot Recovered Model fig = plt.figure(figsize=(9, 4))
"Smooth Recovered Model", "Sparse Recovered Model", ] plotting_model = [ true_conductivity_model, l2_conductivity, recovered_conductivity, ] for ii in range(0, 3): ax1[ii] = fig.add_axes([0.14, 0.75 - 0.3 * ii, 0.68, 0.2]) mesh.plot_image( plotting_model[ii], ax=ax1[ii], grid=False, range_x=[-700, 700], range_y=[-600, 0], pcolor_opts={"norm": norm}, ) ax1[ii].set_xlim(-600, 600) ax1[ii].set_ylim(-600, 0) ax1[ii].set_title(title_str[ii]) ax1[ii].set_xlabel("x (m)") ax1[ii].set_ylabel("z (m)") ax2[ii] = fig.add_axes([0.84, 0.75 - 0.3 * ii, 0.03, 0.2]) cbar = mpl.colorbar.ColorbarBase(ax2[ii], norm=norm, orientation="vertical") cbar.set_label(r"$\sigma$ (S/m)", rotation=270, labelpad=15, size=12) plt.show()