.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/real/Perth_basin.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_Perth_basin.py: Perth basin. ============ .. GENERATED FROM PYTHON SOURCE LINES 5-15 .. code-block:: python3 import os # Importing GemPy import gempy as gp # Importing auxiliary libraries import matplotlib matplotlib.rcParams['figure.figsize'] = (20.0, 10.0) os.environ["THEANO_FLAGS"] = "mode=FAST_RUN,device=cuda" .. GENERATED FROM PYTHON SOURCE LINES 16-19 .. code-block:: python3 data_path = 'https://raw.githubusercontent.com/cgre-aachen/gempy_data/master/' geo_model = gp.create_model('Perth_Basin') .. GENERATED FROM PYTHON SOURCE LINES 20-26 .. code-block:: python3 gp.init_data(geo_model, extent=[337000, 400000, 6640000, 6710000, -18000, 1000], resolution=[100, 100, 100], path_i=data_path + "/data/input_data/Perth_basin/Paper_GU2F_sc_faults_topo_Points.csv", path_o=data_path + "/data/input_data/Perth_basin/Paper_GU2F_sc_faults_topo_Foliations.csv") .. rst-class:: sphx-glr-script-out Out: .. code-block:: none Active grids: ['regular'] Perth_Basin 2021-04-18 11:38 .. GENERATED FROM PYTHON SOURCE LINES 27-29 .. code-block:: python3 geo_model.surfaces .. raw:: html
surface series order_surfaces color id
0 Lesueur Default series 1 #015482 1
1 Permian Default series 2 #9f0052 2
2 Woodada_Kockatea Default series 3 #ffbe00 3
3 Yarragadee Default series 4 #728f02 4
4 Eneabba Default series 5 #443988 5
5 Cattamarra Default series 6 #ff3f20 6
6 Cadda Default series 7 #5DA629 7
7 Cretaceous Default series 8 #4878d0 8
8 Darling Default series 9 #ee854a 9
9 Urella_North Default series 10 #6acc64 10
10 Eneabba_South Default series 11 #d65f5f 11
11 Coomallo Default series 12 #956cb4 12
12 Hypo_fault_E Default series 13 #8c613c 13
13 Hypo_fault_W Default series 14 #dc7ec0 14
14 Urella_South Default series 15 #797979 15
15 Abrolhos_Transfer Default series 16 #d5bb67 16
16 basement Basement 1 #82c6e2 17


.. GENERATED FROM PYTHON SOURCE LINES 30-32 .. code-block:: python3 del_surfaces = ['Cadda', 'Woodada_Kockatea', 'Cattamarra'] .. GENERATED FROM PYTHON SOURCE LINES 33-35 .. code-block:: python3 geo_model.delete_surfaces(del_surfaces, remove_data=True) .. raw:: html
surface series order_surfaces color id
0 Lesueur Default series 1 #015482 1
1 Permian Default series 2 #9f0052 2
3 Yarragadee Default series 3 #728f02 3
4 Eneabba Default series 4 #443988 4
7 Cretaceous Default series 5 #4878d0 5
8 Darling Default series 6 #ee854a 6
9 Urella_North Default series 7 #6acc64 7
10 Eneabba_South Default series 8 #d65f5f 8
11 Coomallo Default series 9 #956cb4 9
12 Hypo_fault_E Default series 10 #8c613c 10
13 Hypo_fault_W Default series 11 #dc7ec0 11
14 Urella_South Default series 12 #797979 12
15 Abrolhos_Transfer Default series 13 #d5bb67 13
16 basement Basement 1 #82c6e2 14


.. GENERATED FROM PYTHON SOURCE LINES 36-37 %debug .. GENERATED FROM PYTHON SOURCE LINES 39-41 .. code-block:: python3 geo_model.stack .. raw:: html
order_series BottomRelation isActive isFault isFinite
Default series 1 Erosion True False False
Basement 2 Erosion False False False


