simpeg.maps.ComboMap#

class simpeg.maps.ComboMap(maps, **kwargs)[source]#

Bases: IdentityMap

Combination mapping constructed by joining a set of other mappings.

A ComboMap is a single mapping object made by joining a set of basic mapping operations by chaining them together, in order. When creating a ComboMap, the user provides a list of SimPEG mapping objects they wish to join. The order of the mappings in this list is from last to first; i.e. \([\mathbf{f}_n , ... , \mathbf{f}_2 , \mathbf{f}_1]\).

The combination mapping \(\mathbf{u}(\mathbf{m})\) that acts on a set of input model parameters \(\mathbf{m}\) is defined as:

\[\mathbf{u}(\mathbf{m}) = f_n(f_{n-1}(\cdots f_1(f_0(\mathbf{m}))))\]

Note that any time that you create your own combination mapping, be sure to test that the derivative is correct.

Parameters:
mapslist of simpeg.maps.IdentityMap

A list of SimPEG mapping objects. The ordering of the mapping objects in the list is from last applied to first applied!

Attributes

is_linear

Determine whether or not this mapping is a linear operation.

mesh

The mesh used for the mapping

nP

Number of parameters the mapping acts on.

shape

Dimensions of the mapping.

Methods

deriv(m[, v])

Derivative of the mapping with respect to the input parameters.

dot(map1)

Multiply two mappings to create a simpeg.maps.ComboMap.

inverse(D)

The transform inverse is not implemented.

test([m, num, random_seed])

Derivative test for the mapping.

Examples

Here we create a combination mapping that 1) projects a single scalar to a vector space of length 5, then takes the natural exponent.

>>> import numpy as np
>>> from simpeg.maps import ExpMap, Projection, ComboMap
>>> nP1 = 1
>>> nP2 = 5
>>> ind = np.zeros(nP1, dtype=int)
>>> projection_map = Projection(nP1, ind)
>>> projection_map.shape
(5, 1)
>>> exp_map = ExpMap(nP=5)
>>> exp_map.shape
(5, 5)

Recall that the order of the mapping objects is from last applied to first applied.

>>> map_list = [exp_map, projection_map]
>>> combo_map = ComboMap(map_list)
>>> combo_map.shape
(5, 1)
>>> m = np.array([2.])
>>> combo_map * m
array([7.3890561, 7.3890561, 7.3890561, 7.3890561, 7.3890561])

Galleries and Tutorials using simpeg.maps.ComboMap#

Maps: ComboMaps

Maps: ComboMaps

3D DC inversion of Dipole Dipole array

3D DC inversion of Dipole Dipole array

2D inversion of Loop-Loop EM Data

2D inversion of Loop-Loop EM Data

2.5D DC Resistivity and IP Least-Squares Inversion

2.5D DC Resistivity and IP Least-Squares Inversion

3D Least-Squares Inversion of DC and IP Data

3D Least-Squares Inversion of DC and IP Data

Least-Squares 1D Inversion of Sounding Data

Least-Squares 1D Inversion of Sounding Data

Sparse 1D Inversion of Sounding Data

Sparse 1D Inversion of Sounding Data

Parametric 1D Inversion of Sounding Data

Parametric 1D Inversion of Sounding Data

2.5D DC Resistivity Least-Squares Inversion

2.5D DC Resistivity Least-Squares Inversion

2.5D DC Resistivity Inversion with Sparse Norms

2.5D DC Resistivity Inversion with Sparse Norms

3D Least-Squares Inversion of DC Resistivity Data

3D Least-Squares Inversion of DC Resistivity Data

Tensor Meshes

Tensor Meshes

Cylindrical Meshes

Cylindrical Meshes

Tree Meshes

Tree Meshes

Joint PGI of Gravity + Magnetic on an Octree mesh using full petrophysical information

Joint PGI of Gravity + Magnetic on an Octree mesh using full petrophysical information

Joint PGI of Gravity + Magnetic on an Octree mesh without petrophysical information

Joint PGI of Gravity + Magnetic on an Octree mesh without petrophysical information