Пример #1
0
remanence_model[ind_sphere, :] = effective_susceptibility_sphere

# Define effective susceptibility model as a vector np.r_[chi_x, chi_y, chi_z]
plotting_model = susceptibility_model + remanence_model
model = mkvc(plotting_model)

# Plot Effective Susceptibility Model
fig = plt.figure(figsize=(9, 4))

plotting_map = maps.InjectActiveCells(mesh, ind_active, np.nan)
plotting_model = np.sqrt(np.sum(plotting_model, axis=1)**2)
ax1 = fig.add_axes([0.1, 0.12, 0.73, 0.78])
mesh.plotSlice(
    plotting_map * plotting_model,
    normal="Y",
    ax=ax1,
    ind=int(mesh.hy.size / 2),
    grid=True,
    clim=(np.min(plotting_model), np.max(plotting_model)),
)
ax1.set_title("MVI Model at y = 0 m")
ax1.set_xlabel("x (m)")
ax1.set_ylabel("z (m)")

ax2 = fig.add_axes([0.85, 0.12, 0.05, 0.78])
norm = mpl.colors.Normalize(vmin=np.min(plotting_model),
                            vmax=np.max(plotting_model))
cbar = mpl.colorbar.ColorbarBase(ax2, norm=norm, orientation="vertical")
cbar.set_label("Effective Susceptibility Amplitude (SI)",
               rotation=270,
               labelpad=15,
               size=12)
Пример #2
0
###############################################################
# Plotting True and Recovered Conductivity Model
# ----------------------------------------------
#

# Plot True Model
fig = plt.figure(figsize=(10, 4))

plotting_map = maps.InjectActiveCells(mesh, ind_active, np.nan)

ax1 = fig.add_axes([0.15, 0.15, 0.67, 0.75])
mesh.plotSlice(
    plotting_map * true_conductivity_model_log10,
    ax=ax1,
    normal="Y",
    ind=int(len(mesh.hy) / 2),
    grid=False,
    clim=(true_conductivity_model_log10.min(),
          true_conductivity_model_log10.max()),
    pcolor_opts={"cmap": mpl.cm.viridis},
)
ax1.set_title("True Conductivity Model")
ax1.set_xlabel("x (m)")
ax1.set_ylabel("z (m)")
ax1.set_xlim([-1000, 1000])
ax1.set_ylim([-1000, 0])

ax2 = fig.add_axes([0.84, 0.15, 0.03, 0.75])
norm = mpl.colors.Normalize(vmin=true_conductivity_model_log10.min(),
                            vmax=true_conductivity_model_log10.max())
cbar = mpl.colorbar.ColorbarBase(ax2,
                                 cmap=mpl.cm.viridis,
Пример #3
0
#sig[M.gridCC[:,2] > -1000] = 3.3    # água
sig[M.gridCC[:, 2] > 0] = 1e-12  # ar

sigBG = np.zeros(M.nC) + conds[1]
#sigBG[M.gridCC[:, 2] > -1000] = 3.3
sigBG[M.gridCC[:, 2] > 0] = 1e-12

# MESH 1D (para modelo de background)
mesh1d = simpeg.Mesh.TensorMesh([M.hz], np.array([M.x0[2]]))
sigBG1d = np.zeros(mesh1d.nC) + conds[1]
#sigBG1d[mesh1d.gridCC > -1000] = 3.3
sigBG1d[mesh1d.gridCC > 0] = 1e-12

fig, axes = plt.subplots(num=3, clear=True)
M.plotSlice(np.log(sig), grid=True, normal='y', ax=axes)
plt.show()

#------------------------------------------------------------------------------
# Fim modelo e malha                                                          -
#------------------------------------------------------------------------------

#------------------------------------------------------------------------------
# Iniciar modelagem                                                           -
#------------------------------------------------------------------------------

rx_x = np.array([0.])
rx_y = np.array([0.])
rx_z = np.array([0.])
rx_loc = np.hstack((simpeg.Utils.mkvc(rx_x, 2), simpeg.Utils.mkvc(rx_y, 2),
                    np.zeros((np.prod(rx_x.shape), 1))))
Пример #4
0
                       xyz,
                       octree_levels=[2, 2],
                       method='box',
                       finalize=False)

mesh.finalize()

# The bottom west corner
x0 = mesh.x0

# The total number of cells
nC = mesh.nC

# An (nC, 2) array containing the cell-center locations
cc = mesh.gridCC

# A boolean array specifying which cells lie on the boundary
bInd = mesh.cellBoundaryInd

# Cell volumes
v = mesh.vol

fig = plt.figure(figsize=(6, 6))
ax = fig.add_subplot(111)
mesh.plotSlice(np.log10(v),
               normal='Y',
               ax=ax,
               ind=int(mesh.hy.size / 2),
               grid=True)
