Example 15 - Three Point Problem
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 1187 m wide (W-E extent) and 1479 m high (N-S extent). The vertical model extent varies between 100 m and 300 m. This example represents a classic “three-point-problem” of planar dipping layers (green and yellow) above an unspecified basement (purple) which are separated by a fault (blue). The interface points were not recorded at the surface
but rather in boreholes at depth. The fault has an offset of 20 m but no further interface points are located beyond the fault. This will be dealt with in a two model approach.
The map has been georeferenced with QGIS. The outcrops of the layers were digitized in QGIS. 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
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
.
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.
Downloading file 'example15_three_point_problem.zip' from 'https://rwth-aachen.sciebo.de/s/AfXRsZywYDbUF34/download?path=%2Fexample15_three_point_problem.zip' to 'C:\Users\ale93371\Documents\gemgis\docs\getting_started\example\data\example15'.
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()
.
|
id |
Z |
geometry |
0 |
None |
180 |
LINESTRING (608.177 -0.021, 598.911 22.516, 58... |
1 |
None |
190 |
LINESTRING (323.662 216.425, 321.832 254.178, ... |
2 |
None |
200 |
LINESTRING (142.794 190.113, 153.433 227.980, ... |
3 |
None |
250 |
LINESTRING (1.395 1193.695, 20.385 1232.592, 3... |
4 |
None |
240 |
LINESTRING (1.623 925.311, 8.487 939.039, 13.7... |
Interpolating the contour lines
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 + 'raster15.tif', extent=[0, 1187, 0, 1479], crs='EPSG:4326', overwrite_file=True)
Opening Raster
The previously computed and saved raster can now be opened using rasterio.
Interface Points of stratigraphic boundaries
The interface points for this three point example will be digitized as points with the respective height value as given by the borehole information and the respective formation.
|
id |
formation |
Z |
geometry |
0 |
None |
Shale |
190 |
POINT (69.806 954.941) |
1 |
None |
Ironstone |
170 |
POINT (69.806 954.941) |
2 |
None |
Ironstone |
190 |
POINT (145.769 562.774) |
3 |
None |
Ironstone |
185 |
POINT (264.746 660.701) |
4 |
None |
Shale |
210 |
POINT (146.226 563.346) |
Plotting the Interface Points
Orientations from Strike Lines
For this three point example, an orientation is calculated using gg.vector.calculate_orientation_for_three_point_problem()
.
|
id |
formation |
Z |
geometry |
1 |
None |
Ironstone |
170 |
POINT (69.806 954.941) |
2 |
None |
Ironstone |
190 |
POINT (145.769 562.774) |
3 |
None |
Ironstone |
185 |
POINT (264.746 660.701) |
|
Z |
formation |
azimuth |
dip |
polarity |
X |
Y |
geometry |
0 |
181.67 |
Ironstone |
-179.95 |
177.08 |
1 |
160.11 |
726.14 |
POINT (160.107 726.139) |
Changing the Data Type of Fields
<class 'geopandas.geodataframe.GeoDataFrame'>
RangeIndex: 1 entries, 0 to 0
Data columns (total 8 columns):
# Column Non-Null Count Dtype
--- ------ -------------- -----
0 Z 1 non-null float64
1 formation 1 non-null object
2 azimuth 1 non-null float64
3 dip 1 non-null float64
4 polarity 1 non-null float64
5 X 1 non-null float64
6 Y 1 non-null float64
7 geometry 1 non-null geometry
dtypes: float64(6), geometry(1), object(1)
memory usage: 192.0+ bytes
|
id |
formation |
Z |
geometry |
0 |
None |
Shale |
190 |
POINT (69.806 954.941) |
4 |
None |
Shale |
210 |
POINT (146.226 563.346) |
5 |
None |
Shale |
205 |
POINT (264.746 660.701) |
|
Z |
formation |
azimuth |
dip |
polarity |
X |
Y |
geometry |
0 |
201.67 |
Shale |
-179.77 |
177.07 |
1 |
160.26 |
726.33 |
POINT (160.259 726.329) |
Changing the Data Type of Fields
<class 'geopandas.geodataframe.GeoDataFrame'>
RangeIndex: 1 entries, 0 to 0
Data columns (total 8 columns):
# Column Non-Null Count Dtype
--- ------ -------------- -----
0 Z 1 non-null float64
1 formation 1 non-null object
2 azimuth 1 non-null float64
3 dip 1 non-null float64
4 polarity 1 non-null float64
5 X 1 non-null float64
6 Y 1 non-null float64
7 geometry 1 non-null geometry
dtypes: float64(6), geometry(1), object(1)
memory usage: 192.0+ bytes
|
formation |
dip |
azimuth |
polarity |
geometry |
X |
Y |
Z |
0 |
Fault |
90.00 |
280.00 |
1.00 |
POINT (792.591 727.511) |
792.59 |
727.51 |
215.87 |
Merging Orientations
|
index |
Z |
formation |
azimuth |
dip |
polarity |
X |
Y |
geometry |
0 |
0 |
181.67 |
Ironstone |
359.95 |
2.92 |
1.00 |
160.11 |
726.14 |
POINT (160.107 726.139) |
1 |
0 |
201.67 |
Shale |
359.77 |
2.93 |
1.00 |
160.26 |
726.33 |
POINT (160.259 726.329) |
2 |
0 |
215.87 |
Fault |
280.00 |
90.00 |
1.00 |
792.59 |
727.51 |
POINT (792.591 727.511) |
Plotting the Orientations
Text(179.77829589465532, 0.5, 'Y [m]')
GemPy Model Construction (Part A)
The structural geological model will be constructed using the GemPy
package. The first model is calculated without the fault.
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
Model15a 2022-04-05 11:07
Initiate Data
The fault interfaces and orientations will be removed from the first model to model the layers also beyond the fault. As the information is provided that the fault has an offset of 20 m, the layers will be exported, the boundaries will be digitized and the elevation will be reduced by 20 m.
|
index |
formation |
Z |
geometry |
X |
Y |
0 |
0 |
Shale |
190.00 |
POINT (69.806 954.941) |
69.81 |
954.94 |
1 |
1 |
Ironstone |
170.00 |
POINT (69.806 954.941) |
69.81 |
954.94 |
2 |
2 |
Ironstone |
190.00 |
POINT (145.769 562.774) |
145.77 |
562.77 |
3 |
3 |
Ironstone |
185.00 |
POINT (264.746 660.701) |
264.75 |
660.70 |
4 |
4 |
Shale |
210.00 |
POINT (146.226 563.346) |
146.23 |
563.35 |
5 |
5 |
Shale |
205.00 |
POINT (264.746 660.701) |
264.75 |
660.70 |
|
index |
Z |
formation |
azimuth |
dip |
polarity |
X |
Y |
geometry |
0 |
0 |
181.67 |
Ironstone |
359.95 |
2.92 |
1.00 |
160.11 |
726.14 |
POINT (160.107 726.139) |
1 |
0 |
201.67 |
Shale |
359.77 |
2.93 |
1.00 |
160.26 |
726.33 |
POINT (160.259 726.329) |
Active grids: ['regular']
Model15a 2022-04-05 11:07
Model Surfaces
| surface | series | order_surfaces | color | id |
0 |
Shale |
Default series |
1 |
#015482 |
1 |
1 |
Ironstone |
Default series |
2 |
#9f0052 |
2 |
Mapping the Stack to Surfaces
| surface | series | order_surfaces | color | id |
0 |
Shale |
Strata1 |
1 |
#015482 |
1 |
1 |
Ironstone |
Strata1 |
2 |
#9f0052 |
2 |
2 |
Basement |
Strata1 |
3 |
#ffbe00 |
3 |
Showing the Number of Data Points
| surface | series | order_surfaces | color | id | No. of Interfaces | No. of Orientations |
0 |
Shale |
Strata1 |
1 |
#015482 |
1 |
3 |
1 |
1 |
Ironstone |
Strata1 |
2 |
#9f0052 |
2 |
3 |
1 |
2 |
Basement |
Strata1 |
3 |
#ffbe00 |
3 |
0 |
0 |
Loading Digital Elevation Model
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']
Grid Object. Values:
array([[ 5.935 , 7.395 , 101. ],
[ 5.935 , 7.395 , 103. ],
[ 5.935 , 7.395 , 105. ],
...,
[1184.49578059, 1466.50844595, 275.3008728 ],
[1184.49578059, 1471.50506757, 275.80532837],
[1184.49578059, 1476.50168919, 276.31124878]])
Setting the Interpolator
Compiling theano function...
Level of Optimization: fast_compile
Device: cpu
Precision: float64
Number of faults: 0
Compilation Done!
Kriging values:
values
range 1906.94
$C_o$ 86581.19
drift equations [3]
<gempy.core.interpolator.InterpolatorModel at 0x1e685ddafd0>
Plotting Cross Sections
<gempy.plot.visualization_2d.Plot2D at 0x1e68a3e4a90>
Creating Polygons from GemPy Model
A GeoDataFrame containing polygons representing the geological map can be created using gg.post.extract_lithologies()
. This data is now being saved and the constructed layer boundaries beyond the fault in the east are being digitized. Their elevation values will be reduced by 20 m to simulate the offset of the fault. The model will then be recalculated again.
|
formation |
geometry |
0 |
Basement |
POLYGON ((22.538 3.254, 22.804 2.498, 27.546 2... |
1 |
Ironstone |
POLYGON ((7.513 2.498, 12.521 2.498, 17.530 2.... |
2 |
Ironstone |
POLYGON ((5.851 192.370, 7.513 194.147, 10.887... |
3 |
Shale |
POLYGON ((4.134 362.255, 7.513 365.081, 10.021... |
|
formation |
geometry |
0 |
Conglomerate |
POLYGON ((22.538 3.254, 21.064 7.495, 19.356 1... |
1 |
Ironstone |
POLYGON ((7.513 2.498, 2.504 2.498, 2.504 7.49... |
2 |
Ironstone |
POLYGON ((5.851 192.370, 2.504 188.069, 2.504 ... |
3 |
Shale |
POLYGON ((4.134 362.255, 2.504 360.939, 2.504 ... |
Preparing Interfaces beyond the fault
|
formation |
geometry |
X |
Y |
Z |
0 |
Shale |
POINT (778.812 601.522) |
778.81 |
601.52 |
208.06 |
1 |
Shale |
POINT (783.821 597.991) |
783.82 |
597.99 |
208.15 |
2 |
Shale |
POINT (788.829 594.245) |
788.83 |
594.25 |
208.26 |
3 |
Shale |
POINT (791.557 592.100) |
791.56 |
592.10 |
208.71 |
4 |
Shale |
POINT (797.430 587.103) |
797.43 |
587.10 |
208.89 |
... |
... |
... |
... |
... |
... |
250 |
Ironstone |
POINT (1169.470 270.001) |
1169.47 |
270.00 |
205.13 |
251 |
Ironstone |
POINT (1172.985 267.319) |
1172.99 |
267.32 |
205.24 |
252 |
Ironstone |
POINT (1174.479 266.187) |
1174.48 |
266.19 |
205.24 |
253 |
Ironstone |
POINT (1179.487 262.439) |
1179.49 |
262.44 |
205.33 |
254 |
Ironstone |
POINT (1184.496 258.751) |
1184.50 |
258.75 |
205.42 |
255 rows × 5 columns
Substracting the fault offset
|
formation |
geometry |
X |
Y |
Z |
0 |
Shale |
POINT (778.812 601.522) |
778.81 |
601.52 |
188.06 |
1 |
Shale |
POINT (783.821 597.991) |
783.82 |
597.99 |
188.15 |
2 |
Shale |
POINT (788.829 594.245) |
788.83 |
594.25 |
188.26 |
3 |
Shale |
POINT (791.557 592.100) |
791.56 |
592.10 |
188.71 |
4 |
Shale |
POINT (797.430 587.103) |
797.43 |
587.10 |
188.89 |
... |
... |
... |
... |
... |
... |
250 |
Ironstone |
POINT (1169.470 270.001) |
1169.47 |
270.00 |
185.13 |
251 |
Ironstone |
POINT (1172.985 267.319) |
1172.99 |
267.32 |
185.24 |
252 |
Ironstone |
POINT (1174.479 266.187) |
1174.48 |
266.19 |
185.24 |
253 |
Ironstone |
POINT (1179.487 262.439) |
1179.49 |
262.44 |
185.33 |
254 |
Ironstone |
POINT (1184.496 258.751) |
1184.50 |
258.75 |
185.42 |
255 rows × 5 columns
Mergin old and new interfaces
|
level_0 |
index |
formation |
Z |
geometry |
X |
Y |
0 |
0 |
0.00 |
Shale |
190.00 |
POINT (69.806 954.941) |
69.81 |
954.94 |
1 |
1 |
1.00 |
Ironstone |
170.00 |
POINT (69.806 954.941) |
69.81 |
954.94 |
2 |
2 |
2.00 |
Ironstone |
190.00 |
POINT (145.769 562.774) |
145.77 |
562.77 |
3 |
3 |
3.00 |
Ironstone |
185.00 |
POINT (264.746 660.701) |
264.75 |
660.70 |
4 |
4 |
4.00 |
Shale |
210.00 |
POINT (146.226 563.346) |
146.23 |
563.35 |
5 |
5 |
5.00 |
Shale |
205.00 |
POINT (264.746 660.701) |
264.75 |
660.70 |
6 |
6 |
0.00 |
Fault |
178.76 |
POINT (683.911 0.608) |
683.91 |
0.61 |
7 |
7 |
1.00 |
Fault |
254.62 |
POINT (899.671 1477.524) |
899.67 |
1477.52 |
8 |
177 |
NaN |
Ironstone |
176.27 |
POINT (949.099 437.906) |
949.10 |
437.91 |
9 |
199 |
NaN |
Ironstone |
177.36 |
POINT (1039.795 417.218) |
1039.79 |
417.22 |
10 |
156 |
NaN |
Ironstone |
176.90 |
POINT (853.939 427.352) |
853.94 |
427.35 |
11 |
127 |
NaN |
Shale |
194.60 |
POINT (1169.470 472.641) |
1169.47 |
472.64 |
12 |
4 |
NaN |
Shale |
188.89 |
POINT (797.430 587.103) |
797.43 |
587.10 |
13 |
230 |
NaN |
Ironstone |
182.46 |
POINT (1114.378 320.613) |
1114.38 |
320.61 |
14 |
155 |
NaN |
Ironstone |
176.77 |
POINT (848.930 428.164) |
848.93 |
428.16 |
15 |
196 |
NaN |
Ironstone |
177.05 |
POINT (1034.243 423.251) |
1034.24 |
423.25 |
16 |
110 |
NaN |
Shale |
191.82 |
POINT (1124.395 527.284) |
1124.39 |
527.28 |
17 |
0 |
NaN |
Shale |
188.06 |
POINT (778.812 601.522) |
778.81 |
601.52 |
18 |
20 |
NaN |
Shale |
190.81 |
POINT (838.823 547.130) |
838.82 |
547.13 |
19 |
74 |
NaN |
Shale |
187.12 |
POINT (1034.243 618.288) |
1034.24 |
618.29 |
20 |
92 |
NaN |
Shale |
188.89 |
POINT (1085.673 582.106) |
1085.67 |
582.11 |
21 |
138 |
NaN |
Ironstone |
175.84 |
POINT (783.821 447.680) |
783.82 |
447.68 |
22 |
119 |
NaN |
Shale |
193.19 |
POINT (1144.428 499.461) |
1144.43 |
499.46 |
23 |
94 |
NaN |
Shale |
189.24 |
POINT (1089.653 577.110) |
1089.65 |
577.11 |
24 |
77 |
NaN |
Shale |
187.33 |
POINT (1044.259 616.032) |
1044.26 |
616.03 |
25 |
123 |
NaN |
Shale |
193.80 |
POINT (1154.445 488.152) |
1154.45 |
488.15 |
26 |
53 |
NaN |
Shale |
189.23 |
POINT (965.782 582.106) |
965.78 |
582.11 |
27 |
8 |
NaN |
Shale |
189.40 |
POINT (807.567 577.110) |
807.57 |
577.11 |
28 |
194 |
NaN |
Ironstone |
176.60 |
POINT (1024.226 432.683) |
1024.23 |
432.68 |
29 |
160 |
NaN |
Ironstone |
177.25 |
POINT (868.964 425.396) |
868.96 |
425.40 |
30 |
181 |
NaN |
Ironstone |
176.12 |
POINT (969.133 446.025) |
969.13 |
446.03 |
31 |
55 |
NaN |
Shale |
189.01 |
POINT (971.197 587.103) |
971.20 |
587.10 |
32 |
233 |
NaN |
Ironstone |
183.05 |
POINT (1122.155 312.289) |
1122.16 |
312.29 |
33 |
241 |
NaN |
Ironstone |
184.02 |
POINT (1142.482 292.302) |
1142.48 |
292.30 |
34 |
144 |
NaN |
Ironstone |
176.33 |
POINT (803.854 440.894) |
803.85 |
440.89 |
35 |
252 |
NaN |
Ironstone |
185.24 |
POINT (1174.479 266.187) |
1174.48 |
266.19 |
36 |
152 |
NaN |
Ironstone |
176.80 |
POINT (833.905 431.359) |
833.91 |
431.36 |
37 |
3 |
NaN |
Shale |
188.71 |
POINT (791.557 592.100) |
791.56 |
592.10 |
38 |
129 |
NaN |
Shale |
194.85 |
POINT (1174.933 467.184) |
1174.93 |
467.18 |
39 |
46 |
NaN |
Shale |
190.13 |
POINT (944.754 562.120) |
944.75 |
562.12 |
40 |
169 |
NaN |
Ironstone |
176.79 |
POINT (914.040 427.799) |
914.04 |
427.80 |
41 |
211 |
NaN |
Ironstone |
179.46 |
POINT (1069.302 377.432) |
1069.30 |
377.43 |
42 |
186 |
NaN |
Ironstone |
175.71 |
POINT (989.167 448.328) |
989.17 |
448.33 |
43 |
206 |
NaN |
Ironstone |
178.75 |
POINT (1059.017 392.235) |
1059.02 |
392.23 |
44 |
149 |
NaN |
Ironstone |
176.38 |
POINT (823.888 434.155) |
823.89 |
434.15 |
45 |
212 |
NaN |
Ironstone |
179.93 |
POINT (1072.891 372.248) |
1072.89 |
372.25 |
46 |
225 |
NaN |
Ironstone |
181.85 |
POINT (1103.757 332.275) |
1103.76 |
332.28 |
47 |
187 |
NaN |
Ironstone |
175.83 |
POINT (994.175 447.621) |
994.18 |
447.62 |
48 |
42 |
NaN |
Shale |
190.77 |
POINT (931.344 552.127) |
931.34 |
552.13 |
49 |
109 |
NaN |
Shale |
191.38 |
POINT (1121.307 532.140) |
1121.31 |
532.14 |
50 |
108 |
NaN |
Shale |
191.45 |
POINT (1119.386 535.097) |
1119.39 |
535.10 |
51 |
38 |
NaN |
Shale |
191.03 |
POINT (919.049 545.720) |
919.05 |
545.72 |
52 |
192 |
NaN |
Ironstone |
176.51 |
POINT (1018.269 437.204) |
1018.27 |
437.20 |
53 |
121 |
NaN |
Shale |
193.50 |
POINT (1149.437 493.655) |
1149.44 |
493.66 |
54 |
254 |
NaN |
Ironstone |
185.42 |
POINT (1184.496 258.751) |
1184.50 |
258.75 |
55 |
222 |
NaN |
Ironstone |
181.17 |
POINT (1094.344 343.135) |
1094.34 |
343.14 |
56 |
184 |
NaN |
Ironstone |
175.73 |
POINT (979.150 448.200) |
979.15 |
448.20 |
57 |
209 |
NaN |
Ironstone |
178.98 |
POINT (1064.293 384.655) |
1064.29 |
384.65 |
GemPy Model Construction (Part B)
The structural geological model will be constructed using the GemPy
package.
Creating new Model
Model15b 2022-04-05 11:08
Initiate Data
Active grids: ['regular']
Model15b 2022-04-05 11:08
Model Surfaces
| surface | series | order_surfaces | color | id |
0 |
Shale |
Default series |
1 |
#015482 |
1 |
1 |
Ironstone |
Default series |
2 |
#9f0052 |
2 |
2 |
Fault |
Default series |
3 |
#ffbe00 |
3 |
Mapping the Stack to Surfaces
Fault colors changed. If you do not like this behavior, set change_color to False.
|
order_series |
BottomRelation |
isActive |
isFault |
isFinite |
Fault1 |
1 |
Fault |
True |
True |
False |
Strata1 |
2 |
Erosion |
True |
False |
False |
Showing the Number of Data Points
| surface | series | order_surfaces | color | id | No. of Interfaces | No. of Orientations |
2 |
Fault |
Fault1 |
1 |
#527682 |
1 |
2 |
1 |
0 |
Shale |
Strata1 |
1 |
#9f0052 |
2 |
25 |
1 |
1 |
Ironstone |
Strata1 |
2 |
#ffbe00 |
3 |
31 |
1 |
3 |
Basement |
Strata1 |
3 |
#728f02 |
4 |
0 |
0 |
Loading Digital Elevation Model
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']
Grid Object. Values:
array([[ 5.935 , 7.395 , 101. ],
[ 5.935 , 7.395 , 103. ],
[ 5.935 , 7.395 , 105. ],
...,
[1184.49578059, 1466.50844595, 275.3008728 ],
[1184.49578059, 1471.50506757, 275.80532837],
[1184.49578059, 1476.50168919, 276.31124878]])
Plotting Input Data
<gempy.plot.vista.GemPyToVista at 0x1e6886403d0>
Setting the Interpolator
Compiling theano function...
Level of Optimization: fast_compile
Device: cpu
Precision: float64
Number of faults: 1
Compilation Done!
Kriging values:
values
range 1906.94
$C_o$ 86581.19
drift equations [3, 3]
<gempy.core.interpolator.InterpolatorModel at 0x1e687f7d370>
Plotting Cross Sections
<gempy.plot.visualization_2d.Plot2D at 0x1e6b7bacbb0>