.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/geometries/d04_pinchout.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_examples_geometries_d04_pinchout.py: Model 4 - Pinchout ==================== Modeling of a pinchout: combining scalar fields This script demonstrates how to create a geological model with a layer of varying thickness (pinchout) using GemPy, a Python-based, open-source library for implicit geological modeling. .. GENERATED FROM PYTHON SOURCE LINES 10-17 .. code-block:: Python # Import necessary libraries import gempy as gp import gempy_viewer as gpv # sphinx_gallery_thumbnail_number = 3 .. GENERATED FROM PYTHON SOURCE LINES 18-21 Generate the model ------------------- Define the path to the input data .. GENERATED FROM PYTHON SOURCE LINES 21-45 .. code-block:: Python data_path = 'https://raw.githubusercontent.com/cgre-aachen/gempy_data/master/' path_to_data = data_path + "/data/input_data/jan_models/" # Create a GeoModel instance geo_model = gp.create_geomodel( project_name='pinchout', extent=[0, 1000, 0, 1000, 0, 1000], resolution=[50, 50, 50], refinement=6, importer_helper=gp.data.ImporterHelper( path_to_orientations=path_to_data + "model4_orientations.csv", path_to_surface_points=path_to_data + "model4_surface_points.csv" ) ) # Map geological series to surfaces gp.map_stack_to_surfaces( gempy_model=geo_model, mapping_object={"Strat_Series": ('rock2', 'rock1')} ) # Compute the geological model gp.compute_model(geo_model) .. rst-class:: sphx-glr-script-out .. code-block:: none Surface points hash: 76e41015e8bc57232f56f90ff5f9fc56d0f5d55b67a5030f9bc5c95edfed0674 Orientations hash: 575806bb62944f0604e8fecccdc9d53bfabd758bee293b1ad8f3575f173429f1 Setting Backend To: AvailableBackends.PYTORCH GPU requested but unavailable; falling back to CPU (GEMPY_GPU_FALLBACK=True) Setting Backend To: AvailableBackends.PYTORCH Chunking done: 8 chunks .. raw:: html
Solutions: 6 Octree Levels, 2 DualContouringMeshes


.. GENERATED FROM PYTHON SOURCE LINES 46-49 2D visualization ----------------- Plot the initial input data in the y direction, without computed results .. GENERATED FROM PYTHON SOURCE LINES 49-51 .. code-block:: Python gpv.plot_2d(geo_model, direction=['y'], show_results=False) .. image-sg:: /examples/geometries/images/sphx_glr_d04_pinchout_001.png :alt: Cell Number: mid Direction: y :srcset: /examples/geometries/images/sphx_glr_d04_pinchout_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 52-53 Plot the computed result in the x and y directions, with data .. GENERATED FROM PYTHON SOURCE LINES 53-56 .. code-block:: Python gpv.plot_2d(geo_model, direction=['x'], show_data=True) gpv.plot_2d(geo_model, direction=['y'], show_data=True) .. rst-class:: sphx-glr-horizontal * .. image-sg:: /examples/geometries/images/sphx_glr_d04_pinchout_002.png :alt: Cell Number: mid Direction: x :srcset: /examples/geometries/images/sphx_glr_d04_pinchout_002.png :class: sphx-glr-multi-img * .. image-sg:: /examples/geometries/images/sphx_glr_d04_pinchout_003.png :alt: Cell Number: mid Direction: y :srcset: /examples/geometries/images/sphx_glr_d04_pinchout_003.png :class: sphx-glr-multi-img .. rst-class:: sphx-glr-script-out .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 57-60 3D visualization ----------------- Display the computed model in 3D .. GENERATED FROM PYTHON SOURCE LINES 60-61 .. code-block:: Python gpv.plot_3d(geo_model, show_lith=True, show_boundaries=True, ve=None) .. image-sg:: /examples/geometries/images/sphx_glr_d04_pinchout_004.png :alt: d04 pinchout :srcset: /examples/geometries/images/sphx_glr_d04_pinchout_004.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 2.079 seconds) .. _sphx_glr_download_examples_geometries_d04_pinchout.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: d04_pinchout.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: d04_pinchout.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: d04_pinchout.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_