# Utilities for operating on the gradient tensor (fatiando.gravmag.tensor)¶

Utilities for operating on the gradient tensor of potential fields.

Functions

• invariants: Calculates the first ($$I_1$$), second ($$I_2$$), and dimensionless ($$I$$) invariants
• eigen: Calculates the eigenvalues and eigenvectors of an array of gradient tensor measurements
• center_of_mass: Estimate the center of mass of sources from the first eigenvector using the method of Beiki and Pedersen (2010)

Theory

Following Pedersen and Rasmussen (1990), the characteristic polynomial of the gravity gradient tensor $$\mathbf{\Gamma}$$ is

$\lambda^3 + I_1\lambda - I_2 = 0$

where $$\lambda$$ is an eigenvalue and $$I_1$$ and $$I_2$$ are the two invariants. The dimensionless invariant $$I$$ is

$I = -\dfrac{(I_2/2)^2}{(I_1/3)^3}$

The invariant $$I$$ indicates the dimensionality of the source. $$I = 0$$ for 2 dimensional bodies and $$I = 1$$ for a monopole.

References

Beiki, M., and L. B. Pedersen (2010), Eigenvector analysis of gravity gradient tensor to locate geologic bodies, Geophysics, 75(6), I37, doi:10.1190/1.3484098

Pedersen, L. B., and T. M. Rasmussen (1990), The gradient tensor of potential field anomalies: Some implications on data collection and data processing of maps, Geophysics, 55(12), 1558, doi:10.1190/1.1442807

fatiando.gravmag.tensor.center_of_mass(x, y, z, eigvec1, windows=1, wcenter=None, wmin=None, wmax=None)[source]

Estimates the center of mass of a source using the 1st eigenvector

Uses the method of Beiki and Pedersen (2010) with an expanding window scheme to get the best estimate and deal with multiple sources.

Parameters:

• x, y, z
: arrays

The x, y, and z coordinates of the observation points

• eigvec1
: array (shape = (N, 3) where N is the number of observations)

The first eigenvector of the gravity gradient tensor at each observation point

• windows
: int

The number of expanding windows to use

• wcenter
: list = [x, y]

The [x, y] coordinates of the center of the expanding windows. Will default to the middle of the data area if None

• wmin, wmax
: float

Minimum and maximum size of the expanding windows. Will default to 10% data area and 100% data area, respectively, if None

Returns:

• [xo, yo, zo]
: floats

xo, yo, zo are the coordinates of the estimated center of mass

Examples:

Estimate the center of a sphere using some synthetic data:

>>> from fatiando import gridder
>>> from fatiando.mesher import Sphere
>>> from fatiando.gravmag import sphere, tensor
>>> # Generate synthetic data using a sphere model
>>> # The center of the sphere is (-100, 0, 100)
>>> model = [Sphere(-100, 20, 100, 100, {'density':1000})]
>>> x, y, z = gridder.regular((-500, 500, -500, 500), (20, 20), z=-100)
>>> data = [sphere.gxx(x, y, z, model),
...         sphere.gxy(x, y, z, model),
...         sphere.gxz(x, y, z, model),
...         sphere.gyy(x, y, z, model),
...         sphere.gyz(x, y, z, model),
...         sphere.gzz(x, y, z, model)]
>>> # Get the first eigenvector
>>> eigenvals, eigenvecs = tensor.eigen(data)
>>> # Now estimate the center of mass
>>> cm = tensor.center_of_mass(x, y, z, eigenvecs[0])
>>> print('{:.1f} {:.1f} {:.1f}'.format(cm[0], cm[1], cm[2]))
-100.0 20.0 100.0
fatiando.gravmag.tensor.eigen(tensor)[source]

Calculates the eigenvalues and eigenvectors of the gradient tensor.

Note

The coordinate system used is x->North, y->East, z->Down

Parameters:

• tensor
: list

A list of arrays with the 6 components of the gradient tensor measured on a set of points. The order of the list should be: [gxx, gxy, gxz, gyy, gyz, gzz]

Returns:

• result
: list of lists

The eigenvalues and eigenvectors at each observation point. [[eigval1, eigval2, eigval3], [eigvec1, eigvec2, eigvec3]]

• eigval1,2,3
: array

The first, second, and third eigenvalues

• eigvec1,2,3
: array (shape = (N, 3) where N is the number of points)

The first, second, and third eigenvectors

Example:

>>> tensor = [[2], [0], [0], [3], [0], [1]]
>>> eigenvals, eigenvecs = eigen(tensor)
>>> print eigenvals[0], eigenvecs[0]
[ 3.] [[ 0.  1.  0.]]
>>> print eigenvals[1], eigenvecs[1]
[ 2.] [[ 1.  0.  0.]]
>>> print eigenvals[2], eigenvecs[2]
[ 1.] [[ 0.  0.  1.]]
fatiando.gravmag.tensor.invariants(tensor)[source]

Calculates the first, second, and dimensionless invariants of the gradient tensor.

Note

The coordinate system used is x->North, y->East, z->Down

Parameters:

• tensor
: list

A list of arrays with the 6 components of the gradient tensor measured on a set of points. The order of the list should be: [gxx, gxy, gxz, gyy, gyz, gzz]

Returns:

• invariants
: list = [$$I_1$$, $$I_2$$, $$I$$]

The invariants calculated for each point