1.7: 3-D Visualization

Importing GemPy

import gempy as gp

# Importing auxiliary libraries
import numpy as np
import matplotlib.pyplot as plt

Loading an example geomodel

data_path = 'https://raw.githubusercontent.com/cgre-aachen/gempy_data/master/'

geo_model = gp.create_data('viz_3d',
                           [0, 2000, 0, 2000, 0, 1600],
                           [50, 50, 50],
                           path_o=data_path + "data/input_data/lisa_models/foliations" + str(
                               7) + ".csv",
                           path_i=data_path + "data/input_data/lisa_models/interfaces" + str(
                               7) + ".csv"
                           )

gp.map_stack_to_surfaces(
    geo_model,
    {"Fault_1": 'Fault_1', "Fault_2": 'Fault_2',
     "Strat_Series": ('Sandstone', 'Siltstone', 'Shale', 'Sandstone_2', 'Schist', 'Gneiss')}
)

geo_model.set_is_fault(['Fault_1', 'Fault_2'])
geo_model.set_topography()

gp.set_interpolator(geo_model)
gp.compute_model(geo_model, compute_mesh=True)

Out:

Active grids: ['regular']
/home/travis/build/cgre-aachen/gempy/gempy/core/data_modules/geometric_data.py:537: UserWarning: If pole_vector and orientation are passed pole_vector is used/
  warnings.warn('If pole_vector and orientation are passed pole_vector is used/')
Fault colors changed. If you do not like this behavior, set change_color to False.
[1280. 1600.]
Active grids: ['regular' 'topography']
Setting kriging parameters to their default values.
Compiling theano function...
Level of Optimization:  fast_compile
Device:  cpu
Precision:  float64
Number of faults:  2
Compilation Done!
Kriging values:
                        values
range                 3.2e+03
$C_o$                 2.5e+05
drift equations  [3, 3, 3, 3]
/home/travis/build/cgre-aachen/gempy/gempy/core/solution.py:128: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray
  self.geological_map = np.array([values[0][:, l0: l1], values[4][:, l0: l1].astype(float)])


Lithology ids
  [9. 9. 9. ... 3. 3. 3.]

Basic plotting API

Data plot

gp.plot_3d(geo_model, show_surfaces=False, show_data=True, show_lith=False, image=False)
ch1 7 3d visualization

Out:

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

Geomodel plot

gp.plot_3d(geo_model, image=False)
ch1 7 3d visualization

Out:

<gempy.plot.vista.GemPyToVista object at 0x7ff9cac93910>
# sphinx_gallery_thumbnail_number = 2
gpv = gp.plot.plot_3d(geo_model,
                      plotter_type='basic', off_screen=False,
                      show_topography=True,
                      show_scalar=False,
                      show_lith=True,
                      kwargs_plot_structured_grid={'opacity': .5})

gp.save_model(geo_model)
ch1 7 3d visualization

Out:

True

Total running time of the script: ( 0 minutes 18.355 seconds)

Gallery generated by Sphinx-Gallery