.. GENERATED FROM PYTHON SOURCE LINES 42-58 .. code-block:: python3 gp.map_stack_to_surfaces(geo_model, {"fault_Abrolhos_Transfer": ["Abrolhos_Transfer"], "fault_Coomallo": ["Coomallo"], "fault_Eneabba_South": ["Eneabba_South"], "fault_Hypo_fault_W": ["Hypo_fault_W"], "fault_Hypo_fault_E": ["Hypo_fault_E"], "fault_Urella_North": ["Urella_North"], "fault_Urella_South": ["Urella_South"], "fault_Darling": ["Darling"], "Sedimentary_Series": ['Cretaceous', 'Yarragadee', 'Eneabba', 'Lesueur', 'Permian'] }) .. raw:: html
surface series order_surfaces color id
15 Abrolhos_Transfer fault_Abrolhos_Transfer 1 #d5bb67 1
11 Coomallo fault_Coomallo 1 #956cb4 2
10 Eneabba_South fault_Eneabba_South 1 #d65f5f 3
13 Hypo_fault_W fault_Hypo_fault_W 1 #dc7ec0 4
12 Hypo_fault_E fault_Hypo_fault_E 1 #8c613c 5
9 Urella_North fault_Urella_North 1 #6acc64 6
14 Urella_South fault_Urella_South 1 #797979 7
8 Darling fault_Darling 1 #ee854a 8
0 Lesueur Sedimentary_Series 1 #015482 9
1 Permian Sedimentary_Series 2 #9f0052 10
3 Yarragadee Sedimentary_Series 3 #728f02 11
4 Eneabba Sedimentary_Series 4 #443988 12
7 Cretaceous Sedimentary_Series 5 #4878d0 13
16 basement Basement 1 #82c6e2 14


.. GENERATED FROM PYTHON SOURCE LINES 59-61 .. code-block:: python3 geo_model.series .. raw:: html
order_series BottomRelation isActive isFault isFinite
fault_Abrolhos_Transfer 1 Erosion True False False
fault_Coomallo 2 Erosion True False False
fault_Eneabba_South 3 Erosion True False False
fault_Hypo_fault_W 4 Erosion True False False
fault_Hypo_fault_E 5 Erosion True False False
fault_Urella_North 6 Erosion True False False
fault_Urella_South 7 Erosion True False False
fault_Darling 8 Erosion True False False
Sedimentary_Series 9 Erosion True False False
Basement 10 Erosion False False False


.. GENERATED FROM PYTHON SOURCE LINES 62-74 .. code-block:: python3 order_series = ["fault_Abrolhos_Transfer", "fault_Coomallo", "fault_Eneabba_South", "fault_Hypo_fault_W", "fault_Hypo_fault_E", "fault_Urella_North", "fault_Darling", "fault_Urella_South", "Sedimentary_Series", 'Basement'] geo_model.reorder_series(order_series) .. raw:: html
order_series BottomRelation isActive isFault isFinite
fault_Abrolhos_Transfer 1 Erosion True False False
fault_Coomallo 2 Erosion True False False
fault_Eneabba_South 3 Erosion True False False
fault_Hypo_fault_W 4 Erosion True False False
fault_Hypo_fault_E 5 Erosion True False False
fault_Urella_North 6 Erosion True False False
fault_Darling 7 Erosion True False False
fault_Urella_South 8 Erosion True False False
Sedimentary_Series 9 Erosion True False False
Basement 10 Erosion False False False


.. GENERATED FROM PYTHON SOURCE LINES 75-77 Drop input data from the deleted series: .. GENERATED FROM PYTHON SOURCE LINES 79-82 .. code-block:: python3 geo_model.surface_points.df.dropna(inplace=True) geo_model.orientations.df.dropna(inplace=True) .. GENERATED FROM PYTHON SOURCE LINES 83-86 Select which series are faults ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. GENERATED FROM PYTHON SOURCE LINES 88-90 .. code-block:: python3 geo_model.faults .. raw:: html
order_series BottomRelation isActive isFault isFinite
fault_Abrolhos_Transfer 1 Erosion True False False
fault_Coomallo 2 Erosion True False False
fault_Eneabba_South 3 Erosion True False False
fault_Hypo_fault_W 4 Erosion True False False
fault_Hypo_fault_E 5 Erosion True False False
fault_Urella_North 6 Erosion True False False
fault_Darling 7 Erosion True False False
fault_Urella_South 8 Erosion True False False
Sedimentary_Series 9 Erosion True False False
Basement 10 Erosion False False False


