simpeg.utils.distance_weighting#
- simpeg.utils.distance_weighting(mesh, reference_locs, active_cells=None, exponent=2.0, threshold=None, engine='numba', cdist_opts=None)[source]#
Construct diagonal elements of a distance weighting matrix
Builds the model weights following the distance weighting strategy, a method to generate weights based on the distance between mesh cell centers and some reference location(s). Use these weights in regularizations to counteract the natural decay of potential field data with distance.
- Parameters:
- mesh
discretize.base.BaseMesh
Discretized model space.
- reference_locs(
n
,ndim
)numpy.ndarray
The coordinate of the reference location, usually the receiver locations, for the distance weighting. A 2d array, with multiple reference locations, where each row should contain the coordinates of a single location point in the following order: _x_, _y_, _z_ (for 3D meshes) or _x_, _z_ (for 2D meshes).
- active_cells(
mesh.n_cells
)numpy.ndarray
of
bool,optional
Index vector for the active cells on the mesh. If
None
, every cell will be assumed to be active.- exponent
float
orNone
,optional
Exponent parameter for distance weighting. The exponent should match the natural decay power of the potential field. For example, for gravity acceleration, set it to 2; for magnetic fields, to 3.
- threshold
float
orNone
,optional
Threshold parameters used in the distance weighting. If
None
, it will be set to half of the smallest cell width.- engine: str, ‘numba’ or ‘scipy’
Pick between a
scipy.spatial.distance.cdist
computation (memory intensive) or for loop implementation, parallelized with numba if available. Default to"numba"
.- cdist_opts: dict, optional
Only valid with
engine=="scipy"
. Options to pass toscipy.spatial.distance.cdist
. Default to None.
- mesh
- Returns:
- (
n_active
)numpy.ndarray
Normalized distance weights for the mesh at every active cell as a 1d-array.
- (
Galleries and Tutorials using simpeg.utils.distance_weighting
#
Compare weighting strategy with Inversion of surface Gravity Anomaly Data