Example 19 - Faulted Folded Layers#

This example will show how to convert the geological map below using GemGIS to a GemPy model. This example is based on digitized data. The area is 3990 m wide (W-E extent) and 2736 m high (N-S extent). The vertical model extent varies from 0 m to 1000 m. The model represents folded layers with a NW-SE striking fault running through the area and a Limestone unit unconformably overlaying the coal measures.

The map has been georeferenced with QGIS. The stratigraphic boundaries were digitized in QGIS. Strikes lines were digitized in QGIS as well and will be used to calculate orientations for the GemPy model. The contour lines were also digitized and will be interpolated with GemGIS to create a topography for the model.

Map Source: An Introduction to Geological Structures and Maps by G.M. Bennison

[1]:
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
img = mpimg.imread('../images/cover_example19.png')
plt.figure(figsize=(10, 10))
imgplot = plt.imshow(img)
plt.axis('off')
plt.tight_layout()
../../_images/getting_started_example_example19_2_0.png

Licensing#

Computational Geosciences and Reservoir Engineering, RWTH Aachen University, Authors: Alexander Juestel. For more information contact: alexander.juestel(at)rwth-aachen.de

This work is licensed under a Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/)

Import GemGIS#

If you have installed GemGIS via pip or conda, you can import GemGIS like any other package. If you have downloaded the repository, append the path to the directory where the GemGIS repository is stored and then import GemGIS.

[2]:
import warnings
warnings.filterwarnings("ignore")
import gemgis as gg

Importing Libraries and loading Data#

All remaining packages can be loaded in order to prepare the data and to construct the model. The example data is downloaded from an external server using pooch. It will be stored in a data folder in the same directory where this notebook is stored.

[3]:
import geopandas as gpd
import rasterio
[4]:
file_path = 'data/example19/'
gg.download_gemgis_data.download_tutorial_data(filename="example19_faulted_folded_layers.zip", dirpath=file_path)
Downloading file 'example19_faulted_folded_layers.zip' from 'https://rwth-aachen.sciebo.de/s/AfXRsZywYDbUF34/download?path=%2Fexample19_faulted_folded_layers.zip' to 'C:\Users\ale93371\Documents\gemgis\docs\getting_started\example\data\example19'.

Creating Digital Elevation Model from Contour Lines#

The digital elevation model (DEM) will be created by interpolating contour lines digitized from the georeferenced map using the SciPy Radial Basis Function interpolation wrapped in GemGIS. The respective function used for that is gg.vector.interpolate_raster().

