Alesmodel: Plotting sections and maps.

# %% # .. admonition:: Explanation # # This model is quite unstable in general and requires float64 to find a solution. The lack of data on # one of the corners for the TRIAS and LIAS series makes that the model bends in an unrealistic # way and erodes CARBO that disappears on that section. The easy way to solve this is to add more data in that area but # I leave as it is since I did no constructed the model. #

import gempy as gp
import gempy_viewer as gpv
import os
import numpy as np
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"
geo_model: gp.data.GeoModel = gp.create_geomodel(
    project_name='Claudius',
    extent=[729550.0, 751500.0, 1913500.0, 1923650.0, -1800.0, 800.0],
    resolution=[100, 100, 100],
    refinement=6,
    importer_helper=gp.data.ImporterHelper(
        path_to_orientations=path_orient,
        path_to_surface_points=path_interf,
    )
)
gp.set_section_grid(
    grid=geo_model.grid,
    section_dict={
        'section1': ([732000, 1916000], [745000, 1916000], [200, 150])
    }
)
Active grids: ['sections']
start stop resolution dist
section1 [732000, 1916000] [745000, 1916000] [200, 150] 13000.0


sorting of lithologies

gp.map_stack_to_surfaces(
    gempy_model=geo_model,
    mapping_object={
        '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
)
Could not find element 'basement' in any group.
Structural Groups: StructuralGroup:
Name:fault_left
Structural Relation:StackRelationType.ERODE
Elements:
StructuralElement:
Name:fault_left

StructuralGroup:
Name:fault_right
Structural Relation:StackRelationType.ERODE
Elements:
StructuralElement:
Name:fault_right

StructuralGroup:
Name:fault_lr
Structural Relation:StackRelationType.ERODE
Elements:
StructuralElement:
Name:fault_lr

StructuralGroup:
Name:Trias_Series
Structural Relation:StackRelationType.ERODE
Elements:
StructuralElement:
Name:TRIAS

StructuralElement:
Name:LIAS

StructuralGroup:
Name:Carbon_Series
Structural Relation:StackRelationType.ERODE
Elements:
StructuralElement:
Name:CARBO
Fault Relations:
fault_leftfault_righ...fault_lrTrias_Seri...Carbon_Ser...
fault_left
fault_right
fault_lr
Trias_Series
Carbon_Series
True
False


Change colors

geo_model.structural_frame.get_element_by_name("LIAS").color = "#015482"
geo_model.structural_frame.get_element_by_name("TRIAS").color = "#9f0052"
geo_model.structural_frame.get_element_by_name("CARBO").color = "#ffbe00"
a = gpv.plot_2d(geo_model, direction='y')
Cell Number: mid Direction: y
gpv.plot_section_traces(geo_model)
Cell Number: -1 Direction: z
<function plot_section_traces at 0x7fe0d9167010>

Faults

gp.set_is_fault(
    frame=geo_model.structural_frame,
    fault_groups=[
        geo_model.structural_frame.get_group_by_name('fault_left'),
        geo_model.structural_frame.get_group_by_name('fault_right'),
        geo_model.structural_frame.get_group_by_name('fault_lr')
    ],
    change_color=True
)
Structural Groups: StructuralGroup:
Name:fault_left
Structural Relation:StackRelationType.FAULT
Elements:
StructuralElement:
Name:fault_left

StructuralGroup:
Name:fault_right
Structural Relation:StackRelationType.FAULT
Elements:
StructuralElement:
Name:fault_right

StructuralGroup:
Name:fault_lr
Structural Relation:StackRelationType.FAULT
Elements:
StructuralElement:
Name:fault_lr

StructuralGroup:
Name:Trias_Series
Structural Relation:StackRelationType.ERODE
Elements:
StructuralElement:
Name:TRIAS

StructuralElement:
Name:LIAS

StructuralGroup:
Name:Carbon_Series
Structural Relation:StackRelationType.ERODE
Elements:
StructuralElement:
Name:CARBO
Fault Relations:
fault_leftfault_righ...fault_lrTrias_Seri...Carbon_Ser...
fault_left
fault_right
fault_lr
Trias_Series
Carbon_Series
True
False


Topography

gp.set_topography_from_file(
    grid=geo_model.grid,
    filepath=path_dem,
    crop_to_extent=[729550.0, 751500.0, 1_913_500.0, 1923650.0]
)


gpv.plot_3d(geo_model, show_topography=True, ve=1, image=True)
AlesmodelAlesmodel
/home/leguark/subsurface/subsurface/reader/__init__.py:14: UserWarning: Welly or Striplog not installed. No well reader possible.
  warnings.warn("Welly or Striplog not installed. No well reader possible.")
Active grids: ['topography' 'sections']

<gempy_viewer.modules.plot_3d.vista.GemPyToVista object at 0x7fe0c89c2a40>
carbo = geo_model.structural_frame.get_group_by_name("Carbon_Series")
geo_model.interpolation_options.number_octree_levels_surface = 4
geo_model.interpolation_options.kernel_options.range = .8
gp.modify_surface_points(
    geo_model=geo_model,
    elements_names=["CARBO", "LIAS", "TRIAS"],
    nugget=0.01
)
Structural Groups: StructuralGroup:
Name:fault_left
Structural Relation:StackRelationType.FAULT
Elements:
StructuralElement:
Name:fault_left

StructuralGroup:
Name:fault_right
Structural Relation:StackRelationType.FAULT
Elements:
StructuralElement:
Name:fault_right

StructuralGroup:
Name:fault_lr
Structural Relation:StackRelationType.FAULT
Elements:
StructuralElement:
Name:fault_lr

StructuralGroup:
Name:Trias_Series
Structural Relation:StackRelationType.ERODE
Elements:
StructuralElement:
Name:TRIAS

StructuralElement:
Name:LIAS

StructuralGroup:
Name:Carbon_Series
Structural Relation:StackRelationType.ERODE
Elements:
StructuralElement:
Name:CARBO
Fault Relations:
fault_leftfault_righ...fault_lrTrias_Seri...Carbon_Ser...
fault_left
fault_right
fault_lr
Trias_Series
Carbon_Series
True
False


StructuralFrame(
        structural_groups=[
StructuralGroup(
        name=fault_left,
        structural_relation=StackRelationType.FAULT,
        elements=[
Element(
        name=fault_left,
        color=#527682,
        is_active=True
)
]
),
StructuralGroup(
        name=fault_right,
        structural_relation=StackRelationType.FAULT,
        elements=[
Element(
        name=fault_right,
        color=#527682,
        is_active=True
)
]
),
StructuralGroup(
        name=fault_lr,
        structural_relation=StackRelationType.FAULT,
        elements=[
Element(
        name=fault_lr,
        color=#527682,
        is_active=True
)
]
),
StructuralGroup(
        name=Trias_Series,
        structural_relation=StackRelationType.ERODE,
        elements=[
Element(
        name=TRIAS,
        color=#9f0052,
        is_active=True
),
Element(
        name=LIAS,
        color=#015482,
        is_active=True
)
]
),
StructuralGroup(
        name=Carbon_Series,
        structural_relation=StackRelationType.ERODE,
        elements=[
Element(
        name=CARBO,
        color=#ffbe00,
        is_active=True
)
]
)
],
        fault_relations=
[[False, False, False,  True,  True],
 [False, False, False,  True,  True],
 [False, False, False,  True,  True],
 [False, False, False, False, False],
 [False, False, False, False, False]],
Structural Groups: StructuralGroup:
Name:fault_left
Structural Relation:StackRelationType.FAULT
Elements:
StructuralElement:
Name:fault_left

StructuralGroup:
Name:fault_right
Structural Relation:StackRelationType.FAULT
Elements:
StructuralElement:
Name:fault_right

StructuralGroup:
Name:fault_lr
Structural Relation:StackRelationType.FAULT
Elements:
StructuralElement:
Name:fault_lr

StructuralGroup:
Name:Trias_Series
Structural Relation:StackRelationType.ERODE
Elements:
StructuralElement:
Name:TRIAS

StructuralElement:
Name:LIAS

StructuralGroup:
Name:Carbon_Series
Structural Relation:StackRelationType.ERODE
Elements:
StructuralElement:
Name:CARBO
Fault Relations:
fault_leftfault_righ...fault_lrTrias_Seri...Carbon_Ser...
fault_left
fault_right
fault_lr
Trias_Series
Carbon_Series
True
False


_ = gp.compute_model(
    geo_model,
    engine_config=gp.data.GemPyEngineConfig(
        use_gpu=True,
        dtype="float64"
    ))


gpv.plot_2d(geo_model, show_topography=False, section_names=['topography'], show_lith=True)
Geological map
Setting Backend To: AvailableBackends.numpy
/home/leguark/gempy/gempy/core/data/geo_model.py:164: UserWarning: You are using refinement and passing a regular grid. The resolution of the regular grid will be overwritten
  warnings.warn(
/home/leguark/gempy_viewer/gempy_viewer/API/_plot_2d_sections_api.py:106: UserWarning: Section contacts not implemented yet. We need to pass scalar field for the sections grid
  warnings.warn(

<gempy_viewer.modules.plot_2d.visualization_2d.Plot2D object at 0x7fe0c8643b50>
gpv.plot_2d(geo_model, cell_number=[4], direction=['y'], show_topography=True, show_data=True)
gpv.plot_2d(geo_model, cell_number=[-4], direction=['y'], show_topography=True, show_data=True)
  • Cell Number: 4 Direction: y
  • Cell Number: -4 Direction: y
<gempy_viewer.modules.plot_2d.visualization_2d.Plot2D object at 0x7fe0845c8e80>

sphinx_gallery_thumbnail_number = -1

gpv.plot_3d(geo_model, show_lith=True, show_topography=True, kwargs_plot_structured_grid={'opacity': 0.8})
Alesmodel
<gempy_viewer.modules.plot_3d.vista.GemPyToVista object at 0x7fe0d9c2a5c0>

Total running time of the script: (1 minutes 40.412 seconds)

Gallery generated by Sphinx-Gallery