.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/real/Greenstone.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_real_Greenstone.py: Greenstone. =========== .. GENERATED FROM PYTHON SOURCE LINES 5-16 .. code-block:: python3 # Importing gempy import gempy as gp # Aux imports import numpy as np import matplotlib.pyplot as plt import os print(gp.__version__) .. rst-class:: sphx-glr-script-out Out: .. code-block:: none 2.2.8 .. GENERATED FROM PYTHON SOURCE LINES 17-19 .. code-block:: python3 geo_model = gp.create_model('Greenstone') .. GENERATED FROM PYTHON SOURCE LINES 20-28 .. code-block:: python3 data_path = 'https://raw.githubusercontent.com/cgre-aachen/gempy_data/master/' # Importing the data from csv files and settign extent and resolution geo_model = gp.init_data(geo_model, [696000, 747000, 6863000, 6930000, -20000, 200], [50, 50, 50], path_o=data_path + "/data/input_data/tut_SandStone/SandStone_Foliations.csv", path_i=data_path + "/data/input_data/tut_SandStone/SandStone_Points.csv") .. rst-class:: sphx-glr-script-out Out: .. code-block:: none Active grids: ['regular'] .. GENERATED FROM PYTHON SOURCE LINES 29-31 .. code-block:: python3 gp.plot_2d(geo_model, direction=['z']) .. image:: /examples/real/images/sphx_glr_Greenstone_001.png :alt: Cell Number: mid Direction: z :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out Out: .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 32-36 .. code-block:: python3 gp.map_stack_to_surfaces(geo_model, {"EarlyGranite_Series": 'EarlyGranite', "BIF_Series": ('SimpleMafic2', 'SimpleBIF'), "SimpleMafic_Series": 'SimpleMafic1', 'Basement': 'basement'}) .. raw:: html
surface series order_surfaces color id
3 EarlyGranite EarlyGranite_Series 1 #728f02 1
0 SimpleMafic2 BIF_Series 1 #015482 2
1 SimpleBIF BIF_Series 2 #9f0052 3
2 SimpleMafic1 SimpleMafic_Series 1 #ffbe00 4
4 basement Basement 1 #443988 5


.. GENERATED FROM PYTHON SOURCE LINES 37-39 .. code-block:: python3 geo_model.add_surface_values([2.61, 2.92, 3.1, 2.92, 2.61]) .. raw:: html
surface series order_surfaces color id value_0
3 EarlyGranite EarlyGranite_Series 1 #728f02 1 2.61
0 SimpleMafic2 BIF_Series 1 #015482 2 2.92
1 SimpleBIF BIF_Series 2 #9f0052 3 3.10
2 SimpleMafic1 SimpleMafic_Series 1 #ffbe00 4 2.92
4 basement Basement 1 #443988 5 2.61


.. GENERATED FROM PYTHON SOURCE LINES 40-45 .. code-block:: python3 gp.set_interpolator(geo_model, compile_theano=True, theano_optimizer='fast_compile', verbose=[]) .. 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: 0 Compilation Done! Kriging values: values range 86591.22 $C_o$ 178524761.9 drift equations [3, 3, 3, 3] .. GENERATED FROM PYTHON SOURCE LINES 46-48 .. code-block:: python3 gp.compute_model(geo_model, set_solutions=True) .. rst-class:: sphx-glr-script-out Out: .. code-block:: none Lithology ids [5. 5. 5. ... 5. 5. 5.] .. GENERATED FROM PYTHON SOURCE LINES 49-51 .. code-block:: python3 gp.plot_2d(geo_model, cell_number=[-1], direction=['z'], show_data=False) .. image:: /examples/real/images/sphx_glr_Greenstone_002.png :alt: Cell Number: -1 Direction: z :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out Out: .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 52-54 .. code-block:: python3 gp.plot_2d(geo_model, cell_number=[25], direction='x') .. image:: /examples/real/images/sphx_glr_Greenstone_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 55-57 .. code-block:: python3 geo_model.solutions.values_matrix .. rst-class:: sphx-glr-script-out Out: .. code-block:: none array([[2.61, 2.61, 2.61, ..., 2.61, 2.61, 2.61]]) .. GENERATED FROM PYTHON SOURCE LINES 58-62 .. code-block:: python3 p2d = gp.plot_2d(geo_model, cell_number=[25], block=geo_model.solutions.values_matrix, direction=['y'], show_data=True, kwargs_regular_grid={'cmap': 'viridis', 'norm':None}) .. image:: /examples/real/images/sphx_glr_Greenstone_004.png :alt: Cell Number: 25 Direction: y :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 63-64 sphinx_gallery_thumbnail_number = 5 .. GENERATED FROM PYTHON SOURCE LINES 64-66 .. code-block:: python3 gp.plot_3d(geo_model) .. image:: /examples/real/images/sphx_glr_Greenstone_005.png :alt: Greenstone :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out Out: .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 67-70 .. code-block:: python3 np.save('greenstone_ver', geo_model.solutions.vertices) np.save('greenstone_edges', geo_model.solutions.edges) .. GENERATED FROM PYTHON SOURCE LINES 71-74 Saving the model ~~~~~~~~~~~~~~~~ .. GENERATED FROM PYTHON SOURCE LINES 76-77 gp.save_model(geo_model, path=os.pardir + '/data/gempy_models') .. GENERATED FROM PYTHON SOURCE LINES 77-77 .. code-block:: python3 gp.save_model(geo_model) .. rst-class:: sphx-glr-script-out Out: .. code-block:: none True .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 10.406 seconds) .. _sphx_glr_download_examples_real_Greenstone.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: Greenstone.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: Greenstone.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_