[5]:
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
img = mpimg.imread('../images/dem_example19.png')
plt.figure(figsize=(10, 10))
imgplot = plt.imshow(img)
plt.axis('off')
plt.tight_layout()
../../_images/getting_started_example_example19_10_0.png
[6]:
topo = gpd.read_file(file_path + 'topo19.shp')
topo.head()
[6]:
id Z geometry
0 None 300 LINESTRING (8.174 150.549, 50.466 70.194, 80.9...
1 None 300 LINESTRING (3.099 239.363, 31.011 304.493, 55....
2 None 550 LINESTRING (3.944 2537.526, 66.114 2492.273, 1...
3 None 500 LINESTRING (3.099 2351.862, 90.221 2275.736, 1...
4 None 450 LINESTRING (3.099 2193.266, 109.252 2093.034, ...

Interpolating the contour lines#

[7]:
topo_raster = gg.vector.interpolate_raster(gdf=topo, value='Z', method='rbf', res=10)

Plotting the raster#

[8]:
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable

fix, ax = plt.subplots(1, figsize=(10, 10))
topo.plot(ax=ax, aspect='equal', column='Z', cmap='gist_earth')
im = ax.imshow(topo_raster, origin='lower', extent=[0, 3990, 0, 2736], cmap='gist_earth')
divider = make_axes_locatable(ax)
cax = divider.append_axes("right", size="5%", pad=0.05)
cbar = plt.colorbar(im, cax=cax)
cbar.set_label('Altitude [m]')
ax.set_xlabel('X [m]')
ax.set_ylabel('Y [m]')
ax.set_xlim(0, 3990)
ax.set_ylim(0, 2736)
[8]:
(0.0, 2736.0)
../../_images/getting_started_example_example19_15_1.png

Saving the raster to disc#

After the interpolation of the contour lines, the raster is saved to disc using gg.raster.save_as_tiff(). The function will not be executed as a raster is already provided with the example data.

gg.raster.save_as_tiff(raster=topo_raster, path=file_path + 'raster19.tif', extent=[0, 3990, 0, 2736], crs='EPSG:4326', overwrite_file=True)

Opening Raster#

The previously computed and saved raster can now be opened using rasterio.

[9]:
topo_raster = rasterio.open(file_path + 'raster19.tif')

Interface Points of stratigraphic boundaries#

The interface points will be extracted from LineStrings digitized from the georeferenced map using QGIS. It is important to provide a formation name for each layer boundary. The vertical position of the interface point will be extracted from the digital elevation model using the GemGIS function gg.vector.extract_xyz(). The resulting GeoDataFrame now contains single points including the information about the respective formation.

[10]:
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
img = mpimg.imread('../images/interfaces_example19.png')
plt.figure(figsize=(10, 10))
imgplot = plt.imshow(img)
plt.axis('off')
plt.tight_layout()
../../_images/getting_started_example_example19_21_0.png
[11]:
interfaces = gpd.read_file(file_path + 'interfaces19.shp')
interfaces.head()
[11]:
id formation geometry
0 None Fault LINESTRING (3811.835 3.901, 3800.205 67.868, 3...
1 None Coal LINESTRING (299.990 2.579, 269.064 74.740, 248...
2 None Coal LINESTRING (1422.850 2103.184, 1497.390 2019.1...
3 None Coal LINESTRING (2825.632 1919.212, 2868.453 1886.7...
4 None Limestone LINESTRING (2.623 1692.420, 90.644 1675.767, 2...

Extracting Z coordinate from Digital Elevation Model#

[12]:
interfaces_coords = gg.vector.extract_xyz(gdf=interfaces, dem=topo_raster)
interfaces_coords = interfaces_coords.sort_values(by='formation', ascending=False)
interfaces_coords = interfaces_coords[interfaces_coords['formation'].isin(['Limestone', 'Fault', 'Layer2', 'Layer1', 'Coal'])]
interfaces_coords.head()
[12]:
formation geometry X Y Z
161 Limestone POINT (2453.526 2165.433) 2453.53 2165.43 411.30
171 Limestone POINT (3088.307 2439.011) 3088.31 2439.01 416.81
165 Limestone POINT (2706.091 2237.990) 2706.09 2237.99 420.49
166 Limestone POINT (2771.908 2263.366) 2771.91 2263.37 418.46
167 Limestone POINT (2836.932 2297.464) 2836.93 2297.46 419.85

Plotting the Interface Points#

[13]:
fig, ax = plt.subplots(1, figsize=(10, 10))

interfaces.plot(ax=ax, column='formation', legend=True, aspect='equal')
interfaces_coords.plot(ax=ax, column='formation', legend=True, aspect='equal')
plt.grid()
ax.set_xlabel('X [m]')
ax.set_ylabel('Y [m]')
ax.set_xlim(0, 3990)
ax.set_ylim(0, 2736)
[13]:
(0.0, 2736.0)
../../_images/getting_started_example_example19_26_1.png

Orientations from Strike Lines#

Strike lines connect outcropping stratigraphic boundaries (interfaces) of the same altitude. In other words: the intersections between topographic contours and stratigraphic boundaries at the surface. The height difference and the horizontal difference between two digitized lines is used to calculate the dip and azimuth and hence an orientation that is necessary for GemPy. In order to calculate the orientations, each set of strikes lines/LineStrings for one formation must be given an id number next to the altitude of the strike line. The id field is already predefined in QGIS. The strike line with the lowest altitude gets the id number 1, the strike line with the highest altitude the the number according to the number of digitized strike lines. It is currently recommended to use one set of strike lines for each structural element of one formation as illustrated.

[14]:
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
img = mpimg.imread('../images/orientations_example19.png')
plt.figure(figsize=(10, 10))
imgplot = plt.imshow(img)
plt.axis('off')
plt.tight_layout()
../../_images/getting_started_example_example19_28_0.png
[15]:
strikes = gpd.read_file(file_path + 'strikes19.shp')
strikes.head()
[15]:
id formation Z geometry
0 1 Fault 50 LINESTRING (3757.979 278.933, 3593.039 618.328)
1 2 Fault 100 LINESTRING (3800.800 93.375, 3345.629 1038.608)
2 3 Fault 150 LINESTRING (3248.886 1171.829, 3803.972 1.390)
3 4 Fault 200 LINESTRING (3147.384 1309.807, 3770.667 -6.540)
4 5 Fault 250 LINESTRING (3010.991 1501.708, 3731.017 -9.712)

Calculate Orientations for each formation#

[16]:
orientations_limestone = gg.vector.calculate_orientations_from_strike_lines(gdf=strikes[strikes['formation'] == 'Limestone'].sort_values(by='Z', ascending=True).reset_index())
orientations_limestone
[16]:
dip azimuth Z geometry polarity formation X Y
0 8.97 339.97 375.00 POINT (1957.914 2225.303) 1.00 Limestone 1957.91 2225.30
[17]:
orientations_fault = gg.vector.calculate_orientations_from_strike_lines(gdf=strikes[strikes['formation'] == 'Fault'].sort_values(by='Z', ascending=True).reset_index())
orientations_fault
[17]:
dip azimuth Z geometry polarity formation X Y
0 50.95 64.26 75.00 POINT (3624.362 507.311) 1.00 Fault 3624.36 507.31
1 58.76 64.49 125.00 POINT (3549.822 576.300) 1.00 Fault 3549.82 576.30
2 56.82 64.65 175.00 POINT (3492.727 619.121) 1.00 Fault 3492.73 619.12
3 53.36 64.59 225.00 POINT (3415.015 698.816) 1.00 Fault 3415.01 698.82
4 55.58 64.56 275.00 POINT (3329.373 792.784) 1.00 Fault 3329.37 792.78
5 65.78 64.73 325.00 POINT (3253.247 881.201) 1.00 Fault 3253.25 881.20
6 59.48 64.76 375.00 POINT (3172.363 982.703) 1.00 Fault 3172.36 982.70
[18]:
orientations_layer2 = gg.vector.calculate_orientations_from_strike_lines(gdf=strikes[strikes['formation'] == 'Layer2'].sort_values(by='Z', ascending=True).reset_index())
orientations_layer2
[18]:
dip azimuth Z geometry polarity formation X Y
0 28.13 269.43 175.00 POINT (2619.061 582.446) 1.00 Layer2 2619.06 582.45
1 24.29 269.17 225.00 POINT (2722.941 617.734) 1.00 Layer2 2722.94 617.73
[19]:
orientations_layer2a = gg.vector.calculate_orientations_from_strike_lines(gdf=strikes[strikes['formation'] == 'Layer2a'].sort_values(by='Z', ascending=True).reset_index())
orientations_layer2a
[19]:
dip azimuth Z geometry polarity formation X Y
0 13.90 88.28 175.00 POINT (3168.002 606.434) 1.00 Layer2a 3168.00 606.43
1 15.16 88.43 225.00 POINT (2971.541 659.960) 1.00 Layer2a 2971.54 659.96
[20]:
orientations_layer2b = gg.vector.calculate_orientations_from_strike_lines(gdf=strikes[strikes['formation'] == 'Layer2b'].sort_values(by='Z', ascending=True).reset_index())
orientations_layer2b
[20]:
dip azimuth Z geometry polarity formation X Y
0 14.01 89.59 225.00 POINT (963.913 621.104) 1.00 Layer2b 963.91 621.10
[21]:
orientations_layer2c = gg.vector.calculate_orientations_from_strike_lines(gdf=strikes[strikes['formation'] == 'Layer2c'].sort_values(by='Z', ascending=True).reset_index())
orientations_layer2c
[21]:
dip azimuth Z geometry polarity formation X Y
0 24.58 269.89 225.00 POINT (722.451 459.732) 1.00 Layer2c 722.45 459.73
[22]:
orientations_layer1a = gg.vector.calculate_orientations_from_strike_lines(gdf=strikes[strikes['formation'] == 'Layer1a'].sort_values(by='Z', ascending=True).reset_index())
orientations_layer1a
[22]:
dip azimuth Z geometry polarity formation X Y
0 29.74 269.93 175.00 POINT (2311.583 820.142) 1.00 Layer1a 2311.58 820.14
1 25.64 269.79 225.00 POINT (2410.309 818.159) 1.00 Layer1a 2410.31 818.16
2 21.62 269.51 275.00 POINT (2527.670 849.086) 1.00 Layer1a 2527.67 849.09
3 28.17 269.31 325.00 POINT (2639.084 904.594) 1.00 Layer1a 2639.08 904.59
[23]:
orientations_layer1b = gg.vector.calculate_orientations_from_strike_lines(gdf=strikes[strikes['formation'] == 'Layer1b'].sort_values(by='Z', ascending=True).reset_index())
orientations_layer1b
[23]:
dip azimuth Z geometry polarity formation X Y
0 13.52 89.97 225.00 POINT (1561.027 623.284) 1.00 Layer1b 1561.03 623.28
1 13.31 90.14 275.00 POINT (1349.698 678.991) 1.00 Layer1b 1349.70 678.99
2 15.20 90.57 325.00 POINT (1147.488 736.879) 1.00 Layer1b 1147.49 736.88
[24]:
orientations_layer1c = gg.vector.calculate_orientations_from_strike_lines(gdf=strikes[strikes['formation'] == 'Layer1c'].sort_values(by='Z', ascending=True).reset_index())
orientations_layer1c
[24]:
dip azimuth Z geometry polarity formation X Y
0 26.25 269.71 275.00 POINT (514.888 575.111) 1.00 Layer1c 514.89 575.11
1 28.43 269.71 325.00 POINT (612.623 721.416) 1.00 Layer1c 612.62 721.42
[25]:
orientations_layer1d = gg.vector.calculate_orientations_from_strike_lines(gdf=strikes[strikes['formation'] == 'Layer1d'].sort_values(by='Z', ascending=True).reset_index())
orientations_layer1d
[25]:
dip azimuth Z geometry polarity formation X Y
0 17.60 89.66 75.00 POINT (3539.315 1371.263) 1.00 Layer1d 3539.31 1371.26
1 13.66 89.75 125.00 POINT (3356.334 1492.986) 1.00 Layer1d 3356.33 1492.99
[26]:
orientations_coal = gg.vector.calculate_orientations_from_strike_lines(gdf=strikes[strikes['formation'] == 'Coal'].sort_values(by='Z', ascending=True).reset_index())
orientations_coal
[26]:
dip azimuth Z geometry polarity formation X Y
0 14.02 89.91 225.00 POINT (1955.842 1142.621) 1.00 Coal 1955.84 1142.62
1 14.99 89.72 275.00 POINT (1761.056 1331.614) 1.00 Coal 1761.06 1331.61
2 13.15 89.66 325.00 POINT (1558.846 1571.094) 1.00 Coal 1558.85 1571.09
3 2.56 269.64 375.00 POINT (2010.954 1589.465) 1.00 Coal 2010.95 1589.47
[27]:
orientations_coal1 = gg.vector.calculate_orientations_from_strike_lines(gdf=strikes[strikes['formation'] == 'Coal1'].sort_values(by='Z', ascending=True).reset_index())
orientations_coal1
[27]:
dip azimuth Z geometry polarity formation X Y
0 24.80 270.11 275.00 POINT (316.048 650.841) 1.00 Coal1 316.05 650.84
1 28.64 269.67 325.00 POINT (421.118 644.100) 1.00 Coal1 421.12 644.10
[28]:
orientations_coal2 = gg.vector.calculate_orientations_from_strike_lines(gdf=strikes[strikes['formation'] == 'Coal1'].sort_values(by='Z', ascending=True).reset_index())
orientations_coal2
[28]:
dip azimuth Z geometry polarity formation X Y
0 24.80 270.11 275.00 POINT (316.048 650.841) 1.00 Coal1 316.05 650.84
1 28.64 269.67 325.00 POINT (421.118 644.100) 1.00 Coal1 421.12 644.10
[29]:
orientations_coal3 = gg.vector.calculate_orientations_from_strike_lines(gdf=strikes[strikes['formation'] == 'Coal3'].sort_values(by='Z', ascending=True).reset_index())
orientations_coal3
[29]:
dip azimuth Z geometry polarity formation X Y
0 13.05 89.95 125.00 POINT (3760.576 1586.625) 1.00 Coal3 3760.58 1586.62
1 14.01 90.25 175.00 POINT (3551.229 1787.645) 1.00 Coal3 3551.23 1787.65
2 14.47 90.32 225.00 POINT (3352.588 1968.841) 1.00 Coal3 3352.59 1968.84
3 27.49 90.07 300.00 POINT (3158.704 2070.343) 1.00 Coal3 3158.70 2070.34
4 14.49 89.80 375.00 POINT (2964.424 2098.493) 1.00 Coal3 2964.42 2098.49

Merging Orientations#

[30]:
import pandas as pd
orientations = pd.concat([orientations_limestone, orientations_fault, orientations_layer2, orientations_layer2a, orientations_layer2b, orientations_layer2c, orientations_layer1a, orientations_layer1b, orientations_layer1c,  orientations_layer1d,  orientations_coal,  orientations_coal1, orientations_coal2,  orientations_coal3]).reset_index()
orientations['formation'] = ['Limestone', 'Fault', 'Fault', 'Fault', 'Fault', 'Fault', 'Fault', 'Fault', 'Layer2', 'Layer2', 'Layer2', 'Layer2', 'Layer2', 'Layer2', 'Layer1', 'Layer1', 'Layer1', 'Layer1', 'Layer1', 'Layer1', 'Layer1', 'Layer1', 'Layer1', 'Layer1', 'Layer1', 'Coal', 'Coal', 'Coal', 'Coal', 'Coal', 'Coal', 'Coal', 'Coal', 'Coal', 'Coal', 'Coal', 'Coal', 'Coal']
orientations = orientations[orientations['formation'].isin(['Limestone', 'Fault', 'Layer2', 'Layer1', 'Coal'])]
orientations
[30]:
index dip azimuth Z geometry polarity formation X Y
0 0 8.97 339.97 375.00 POINT (1957.914 2225.303) 1.00 Limestone 1957.91 2225.30
1 0 50.95 64.26 75.00 POINT (3624.362 507.311) 1.00 Fault 3624.36 507.31
2 1 58.76 64.49 125.00 POINT (3549.822 576.300) 1.00 Fault 3549.82 576.30
3 2 56.82 64.65 175.00 POINT (3492.727 619.121) 1.00 Fault 3492.73 619.12
4 3 53.36 64.59 225.00 POINT (3415.015 698.816) 1.00 Fault 3415.01 698.82
5 4 55.58 64.56 275.00 POINT (3329.373 792.784) 1.00 Fault 3329.37 792.78
6 5 65.78 64.73 325.00 POINT (3253.247 881.201) 1.00 Fault 3253.25 881.20
7 6 59.48 64.76 375.00 POINT (3172.363 982.703) 1.00 Fault 3172.36 982.70
8 0 28.13 269.43 175.00 POINT (2619.061 582.446) 1.00 Layer2 2619.06 582.45
9 1 24.29 269.17 225.00 POINT (2722.941 617.734) 1.00 Layer2 2722.94 617.73
10 0 13.90 88.28 175.00 POINT (3168.002 606.434) 1.00 Layer2 3168.00 606.43
11 1 15.16 88.43 225.00 POINT (2971.541 659.960) 1.00 Layer2 2971.54 659.96
12 0 14.01 89.59 225.00 POINT (963.913 621.104) 1.00 Layer2 963.91 621.10
13 0 24.58 269.89 225.00 POINT (722.451 459.732) 1.00 Layer2 722.45 459.73
14 0 29.74 269.93 175.00 POINT (2311.583 820.142) 1.00 Layer1 2311.58 820.14
15 1 25.64 269.79 225.00 POINT (2410.309 818.159) 1.00 Layer1 2410.31 818.16
16 2 21.62 269.51 275.00 POINT (2527.670 849.086) 1.00 Layer1 2527.67 849.09
17 3 28.17 269.31 325.00 POINT (2639.084 904.594) 1.00 Layer1 2639.08 904.59
18 0 13.52 89.97 225.00 POINT (1561.027 623.284) 1.00 Layer1 1561.03 623.28
19 1 13.31 90.14 275.00 POINT (1349.698 678.991) 1.00 Layer1 1349.70 678.99
20 2 15.20 90.57 325.00 POINT (1147.488 736.879) 1.00 Layer1 1147.49 736.88
21 0 26.25 269.71 275.00 POINT (514.888 575.111) 1.00 Layer1 514.89 575.11
22 1 28.43 269.71 325.00 POINT (612.623 721.416) 1.00 Layer1 612.62 721.42
23 0 17.60 89.66 75.00 POINT (3539.315 1371.263) 1.00 Layer1 3539.31 1371.26
24 1 13.66 89.75 125.00 POINT (3356.334 1492.986) 1.00 Layer1 3356.33 1492.99
25 0 14.02 89.91 225.00 POINT (1955.842 1142.621) 1.00 Coal 1955.84 1142.62
26 1 14.99 89.72 275.00 POINT (1761.056 1331.614) 1.00 Coal 1761.06 1331.61
27 2 13.15 89.66 325.00 POINT (1558.846 1571.094) 1.00 Coal 1558.85 1571.09
28 3 2.56 269.64 375.00 POINT (2010.954 1589.465) 1.00 Coal 2010.95 1589.47
29 0 24.80 270.11 275.00 POINT (316.048 650.841) 1.00 Coal 316.05 650.84
30 1 28.64 269.67 325.00 POINT (421.118 644.100) 1.00 Coal 421.12 644.10
31 0 24.80 270.11 275.00 POINT (316.048 650.841) 1.00 Coal 316.05 650.84
32 1 28.64 269.67 325.00 POINT (421.118 644.100) 1.00 Coal 421.12 644.10
33 0 13.05 89.95 125.00 POINT (3760.576 1586.625) 1.00 Coal 3760.58 1586.62
34 1 14.01 90.25 175.00 POINT (3551.229 1787.645) 1.00 Coal 3551.23 1787.65
35 2 14.47 90.32 225.00 POINT (3352.588 1968.841) 1.00 Coal 3352.59 1968.84
36 3 27.49 90.07 300.00 POINT (3158.704 2070.343) 1.00 Coal 3158.70 2070.34
37 4 14.49 89.80 375.00 POINT (2964.424 2098.493) 1.00 Coal 2964.42 2098.49

Plotting the Orientations#

[31]:
fig, ax = plt.subplots(1, figsize=(10, 10))

interfaces.plot(ax=ax, column='formation', legend=True, aspect='equal')
interfaces_coords.plot(ax=ax, column='formation', legend=True, aspect='equal')
orientations.plot(ax=ax, color='red', aspect='equal')
plt.grid()
ax.set_xlabel('X [m]')
ax.set_ylabel('Y [m]')
ax.set_xlim(0, 3990)
ax.set_ylim(0, 2736)
[31]:
(0.0, 2736.0)
../../_images/getting_started_example_example19_48_1.png

GemPy Model Construction#

The structural geological model will be constructed using the GemPy package.

[32]:
import gempy as gp
WARNING (theano.configdefaults): g++ not available, if using conda: `conda install m2w64-toolchain`
WARNING (theano.configdefaults): g++ not detected ! Theano will be unable to execute optimized C-implementations (for both CPU and GPU) and will default to Python implementations. Performance will be severely degraded. To remove this warning, set Theano flags cxx to an empty string.
WARNING (theano.tensor.blas): Using NumPy C-API based implementation for BLAS functions.

Creating new Model#

[33]:
geo_model = gp.create_model('Model18')
geo_model
[33]:
Model18  2022-04-05 11:16

Initiate Data#

[34]:
gp.init_data(geo_model, [0, 3990, 0, 2736, 0, 1000], [100, 100, 100],
             surface_points_df=interfaces_coords[interfaces_coords['Z'] != 0],
             orientations_df=orientations,
             default_values=True)
Active grids: ['regular']
[34]:
Model18  2022-04-05 11:16

Model Surfaces#

[35]:
geo_model.surfaces
[35]:
surface series order_surfaces color id
0 Limestone Default series 1 #015482 1
1 Layer2 Default series 2 #9f0052 2
2 Layer1 Default series 3 #ffbe00 3
3 Fault Default series 4 #728f02 4
4 Coal Default series 5 #443988 5

Mapping the Stack to Surfaces#

[36]:
gp.map_stack_to_surfaces(geo_model,
                         {
                          'Fault1': ('Fault'),
                          'Strata1': ('Limestone'),
                          'Strata2': ('Coal', 'Layer1', 'Layer2'),
                         },
                         remove_unused_series=True)
geo_model.add_surfaces('Basement')
geo_model.set_is_fault(['Fault1'])
Fault colors changed. If you do not like this behavior, set change_color to False.
[36]:
order_series BottomRelation isActive isFault isFinite
Fault1 1 Fault True True False
Strata1 2 Erosion True False False
Strata2 3 Erosion True False False

Showing the Number of Data Points#

[37]:
gg.utils.show_number_of_data_points(geo_model=geo_model)
[37]:
surface series order_surfaces color id No. of Interfaces No. of Orientations
3 Fault Fault1 1 #527682 1 41 7
0 Limestone Strata1 1 #9f0052 2 63 1
1 Layer2 Strata2 1 #ffbe00 3 97 6
2 Layer1 Strata2 2 #728f02 4 115 11
4 Coal Strata2 3 #443988 5 74 13
5 Basement Strata2 4 #ff3f20 6 0 0

Loading Digital Elevation Model#

[38]:
geo_model.set_topography(
    source='gdal', filepath=file_path + 'raster19.tif')
Cropped raster to geo_model.grid.extent.
depending on the size of the raster, this can take a while...
storing converted file...
Active grids: ['regular' 'topography']
[38]:
Grid Object. Values:
array([[  19.95      ,   13.68      ,    5.        ],
       [  19.95      ,   13.68      ,   15.        ],
       [  19.95      ,   13.68      ,   25.        ],
       ...,
       [3985.        , 2711.03649635,  363.65274048],
       [3985.        , 2721.02189781,  365.24542236],
       [3985.        , 2731.00729927,  366.84155273]])

Defining Custom Section#

[39]:
custom_section = gpd.read_file(file_path + 'customsection19.shp')
custom_section_dict = gg.utils.to_section_dict(custom_section, section_column='name')
geo_model.set_section_grid(custom_section_dict)
Active grids: ['regular' 'topography' 'sections']
[39]:
start stop resolution dist
Section1 [10.354283343821066, 2194.773034267066] [3623.1721887321155, 2153.538062563776] [100, 80] 3613.05
[40]:
gp.plot.plot_section_traces(geo_model)
[40]:
<gempy.plot.visualization_2d.Plot2D at 0x2666448b100>
../../_images/getting_started_example_example19_65_1.png

Plotting Input Data#

[41]:
gp.plot_2d(geo_model, direction='z', show_lith=False, show_boundaries=False)
plt.grid()
../../_images/getting_started_example_example19_67_0.png
[42]:
gp.plot_3d(geo_model, image=False, plotter_type='basic', notebook=True)
../../_images/getting_started_example_example19_68_0.png
[42]:
<gempy.plot.vista.GemPyToVista at 0x26662cf3490>

Setting the Interpolator#

[43]:
gp.set_interpolator(geo_model,
                    compile_theano=True,
                    theano_optimizer='fast_compile',
                    verbose=[],
                    update_kriging=False
                    )
Compiling theano function...
Level of Optimization:  fast_compile
Device:  cpu
Precision:  float64
Number of faults:  1
Compilation Done!
Kriging values:
                     values
range              4940.22
$C_o$            581090.38
drift equations  [3, 3, 3]
[43]:
<gempy.core.interpolator.InterpolatorModel at 0x26662201100>

Computing Model#

[44]:
sol = gp.compute_model(geo_model, compute_mesh=True)

Plotting Cross Sections#

[45]:
gp.plot_2d(geo_model, section_names=['Section1'], show_topography=True, show_data=False)
[45]:
<gempy.plot.visualization_2d.Plot2D at 0x26664a9a0d0>
../../_images/getting_started_example_example19_74_1.png
[46]:
gp.plot_2d(geo_model, direction=['x', 'x', 'y', 'y'], cell_number=[25, 75, 25, 75], show_topography=True, show_data=False)
[46]:
<gempy.plot.visualization_2d.Plot2D at 0x26664aa18b0>
../../_images/getting_started_example_example19_75_1.png

Plotting 3D Model#

[47]:
gpv = gp.plot_3d(geo_model, image=False, show_topography=True,
                 plotter_type='basic', notebook=True, show_lith=True)
../../_images/getting_started_example_example19_77_0.png
[ ]: