Alesmodel: Plotting sections and maps.

import gempy as gp
import numpy as np
import matplotlib.pyplot as plt
import os
cwd = os.getcwd()
if 'examples' not in cwd:
    data_path = os.getcwd() + '/examples'
else:
    data_path = cwd + '/../..'

path_interf = data_path + "/data/input_data/AlesModel/2018_interf.csv"
path_orient = data_path + "/data/input_data/AlesModel/2018_orient_clust_n_init5_0.csv"
path_dem = data_path + "/data/input_data/AlesModel/_cropped_DEM_coarse.tif"
resolution = [100, 100, 100]
extent = np.array([729550.0, 751500.0, 1913500.0, 1923650.0, -1800.0, 800.0])
geo_model = gp.create_model('Alesmodel')
gp.init_data(geo_model, extent=extent, resolution=resolution,
             path_i=path_interf,
             path_o=path_orient)

Out:

Active grids: ['regular']

Alesmodel  2021-04-18 11:31
sdict = {'section1': ([732000, 1916000], [745000, 1916000], [200, 150])}
geo_model.set_section_grid(sdict)

Out:

Active grids: ['regular' 'sections']
start stop resolution dist
section1 [732000, 1916000] [745000, 1916000] [200, 150] 13000.0


sorting of lithologies

gp.map_stack_to_surfaces(geo_model, {'fault_left': ('fault_left'),
                                     'fault_right': ('fault_right'),
                                     'fault_lr': ('fault_lr'),
                                     'Trias_Series': ('TRIAS', 'LIAS'),
                                     'Carbon_Series': ('CARBO'),
                                     'Basement_Series': ('basement')}, remove_unused_series=True)
surface series order_surfaces color id
0 fault_left fault_left 1 #015482 1
2 fault_right fault_right 1 #ffbe00 2
1 fault_lr fault_lr 1 #9f0052 3
3 TRIAS Trias_Series 1 #728f02 4
4 LIAS Trias_Series 2 #443988 5
5 CARBO Carbon_Series 1 #ff3f20 6
6 basement Basement_Series 1 #5DA629 7


colordict = {'LIAS': '#015482', 'TRIAS': '#9f0052', 'CARBO': '#ffbe00', 'basement': '#728f02',
             'fault_left': '#2a2a2a', 'fault_right': '#545454', 'fault_lr': '#a5a391'}
geo_model.surfaces.colors.change_colors(colordict)
a = gp.plot_2d(geo_model, direction='y')
Cell Number: mid Direction: y
values
rescaling factor 26804.17
centers [739263.6925, 1917834.9612500002, 402.6439239999999]


gp.plot.plot_section_traces(geo_model)
Cell Number: -1 Direction: z

Out:

<gempy.plot.visualization_2d.Plot2D object at 0x7fcb8c099610>

Faults

geo_model.set_is_fault(['fault_right', 'fault_left', 'fault_lr'], change_color=True)

Out:

Fault colors changed. If you do not like this behavior, set change_color to False.
order_series BottomRelation isActive isFault isFinite
fault_left 1 Fault True True False
fault_right 2 Fault True True False
fault_lr 3 Fault True True False
Trias_Series 4 Erosion True False False
Carbon_Series 5 Erosion True False False
Basement_Series 6 Erosion False False False


gp.set_interpolator(geo_model,
                    output=['geology'], compile_theano=True,
                    theano_optimizer='fast_run', dtype='float64',
                    verbose=[])

Out:

Setting kriging parameters to their default values.
Compiling theano function...
Level of Optimization:  fast_run
Device:  cpu
Precision:  float64
Number of faults:  3
Compilation Done!
Kriging values:
                              values
range                      24322.52
$C_o$                   14085357.14
drift equations  [3, 3, 3, 3, 3, 3]

<gempy.core.interpolator.InterpolatorModel object at 0x7fccb8a38160>

Topography

geo_model.set_topography(source='gdal', filepath=path_dem)

Out:

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' 'sections']

Grid Object. Values:
array([[ 7.29659750e+05,  1.91355075e+06, -1.78700000e+03],
       [ 7.29659750e+05,  1.91355075e+06, -1.76100000e+03],
       [ 7.29659750e+05,  1.91355075e+06, -1.73500000e+03],
       ...,
       [ 7.45000000e+05,  1.91600000e+06,  7.65100671e+02],
       [ 7.45000000e+05,  1.91600000e+06,  7.82550336e+02],
       [ 7.45000000e+05,  1.91600000e+06,  8.00000000e+02]])
surface series order_surfaces color id
0 fault_left fault_left 1 #527682 1
2 fault_right fault_right 1 #527682 2
1 fault_lr fault_lr 1 #527682 3
3 TRIAS Trias_Series 1 #9f0052 4
4 LIAS Trias_Series 2 #015482 5
5 CARBO Carbon_Series 1 #ffbe00 6
6 basement Basement_Series 1 #728f02 7


_ = gp.compute_model(geo_model, compute_mesh=True, compute_mesh_options={'rescale': False})
gp.plot_2d(geo_model, cell_number=[4], direction=['y'], show_topography=True,
           show_data=True)
Cell Number: 4 Direction: y

Out:

<gempy.plot.visualization_2d.Plot2D object at 0x7fcc6bb90a60>
gp.plot_2d(geo_model, section_names=['topography'], show_data=False,
           show_boundaries=False)
Geological map

Out:

<gempy.plot.visualization_2d.Plot2D object at 0x7fcc2a5945e0>

sphinx_gallery_thumbnail_number = 5

Alesmodel

Out:

<gempy.plot.vista.GemPyToVista object at 0x7fcb8ad989d0>

np.save(‘Ales_vert3’, geo_model.solutions.vertices) np.save(‘Ales_edges3’, geo_model.solutions.edges)

gp.plot.plot_ar(geo_model)

gp.save_model(geo_model)

Out:

True

Total running time of the script: ( 2 minutes 3.841 seconds)

Gallery generated by Sphinx-Gallery