fatiando.gravmag.transform
)¶Potential field transformations, like upward continuation and derivatives.
Note
Most, if not all, functions here required gridded data.
Transformations
upcontinue
: Upward continuation of
gridded potential field data on a level surface.reduce_to_pole
: Reduce the total field
magnetic anomaly to the pole.tga
: Calculate the amplitude of the
total gradient (also called the analytic signal)tilt
: Calculates the tilt anglepower_density_spectra
: Calculates
the Power Density Spectra of a gridded potential field data.radial_average
: Calculates the
the radial average of a Power Density Spectra using concentring rings.Derivatives
derivx
: Calculate the n-th order
derivative of a potential field in the x-direction (North-South)derivy
: Calculate the n-th order
derivative of a potential field in the y-direction (East-West)derivz
: Calculate the n-th order
derivative of a potential field in the z-directionfatiando.gravmag.transform.
derivx
(x, y, data, shape, order=1, method='fd')[source]¶Calculate the derivative of a potential field in the x direction.
Note
Requires gridded data.
Warning
If the data is not in SI units, the derivative will be in
strange units! I strongly recommend converting the data to SI
before calculating the derivative (use one of the unit conversion
functions of fatiando.utils
). This way the derivative will be in
SI units and can be easily converted to what unit you want.
Parameters:
The x and y coordinates of the grid points
The potential field at the grid points
The shape of the grid
The order of the derivative
The method used to calculate the derivatives. Options are:
'fd'
for central finite-differences (more stable) or 'fft'
for the Fast Fourier Transform.
Returns:
The derivative
fatiando.gravmag.transform.
derivy
(x, y, data, shape, order=1, method='fd')[source]¶Calculate the derivative of a potential field in the y direction.
Note
Requires gridded data.
Warning
If the data is not in SI units, the derivative will be in
strange units! I strongly recommend converting the data to SI
before calculating the derivative (use one of the unit conversion
functions of fatiando.utils
). This way the derivative will be in
SI units and can be easily converted to what unit you want.
Parameters:
The x and y coordinates of the grid points
The potential field at the grid points
The shape of the grid
The order of the derivative
The method used to calculate the derivatives. Options are:
'fd'
for central finite-differences (more stable) or 'fft'
for the Fast Fourier Transform.
Returns:
The derivative
fatiando.gravmag.transform.
derivz
(x, y, data, shape, order=1, method='fft')[source]¶Calculate the derivative of a potential field in the z direction.
Note
Requires gridded data.
Warning
If the data is not in SI units, the derivative will be in
strange units! I strongly recommend converting the data to SI
before calculating the derivative (use one of the unit conversion
functions of fatiando.utils
). This way the derivative will be in
SI units and can be easily converted to what unit you want.
Parameters:
The x and y coordinates of the grid points
The potential field at the grid points
The shape of the grid
The order of the derivative
The method used to calculate the derivatives. Options are:
'fft'
for the Fast Fourier Transform.
Returns:
The derivative
fatiando.gravmag.transform.
power_density_spectra
(x, y, data, shape)[source]¶Calculates the Power Density Spectra of a 2D gridded potential field through the FFT:
Note
Requires gridded data.
Note
x, y, z and height should be in meters.
Parameters:
The x and y coordinates of the grid points
The potential field at the grid points
The shape of the grid
Returns:
The wavenumbers of each Power Density Spectra point
The Power Density Spectra of the data
fatiando.gravmag.transform.
radial_average_spectrum
(kx, ky, pds, max_radius=None, ring_width=None)[source]¶Calculates the average of the Power Density Spectra points that falls inside concentric rings built around the origin of the wavenumber coordinate system with constant width.
The width of the rings and the inner radius of the biggest ring can be changed by setting the optional parameters ring_width and max_radius, respectively.
Note
To calculate the radially averaged power density spectra use the outputs of the function power_density_spectra as input of this one.
Parameters:
The x and y coordinates of the grid points
The potential field at the grid points
The shape of the grid
Inner radius of the biggest ring. By default it’s set as the minimum of kx.max() and ky.max(). Making it smaller leaves points outside of the averaging, and making it bigger includes points nearer to the boundaries.
Width of the rings. By default it’s set as the largest value of \(\Delta k_x\) and \(\Delta k_y\), being them the equidistances of the kx and ky arrays. Making it bigger gives more populated averages, and making it smaller lowers the ammount of points per ring (use it carefully).
Returns:
Wavenumbers of each Radially Averaged Power Spectrum point. Also, the inner radius of the rings.
Radially Averaged Power Spectrum
fatiando.gravmag.transform.
reduce_to_pole
(x, y, data, shape, inc, dec, sinc, sdec)[source]¶Reduce total field magnetic anomaly data to the pole.
The reduction to the pole if a phase transformation that can be applied to total field magnetic anomaly data. It “simulates” how the data would be if both the Geomagnetic field and the magnetization of the source were vertical (\(90^\circ\) inclination) (Blakely, 1996).
This functions performs the reduction in the frequency domain (using the FFT). The transform filter is (in the frequency domain):
in which \(k_x\) and \(k_y\) are the wave-numbers in the x and y directions and
\(\mathbf{m} = (m_x, m_y, m_z)\) is the unit-vector of the total magnetization of the source and \(\mathbf{f} = (f_x, f_y, f_z)\) is the unit-vector of the Geomagnetic field.
Note
Requires gridded data.
Warning
The magnetization direction of the anomaly source is crucial to the reduction-to-the-pole. Wrong values of *sinc* and *sdec* will lead to a wrong reduction.
Parameters:
The x, y, z coordinates of each data point.
The total field anomaly data at each point.
The shape of the data grid
The inclination and declination of the inducing Geomagnetic field
The inclination and declination of the total magnetization of the anomaly source. The total magnetization is the vector sum of the induced and remanent magnetization. If there is only induced magnetization, use the inc and dec of the Geomagnetic field.
Returns:
The data reduced to the pole.
References:
Blakely, R. J. (1996), Potential Theory in Gravity and Magnetic Applications, Cambridge University Press.
fatiando.gravmag.transform.
tga
(x, y, data, shape, method='fd')[source]¶Calculate the total gradient amplitude (TGA).
This the same as the 3D analytic signal of Roest et al. (1992), but we prefer the newer, more descriptive nomenclature suggested by Reid (2012).
The TGA is defined as the amplitude of the gradient vector of a potential field \(T\) (e.g. the magnetic total field anomaly):
Note
Requires gridded data.
Warning
If the data is not in SI units, the derivatives will be in
strange units and so will the total gradient amplitude! I strongly
recommend converting the data to SI before calculating the
TGA is you need the gradient in Eotvos (use one of the unit conversion
functions of fatiando.utils
).
Parameters:
The x and y coordinates of the grid points
The potential field at the grid points
The shape of the grid
The method used to calculate the horizontal derivatives. Options are:
'fd'
for finite-difference (more stable) or 'fft'
for the Fast
Fourier Transform. The z derivative is always calculated by FFT.
Returns:
The amplitude of the total gradient
References:
Reid, A. (2012), Forgotten truths, myths and sacred cows of Potential Fields Geophysics - II, in SEG Technical Program Expanded Abstracts 2012, pp. 1-3, Society of Exploration Geophysicists.
Roest, W., J. Verhoef, and M. Pilkington (1992), Magnetic interpretation using the 3-D analytic signal, GEOPHYSICS, 57(1), 116-125, doi:10.1190/1.1443174.
fatiando.gravmag.transform.
tilt
(x, y, data, shape, xderiv=None, yderiv=None, zderiv=None)[source]¶Calculates the potential field tilt, as defined by Miller and Singh (1994)
When used on magnetic total field anomaly data, works best if the data is reduced to the pole.
It’s useful to plot the zero contour line of the tilt to represent possible
outlines of the source bodies. Use matplotlib’s pyplot.contour
or
pyplot.tricontour
for this.
Note
Requires gridded data if xderiv
, yderiv
and zderiv
are not
given.
Parameters:
The x and y coordinates of the grid points
The potential field at the grid points
The shape of the grid. Ignored if xderiv, yderiv and zderiv are given.
Optional. Values of the derivative in the x direction.
If None
, will calculated using the default options of
derivx
Optional. Values of the derivative in the y direction.
If None
, will calculated using the default options of
derivy
Optional. Values of the derivative in the z direction.
If None
, will calculated using the default options of
derivz
Returns:
The tilt angle of the total field in radians.
References:
Miller, Hugh G, and Vijay Singh. 1994. “Potential Field Tilt — a New Concept for Location of Potential Field Sources.” Journal of Applied Geophysics 32 (2–3): 213-17. doi:10.1016/0926-9851(94)90022-1.
fatiando.gravmag.transform.
upcontinue
(x, y, data, shape, height)[source]¶Upward continuation of potential field data.
Calculates the continuation through the Fast Fourier Transform in the wavenumber domain (Blakely, 1996):
and then transformed back to the space domain. \(h_{up}\) is the upward continue data, \(\Delta z\) is the height increase, \(F\) denotes the Fourier Transform, and \(|k|\) is the wavenumber modulus.
Note
Requires gridded data.
Note
x, y, z and height should be in meters.
Note
It is not possible to get the FFT of a masked grid. The default
fatiando.gridder.interp
call using minimum curvature will not
be suitable. Use extrapolate=True
or algorithm='nearest'
to
get an unmasked grid.
Parameters:
The x and y coordinates of the grid points
The potential field at the grid points
The shape of the grid
The height increase (delta z) in meters.
Returns:
The upward continued data
References:
Blakely, R. J. (1996), Potential Theory in Gravity and Magnetic Applications, Cambridge University Press.