ax.set_title('Cell Log-Volumes at Y = 0 m')
# You can also use SimPEG utilities to add structures to the model more concisely
ind_sphere = model_builder.getIndicesSphere(np.r_[35.0, 0.0, -40.0], 15.0,
                                            mesh.gridCC)
ind_sphere = ind_sphere[ind_active]
model[ind_sphere] = sphere_density

# Plot Density Contrast Model
fig = plt.figure(figsize=(9, 4))
plotting_map = maps.InjectActiveCells(mesh, ind_active, np.nan)

ax1 = fig.add_axes([0.1, 0.12, 0.73, 0.78])
mesh.plotSlice(
    plotting_map * model,
    normal="Y",
    ax=ax1,
    ind=int(mesh.hy.size / 2),
    grid=True,
    clim=(np.min(model), np.max(model)),
    pcolorOpts={"cmap": "viridis"},
)
ax1.set_title("Model slice at y = 0 m")
ax1.set_xlabel("x (m)")
ax1.set_ylabel("z (m)")

ax2 = fig.add_axes([0.85, 0.12, 0.05, 0.78])
norm = mpl.colors.Normalize(vmin=np.min(model), vmax=np.max(model))
cbar = mpl.colorbar.ColorbarBase(ax2,
                                 norm=norm,
                                 orientation="vertical",
                                 cmap=mpl.cm.viridis)
cbar.set_label("$g/cm^3$", rotation=270, labelpad=15, size=12)
Пример #6
0
    np.r_[350., 0., -300.], 160., mesh.cell_centers[ind_active, :]
)
conductivity_model[ind_resistor] = resistor_value

# Plot Conductivity Model
fig = plt.figure(figsize=(10, 4))

plotting_map = maps.InjectActiveCells(mesh, ind_active, np.nan)
log_mod = np.log10(conductivity_model)

ax1 = fig.add_axes([0.15, 0.15, 0.67, 0.75])
mesh.plotSlice(
    plotting_map * log_mod,
    ax=ax1,
    normal="Y",
    ind=int(len(mesh.hy) / 2),
    grid=True,
    clim=(np.log10(resistor_value), np.log10(conductor_value)),
    pcolor_opts={"cmap": mpl.cm.viridis},
)
ax1.set_title("Conductivity Model")
ax1.set_xlabel("x (m)")
ax1.set_ylabel("z (m)")
ax1.set_xlim([-1000, 1000])
ax1.set_ylim([-1000, 0])

ax2 = fig.add_axes([0.84, 0.15, 0.03, 0.75])
norm = mpl.colors.Normalize(
    vmin=np.log10(resistor_value), vmax=np.log10(conductor_value)
)
cbar = mpl.colorbar.ColorbarBase(
Пример #7
0
ind_resistor = model_builder.getIndicesSphere(np.r_[350., 0., -300.], 160.,
                                              mesh.cell_centers[ind_active, :])
conductivity_model[ind_resistor] = resistor_value

# Plot Conductivity Model
fig = plt.figure(figsize=(10, 4))

plotting_map = maps.InjectActiveCells(mesh, ind_active, np.nan)
log_mod = np.log10(conductivity_model)

ax1 = fig.add_axes([0.15, 0.15, 0.68, 0.75])
mesh.plotSlice(
    plotting_map * log_mod,
    ax=ax1,
    normal="Y",
    ind=int(len(mesh.hy) / 2),
    grid=True,
    clim=(np.log10(resistor_value), np.log10(conductor_value)),
    pcolor_opts={"cmap": mpl.cm.viridis},
)
ax1.set_title("Conductivity Model")
ax1.set_xlabel("x (m)")
ax1.set_ylabel("z (m)")
ax1.set_xlim([-1000, 1000])
ax1.set_ylim([-1000, 0])

ax2 = fig.add_axes([0.84, 0.15, 0.03, 0.75])
norm = mpl.colors.Normalize(vmin=np.log10(resistor_value),
                            vmax=np.log10(conductor_value))
cbar = mpl.colorbar.ColorbarBase(ax2,
                                 cmap=mpl.cm.viridis,
Пример #8
0
# Load the true model (was defined on the whole mesh) and extract only the
# values on active cells.
true_model = np.loadtxt(str(model_filename))
true_model = np.log(true_model[ind_active])

# Plot True Model
fig = plt.figure(figsize=(9, 4))
plotting_map = maps.InjectActiveCells(mesh, ind_active, np.nan)

ax1 = fig.add_axes([0.1, 0.1, 0.73, 0.8])
mesh.plotSlice(
    plotting_map * true_model,
    normal="Y",
    ax=ax1,
    ind=int(mesh.hy.size / 2),
    grid=True,
    clim=(np.min(true_model), np.max(true_model)),
    pcolorOpts={"cmap": "jet"},
)
ax1.set_title("Model slice at y = 0 m")

ax2 = fig.add_axes([0.85, 0.1, 0.05, 0.8])
norm = mpl.colors.Normalize(vmin=np.min(true_model), vmax=np.max(true_model))
cbar = mpl.colorbar.ColorbarBase(ax2,
                                 norm=norm,
                                 orientation="vertical",
                                 cmap=mpl.cm.jet,
                                 format="%.1f")
cbar.set_label("$S/m$", rotation=270, labelpad=15, size=12)
Пример #9
0
             & (mesh.gridCC[ind_active, 2] > -275.0)
             & (mesh.gridCC[ind_active, 2] < -75.0))
model[ind_block] = block_conductivity

# Plot Resistivity Model
mpl.rcParams.update({"font.size": 12})
fig = plt.figure(figsize=(7, 6))

plotting_map = maps.InjectActiveCells(mesh, ind_active, np.nan)
log_model = np.log10(model)

ax1 = fig.add_axes([0.13, 0.1, 0.6, 0.85])
mesh.plotSlice(
    plotting_map * log_model,
    normal="Y",
    ax=ax1,
    ind=int(mesh.hx.size / 2),
    grid=True,
    clim=(np.log10(background_conductivity), np.log10(block_conductivity)),
)
ax1.set_title("Conductivity Model at Y = 0 m")

ax2 = fig.add_axes([0.75, 0.1, 0.05, 0.85])
norm = mpl.colors.Normalize(vmin=np.log10(background_conductivity),
                            vmax=np.log10(block_conductivity))
cbar = mpl.colorbar.ColorbarBase(ax2,
                                 norm=norm,
                                 orientation="vertical",
                                 format="$10^{%.1f}$")
cbar.set_label("Conductivity [S/m]", rotation=270, labelpad=15, size=12)

######################################################
Пример #10
0
                & (mesh.gridCC[ind_active, 2] > -600.0)
                & (mesh.gridCC[ind_active, 2] < -200.0))
