.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/geometries/5_fault.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_examples_geometries_5_fault.py: Model 5 - Fault =============== .. GENERATED FROM PYTHON SOURCE LINES 8-11 A simple fault model with constant offset. We start by importing the necessary dependencies: .. GENERATED FROM PYTHON SOURCE LINES 13-14 Importing GemPy .. GENERATED FROM PYTHON SOURCE LINES 14-19 .. code-block:: python3 import gempy as gp import pandas as pd pd.set_option('precision', 2) .. GENERATED FROM PYTHON SOURCE LINES 20-22 Creating the model by importing the input data and displaying it: .. GENERATED FROM PYTHON SOURCE LINES 24-31 .. code-block:: python3 data_path = 'https://raw.githubusercontent.com/cgre-aachen/gempy_data/master/' path_to_data = data_path + "/data/input_data/jan_models/" geo_data = gp.create_data('fault', extent=[0, 1000, 0, 1000, 0, 1000], resolution=[50, 50, 50], path_o=path_to_data + "model5_orientations.csv", path_i=path_to_data + "model5_surface_points.csv") .. rst-class:: sphx-glr-script-out Out: .. code-block:: none Active grids: ['regular'] .. GENERATED FROM PYTHON SOURCE LINES 32-34 .. code-block:: python3 geo_data.get_data() .. raw:: html
X Y Z smooth surface G_x G_y G_z
surface_points 0 0 200 600 2.00e-06 rock1 NaN NaN NaN
1 0 800 600 2.00e-06 rock1 NaN NaN NaN
2 200 200 600 2.00e-06 rock1 NaN NaN NaN
3 200 800 600 2.00e-06 rock1 NaN NaN NaN
4 800 200 200 2.00e-06 rock1 NaN NaN NaN
5 800 800 200 2.00e-06 rock1 NaN NaN NaN
6 1000 200 200 2.00e-06 rock1 NaN NaN NaN
7 1000 800 200 2.00e-06 rock1 NaN NaN NaN
8 0 200 800 2.00e-06 rock2 NaN NaN NaN
9 0 800 800 2.00e-06 rock2 NaN NaN NaN
10 200 200 800 2.00e-06 rock2 NaN NaN NaN
11 200 800 800 2.00e-06 rock2 NaN NaN NaN
12 800 200 400 2.00e-06 rock2 NaN NaN NaN
13 800 800 400 2.00e-06 rock2 NaN NaN NaN
14 1000 200 400 2.00e-06 rock2 NaN NaN NaN
15 1000 800 400 2.00e-06 rock2 NaN NaN NaN
16 500 500 500 2.00e-06 fault NaN NaN NaN
17 450 500 600 2.00e-06 fault NaN NaN NaN
18 500 200 500 2.00e-06 fault NaN NaN NaN
19 450 200 600 2.00e-06 fault NaN NaN NaN
20 500 800 500 2.00e-06 fault NaN NaN NaN
21 450 800 600 2.00e-06 fault NaN NaN NaN
orientations 1 100 500 600 1.00e-02 rock1 1.00e-12 1.00e-12 1.0
3 900 500 200 1.00e-02 rock1 1.00e-12 1.00e-12 1.0
0 100 500 800 1.00e-02 rock2 1.00e-12 1.00e-12 1.0
2 900 500 400 1.00e-02 rock2 1.00e-12 1.00e-12 1.0
4 500 500 500 1.00e-02 fault 8.66e-01 1.00e-12 0.5


.. GENERATED FROM PYTHON SOURCE LINES 35-37 Setting and ordering the units and series: .. GENERATED FROM PYTHON SOURCE LINES 39-43 .. code-block:: python3 gp.map_stack_to_surfaces(geo_data, {"Fault_Series": 'fault', "Strat_Series": ('rock2', 'rock1')}) geo_data.set_is_fault(['Fault_Series']) .. rst-class:: sphx-glr-script-out Out: .. code-block:: none Fault colors changed. If you do not like this behavior, set change_color to False. .. raw:: html
order_series BottomRelation isActive isFault isFinite
Fault_Series 1 Fault True True False
Strat_Series 2 Erosion True False False
Basement 3 Erosion False False False


.. GENERATED FROM PYTHON SOURCE LINES 44-46 .. code-block:: python3 gp.plot_2d(geo_data, direction='y') .. image:: /examples/geometries/images/sphx_glr_5_fault_001.png :alt: Cell Number: mid Direction: y :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out Out: .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 47-49 Calculating the model: .. GENERATED FROM PYTHON SOURCE LINES 51-53 .. code-block:: python3 interp_data = gp.set_interpolator(geo_data, theano_optimizer='fast_compile') .. rst-class:: sphx-glr-script-out Out: .. code-block:: none Setting kriging parameters to their default values. Compiling theano function... Level of Optimization: fast_compile Device: cpu Precision: float64 Number of faults: 1 Compilation Done! Kriging values: values range 1732.05 $C_o$ 71428.57 drift equations [3, 3, 3] .. GENERATED FROM PYTHON SOURCE LINES 54-56 .. code-block:: python3 sol = gp.compute_model(geo_data) .. GENERATED FROM PYTHON SOURCE LINES 57-59 Displaying the result in x and y direction: .. GENERATED FROM PYTHON SOURCE LINES 61-62 sphinx_gallery_thumbnail_number = 2 .. GENERATED FROM PYTHON SOURCE LINES 62-65 .. code-block:: python3 gp.plot_2d(geo_data, cell_number=25, direction='y', show_data=False, show_all_data=True) .. image:: /examples/geometries/images/sphx_glr_5_fault_002.png :alt: Cell Number: 25 Direction: y :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out Out: .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 66-69 .. code-block:: python3 gp.plot_2d(geo_data, cell_number=25, direction='x', show_data=True) .. image:: /examples/geometries/images/sphx_glr_5_fault_003.png :alt: Cell Number: 25 Direction: x :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out Out: .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 70-75 .. code-block:: python3 gp.plot_2d(geo_data, cell_number=25, direction='y', show_data=True, show_scalar=True, series_n=1) gp.save_model(geo_data) .. image:: /examples/geometries/images/sphx_glr_5_fault_004.png :alt: Cell Number: 25 Direction: y :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out Out: .. code-block:: none True .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 5.479 seconds) .. _sphx_glr_download_examples_geometries_5_fault.py: .. only :: html .. container:: sphx-glr-footer :class: sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: 5_fault.py <5_fault.py>` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: 5_fault.ipynb <5_fault.ipynb>` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_