About the Potential Fields category

This is a space for talking about simulations and inversions of potential fields data. Ask your questions or post ideas about gravity and magnetics here!

Congrats! Simpeg is amazing! I just started using Simpeg. I have a question about Gravity tutorial Forward Simulation of Gravity Anomaly Data on a Tensor Mesh (Forward Simulation of Gravity Anomaly Data on a Tensor Mesh — SimPEG 0.14.3 documentation).
Why in “Simulation: Gravity Anomaly Data on Tensor Mesh”, in the example, have negative mgal anomalies related to sphere positive density body 0.2 g/cc and positive mgal anomalies related to block negative density -0.2 g/cc. It wouldn´t be the opposite??
Thanks!

1 Like

Respected ma’am ,

I tried to do 3D susceptibility and Density models using SimPEG Magnetic and Gravity Inversion codes.

I am getting the predicted anomaly and normalized misfit plot also. However, when i tried to plot the 3D models, i am getting error.

please help me.

Exception Traceback (most recent call last)
/tmp/ipykernel_13173/2025731010.py in
52 )
53 ax = plt.subplot(221)
—> 54 dat = mesh.plotSlice(
55 recovered_model,
56 ax=ax,

~/.local/lib/python3.8/site-packages/discretize/utils/code_utils.py in new_method(self, *args, **kwargs)
157 DeprecationWarning,
158 )
→ 159 return getattr(self, new_name)(*args, **kwargs)
160
161 doc = f" {old_name} has been deprecated. See {new_name} for documentation"

~/.local/lib/python3.8/site-packages/discretize/mixins/mpl_mod.py in plot_slice(self, v, v_type, normal, ind, slice_loc, grid, view, ax, clim, show_it, pcolor_opts, stream_opts, grid_opts, range_x, range_y, sample_grid, stream_threshold, stream_thickness, **kwargs)
634 pcolor_opts[“vmax”] = clim[1]
635
→ 636 out = plotter(
637 v,
638 v_type=v_type,

~/.local/lib/python3.8/site-packages/discretize/mixins/mpl_mod.py in __plot_slice_tensor(self, v, v_type, normal, ind, grid, view, ax, pcolor_opts, stream_opts, grid_opts, range_x, range_y, sample_grid, stream_threshold, stream_thickness, **kwargs)
1348 x2d.append(self.origin[2])
1349 tM = self. class (h=h2d, origin=x2d) #: Temp Mesh
→ 1350 v2d = doSlice(v)
1351
1352 out = tM.__plot_image_tensor2D(

~/.local/lib/python3.8/site-packages/discretize/mixins/mpl_mod.py in doSlice(v)
1309 def doSlice(v):
1310 if v_type == “CC”:
→ 1311 return getIndSlice(self.reshape(v, “CC”, “CC”, “M”))
1312 elif v_type == “CCv”:
1313 if view != “vec”:

~/.local/lib/python3.8/site-packages/discretize/base/base_mesh.py in reshape(self, x, x_type, out_type, format, **kwargs)
1141 return out
1142 else:
→ 1143 return switchKernal(x)
1144
1145 # DEPRECATED

~/.local/lib/python3.8/site-packages/discretize/base/base_mesh.py in switchKernal(xx)
1078 nn = self.shape_cells if x_type == “cell_centers” else self.shape_nodes
1079 if xx.size != np.prod(nn):
→ 1080 raise Exception(“Number of elements must not change.”)
1081 return outKernal(xx, nn)
1082 elif x_type in [“faces”, “edges”]:

Exception: Number of elements must not change.