.. GENERATED FROM PYTHON SOURCE LINES 91-100 .. code-block:: python3 geo_model.set_is_fault(["fault_Abrolhos_Transfer", "fault_Coomallo", "fault_Eneabba_South", "fault_Hypo_fault_W", "fault_Hypo_fault_E", "fault_Urella_North", "fault_Darling", "fault_Urella_South"]) .. 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_Abrolhos_Transfer 1 Fault True True False
fault_Coomallo 2 Fault True True False
fault_Eneabba_South 3 Fault True True False
fault_Hypo_fault_W 4 Fault True True False
fault_Hypo_fault_E 5 Fault True True False
fault_Urella_North 6 Fault True True False
fault_Darling 7 Fault True True False
fault_Urella_South 8 Fault True True False
Sedimentary_Series 9 Erosion True False False
Basement 10 Erosion False False False


.. GENERATED FROM PYTHON SOURCE LINES 101-104 Fault Network ------------- .. GENERATED FROM PYTHON SOURCE LINES 106-108 .. code-block:: python3 geo_model.faults.faults_relations_df .. raw:: html
fault_Abrolhos_Transfer fault_Coomallo fault_Eneabba_South fault_Hypo_fault_W fault_Hypo_fault_E fault_Urella_North fault_Darling fault_Urella_South Sedimentary_Series Basement
fault_Abrolhos_Transfer False False False False False False False False True True
fault_Coomallo False False False False False False False False True True
fault_Eneabba_South False False False False False False False False True True
fault_Hypo_fault_W False False False False False False False False True True
fault_Hypo_fault_E False False False False False False False False True True
fault_Urella_North False False False False False False False False True True
fault_Darling False False False False False False False False True True
fault_Urella_South False False False False False False False False True True
Sedimentary_Series False False False False False False False False False False
Basement False False False False False False False False False False


.. GENERATED FROM PYTHON SOURCE LINES 109-111 .. code-block:: python3 fr = geo_model.faults.faults_relations_df.values .. GENERATED FROM PYTHON SOURCE LINES 112-115 .. code-block:: python3 fr[:, :-2] = False fr .. rst-class:: sphx-glr-script-out Out: .. code-block:: none array([[False, False, False, False, False, False, False, False, True, True], [False, False, False, False, False, False, False, False, True, True], [False, False, False, False, False, False, False, False, True, True], [False, False, False, False, False, False, False, False, True, True], [False, False, False, False, False, False, False, False, True, True], [False, False, False, False, False, False, False, False, True, True], [False, False, False, False, False, False, False, False, True, True], [False, False, False, False, False, False, False, False, True, True], [False, False, False, False, False, False, False, False, False, False], [False, False, False, False, False, False, False, False, False, False]]) .. GENERATED FROM PYTHON SOURCE LINES 116-118 .. code-block:: python3 geo_model.set_fault_relation(fr) .. raw:: html
fault_Abrolhos_Transfer fault_Coomallo fault_Eneabba_South fault_Hypo_fault_W fault_Hypo_fault_E fault_Urella_North fault_Darling fault_Urella_South Sedimentary_Series Basement
fault_Abrolhos_Transfer False False False False False False False False True True
fault_Coomallo False False False False False False False False True True
fault_Eneabba_South False False False False False False False False True True
fault_Hypo_fault_W False False False False False False False False True True
fault_Hypo_fault_E False False False False False False False False True True
fault_Urella_North False False False False False False False False True True
fault_Darling False False False False False False False False True True
fault_Urella_South False False False False False False False False True True
Sedimentary_Series False False False False False False False False False False
Basement False False False False False False False False False False