conductivity_model[ind_resistor] = resistor_value

# Plot Conductivity Model
fig = plt.figure(figsize=(11, 4))

plotting_map = maps.InjectActiveCells(mesh, ind_active, np.nan)
log_mod = np.log10(conductivity_model)

ax1 = fig.add_axes([0.1, 0.12, 0.7, 0.78])
mesh.plotSlice(
    plotting_map * log_mod,
    ax=ax1,
    normal='Y',
    ind=int(len(mesh.hy) / 2),
    grid=True,
    clim=(np.log10(1e-3), np.log10(conductor_value)),
    pcolor_opts={"cmap": "viridis"},
)
ax1.set_title("Conductivity Model")
ax1.set_xlabel("x (m)")
ax1.set_ylabel("z (m)")
ax1.set_xlim([-2000, 2000])
ax1.set_ylim([-2000, 0])

ax2 = fig.add_axes([0.83, 0.12, 0.03, 0.78])
norm = mpl.colors.Normalize(vmin=np.log10(resistor_value),
                            vmax=np.log10(conductor_value))
cbar = mpl.colorbar.ColorbarBase(ax2,
                                 norm=norm,
Пример #11
0
for ii in range(0, 8):
    model += (pc[ii] * np.exp(-((xyzc[:, 0] - x_0[ii])**2) / var_x[ii]) *
              np.exp(-((xyzc[:, 1] - y_0[ii])**2) / var_y[ii]) *
              np.exp(-((xyzc[:, 2] - z_0[ii])**2) / var_z[ii]))

# Plot Model
mpl.rcParams.update({"font.size": 12})
fig = plt.figure(figsize=(7.5, 7))

plotting_map = maps.InjectActiveCells(mesh, ind_active, np.nan)
ax1 = fig.add_axes([0.09, 0.12, 0.72, 0.77])
mesh.plotSlice(
    plotting_map * model,
    normal="Z",
    ax=ax1,
    ind=0,
    grid=True,
    clim=(np.min(model), np.max(model)),
    pcolorOpts={"cmap": "magma_r"},
)
ax1.set_title("Model slice at z = 0 m")
ax1.set_xlabel("x (m)")
ax1.set_ylabel("y (m)")

ax2 = fig.add_axes([0.83, 0.12, 0.05, 0.77])
norm = mpl.colors.Normalize(vmin=np.min(model), vmax=np.max(model))
cbar = mpl.colorbar.ColorbarBase(ax2,
                                 norm=norm,
                                 orientation="vertical",
                                 cmap=mpl.cm.magma_r)
cbar.set_label("Amalgamated Magnetic Property (SI)",