The Data Transformation with GravMagPro¶
GravMagPro is a Python package designed for processing gravity and magnetic data, facilitating the production of various transformed maps that are essential for geophysical data interpretation. These transformed maps help highlight subtle features within the data, making them critical tools in fields such as mineral exploration, oil and gas exploration, and environmental studies.
Table of Contents¶
- Introduction to Derivative Maps
- Types of Data Transformation in GravMagPro
- Importance of Derivative Maps in Geophysical Interpretation
- Applications of Derivative Maps
- Conclusion
1. Introduction to Derivative Maps¶
Derivative maps are used to enhance and interpret gravity and magnetic data. They help to accentuate geological structures such as faults, folds, and dykes by highlighting subtle anomalies that might not be apparent in the original dataset. These maps are vital tools in geophysical exploration, where precise interpretations can lead to better decision-making in fields such as mineral and oil & gas exploration.
2. Types of Derivative Maps in GravMagPro¶
GravMagPro supports a variety of derivative maps, each serving a unique purpose in data interpretation:
2.1 Horizontal Derivatives¶
Horizontal derivatives enhance the lateral changes in the data, making it easier to identify boundaries between regions with different physical properties.
2.2 Vertical Derivatives¶
Vertical derivatives highlight changes in the data along the vertical axis, which is useful for detecting deeper structures. They are often applied to magnetic data to emphasize anomalies from subsurface bodies.
2.3 Tilt Derivatives¶
Tilt derivatives are useful for visualizing the geometry of subsurface sources. They provide a clearer view of shallow and deep sources simultaneously, improving the detection of geological contacts and faults.
2.4 Analytical Signal¶
The analytical signal map provides a magnitude representation of the data that is independent of the direction of magnetization. It helps locate the edges of magnetic bodies and is commonly used in mineral exploration.
2.5 2nd Derivatives¶
Second derivatives (Laplacian) further enhance high-frequency anomalies, making it easier to pinpoint sharp variations in the data. They are commonly used in interpreting fault lines and other discontinuities in subsurface structures.
2.6 Vertical Integration¶
Vertical integration is the opposite of differentiation and is used to smooth the data. This technique can be helpful when focusing on broader, deeper geological structures while suppressing local noise.
2.7 Laplacian¶
The Laplacian map highlights regions of rapid change by combining second-order horizontal and vertical derivatives. It provides insight into the curvature of the anomaly field, emphasizing both near-surface and deeper structures.
2.8 Total Gradient¶
The total gradient map shows the rate of change of the gravity or magnetic field in all directions. This method is used to enhance the visibility of geological structures regardless of their orientation.
2.9 Local Wave Number¶
Local wave number derivatives focus on quantifying the frequency content of the data locally. These are valuable for characterizing the geometry and depth of sources in both gravity and magnetic data.
2.10 Tilt Angle of the Horizontal Gradient¶
The tilt angle of the horizontal gradient is used to highlight subsurface features, making it possible to visualize both shallow and deep structures in a unified manner. It is particularly useful for edge detection in geophysical datasets.
2.11 Upward and Downward Continuation Maps¶
Upward continuation suppresses high-frequency anomalies, enhancing deeper sources. Downward continuation, on the other hand, magnifies shallow sources but can be prone to noise if not applied carefully.
3. Importance of Derivative Maps in Geophysical Interpretation¶
Derivative maps are crucial in geophysical interpretation for several reasons:
- Enhancing subtle features: They allow geophysicists to detect fine details in gravity and magnetic data that are often lost in raw data.
- Improving anomaly detection: By emphasizing variations at different depths, these maps aid in distinguishing between shallow and deep sources.
- Supporting multi-scale analysis: Derivative maps provide a means to analyze geological structures at varying scales, from local faults to regional tectonic trends.
4. Applications of Derivative Maps¶
Derivative maps play a pivotal role in many areas of geophysical exploration:
4.1 Mineral Exploration¶
In mineral exploration, derivative maps are used to identify subsurface structures like ore bodies, veins, and faults. The combination of horizontal and vertical derivatives, along with tilt and total gradient maps, helps pinpoint areas with high mineralization potential.
4.2 Oil and Gas Exploration¶
In oil and gas exploration, derivative maps help in detecting structural traps, fault systems, and basin geometry. Upward continuation and second derivative maps are particularly useful for identifying deeper structures, which may indicate potential hydrocarbon reservoirs.
4.3 Environmental and Engineering Studies¶
Derivative maps are also applied in environmental and engineering geophysics to map subsurface features like aquifers, cavities, and contamination plumes. Vertical and horizontal derivatives provide insights into shallow subsurface conditions that are crucial for engineering projects.
5. Conclusion¶
GravMagPro provides a robust set of tools for generating transformed maps, which are essential for interpreting gravity and magnetic data. By enhancing subtle features and helping identify geological structures at different depths, these maps play a vital role in mineral exploration, oil and gas exploration, and environmental studies. The ability to produce a wide range of derivative maps makes GravMagPro an indispensable tool for geophysicists looking to extract meaningful information from complex datasets.
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import Forward_Model as fm
import time
from tqdm import tqdm
import grav_mag_inv as gmi
import Grav_Mag_Transform as gt
import rasterio
import Euler_Deconvolution as ev
import GravMagPro as gmp
df = pd.read_csv('mag_data11.csv')
df.head()
X | Y | Z | mag | |
---|---|---|---|---|
0 | 330000 | 6629200 | 211.055369 | 5535 |
1 | 330050 | 6629200 | 210.654999 | 5500 |
2 | 330100 | 6629200 | 210.286555 | 5476 |
3 | 330150 | 6629200 | 209.952679 | 5479 |
4 | 330200 | 6629200 | 209.655742 | 5496 |
# Calculate the midpoints of X and Y for the filtered data
x_mid = df['X'].mean()
y_mid = df['Y'].mean()
df['X_centered'] = df['X'] - x_mid
df['Y_centered'] = df['Y'] - y_mid
# Display the transformed dataset
print(df[['X_centered', 'Y_centered', 'mag']])
X_centered Y_centered mag 0 -4500.0 -6900.0 5535 1 -4450.0 -6900.0 5500 2 -4400.0 -6900.0 5476 3 -4350.0 -6900.0 5479 4 -4300.0 -6900.0 5496 ... ... ... ... 12665 4300.0 6900.0 4945 12666 4350.0 6900.0 4943 12667 4400.0 6900.0 4940 12668 4450.0 6900.0 4938 12669 4500.0 6900.0 4936 [12670 rows x 3 columns]
dt = df[
(df['X_centered'] > -2000) & (df['X_centered'] < 2000) & (df['Y_centered'] > -4000) & (df['Y_centered'] < 4000)
].copy()
mag_grid, x_grid, y_grid = ev.create_grid(dt, 201, 401)
mag_grid = mag_grid - np.mean(mag_grid.mean())
target_points_x = 201
target_points_y = 401
# Extracting data from DataFrame
x = dt['X'].values
y = dt['Y'].values
# Determine cell size based on the spacing of grid points
cell_size_x = (x.max() - x.min()) / (target_points_x - 1)
cell_size_y = (y.max() - y.min()) / (target_points_y - 1)
# Automatically determine the upper-left corner
upper_left_x = x.min()
upper_left_y = y.max()
# Create an affine transform for the grid (Y cell size is negative to go downward)
transform = rasterio.transform.from_origin(upper_left_x, upper_left_y, cell_size_x, -cell_size_y)
# Optional parameters for the Grid class
nodata_value = -9999
name = 'OptimizedGrid'
filename = 'theoritical_grid.tif'
mask = None # No mask for now
crs = None # Set your CRS here
data_array = mag_grid
dMx, dMy, dMz = ev.compute_derivatives(data_array, transform, nodata_value, name, filename, mask, crs = None)
ev.plot_contours(x_grid, y_grid, dMx, label = 'nT/m', title = 'Horizontal Derivative in X-direction')
gmp.plot_interactive_grid(dMx, x_grid, y_grid, title='Horizontal Derivative in X-Direction ', zaxis_title=' (nT/m)')
ev.plot_contours(x_grid, y_grid, dMy, label = 'nT/m', title = 'Horizontal Derivative in Y-direction')
gmp.plot_interactive_grid(dMy, x_grid, y_grid, title='Horizontal Derivative in Y-Direction ', zaxis_title=' (nT/m)')
ev.plot_contours(x_grid, y_grid, dMz, label = 'nT/m', title = 'Vertical Derivative')
gmp.plot_interactive_grid(dMz, x_grid, y_grid, title='Vertical Derivative ', zaxis_title=' (nT/m)')
analytical = ev.calculate_analytical(dMx, dMy, dMz)
ev.plot_contours(x_grid, y_grid, analytical, label = 'nT/m', title = 'Analytical Signal')
gmp.plot_interactive_grid(analytical, x_grid, y_grid, title='Analytical Map', zaxis_title=' (nT/m)')