.. GENERATED FROM PYTHON SOURCE LINES 119-120 %matplotlib inline .. GENERATED FROM PYTHON SOURCE LINES 120-122 .. code-block:: python3 gp.plot_2d(geo_model, direction=['z']) .. image:: /examples/real/images/sphx_glr_Perth_basin_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 123-125 .. code-block:: python3 geo_model.set_topography(source='random') .. rst-class:: sphx-glr-script-out Out: .. code-block:: none [-2800. 1000.] Active grids: ['regular' 'topography'] Grid Object. Values: array([[ 3.37315000e+05, 6.64035000e+06, -1.79050000e+04], [ 3.37315000e+05, 6.64035000e+06, -1.77150000e+04], [ 3.37315000e+05, 6.64035000e+06, -1.75250000e+04], ..., [ 4.00000000e+05, 6.70858586e+06, -1.27047172e+03], [ 4.00000000e+05, 6.70929293e+06, -1.36072471e+03], [ 4.00000000e+05, 6.71000000e+06, -1.50378496e+03]]) .. GENERATED FROM PYTHON SOURCE LINES 126-128 .. code-block:: python3 gp.plot_3d(geo_model) .. image:: /examples/real/images/sphx_glr_Perth_basin_002.png :alt: Perth basin :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out Out: .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 129-134 .. code-block:: python3 interp_data = gp.set_interpolator(geo_model, compile_theano=True, theano_optimizer='fast_run', gradient=False, dtype='float32') .. rst-class:: sphx-glr-script-out Out: .. code-block:: none Setting kriging parameters to their default values. Compiling theano function... Level of Optimization: fast_run Device: cpu Precision: float32 Number of faults: 8 Compilation Done! Kriging values: values range 96072.89 $C_o$ 219761904.76 drift equations [3, 3, 3, 3, 3, 3, 3, 3, 3, 3] .. GENERATED FROM PYTHON SOURCE LINES 135-137 .. code-block:: python3 gp.compute_model(geo_model) .. rst-class:: sphx-glr-script-out Out: .. code-block:: none Lithology ids [14. 14. 14. ... 14. 13.035703 13. ] .. GENERATED FROM PYTHON SOURCE LINES 138-140 .. code-block:: python3 gp.plot_2d(geo_model, cell_number=[25]) .. image:: /examples/real/images/sphx_glr_Perth_basin_003.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 141-143 .. code-block:: python3 gp.plot_2d(geo_model, cell_number=[25], series_n=-1, show_scalar=True) .. image:: /examples/real/images/sphx_glr_Perth_basin_004.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 144-146 .. code-block:: python3 gp.plot_2d(geo_model, cell_number=[12], direction=["y"], show_data=True, show_topography=True) .. image:: /examples/real/images/sphx_glr_Perth_basin_005.png :alt: Cell Number: 12 Direction: y :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out Out: .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 147-148 sphinx_gallery_thumbnail_number = 6 .. GENERATED FROM PYTHON SOURCE LINES 148-150 .. code-block:: python3 gp.plot_3d(geo_model, show_topography=True) .. image:: /examples/real/images/sphx_glr_Perth_basin_006.png :alt: Perth basin :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out Out: .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 151-181 Times ----- Fast run ^^^^^^^^ - 1M voxels: - CPU: intel® Core™ i7-7700HQ CPU @ 2.80GHz × 8 15 s ± 1.02 s per loop (mean ± std. dev. of 7 runs, 1 loop each) - GPU (4gb) not enough memmory - Ceres 1M voxels 2080 851 ms - 250k voxels - GPU 1050Ti: 3.11 s ± 11.8 ms per loop (mean ± std. dev. of 7 runs, 1 loop each) - CPU: intel® Core™ i7-7700HQ CPU @ 2.80GHz × 8 2.27 s ± 47.3 ms - Fast Compile ^^^^^^^^^^^^ - 250k voxels - GPU 1050Ti: 3.7 s ± 11.8 ms per loop (mean ± std. dev. of 7 runs, 1 loop each) - CPU: intel® Core™ i7-7700HQ CPU @ 2.80GHz × 8 14.2 s ± 51.1 ms per loop (mean ± std. dev. of 7 runs, 1 loop each) .. GENERATED FROM PYTHON SOURCE LINES 183-185 %%timeit gp.compute_model(geo_model) .. GENERATED FROM PYTHON SOURCE LINES 187-190 ver = np.load('ver.npy') sim = np.load('sim.npy') lith_block = np.load('lith.npy') .. GENERATED FROM PYTHON SOURCE LINES 190-191 .. 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:** ( 1 minutes 0.762 seconds) .. _sphx_glr_download_examples_real_Perth_basin.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: Perth_basin.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: Perth_basin.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_