#import required packages
import gempy as gp
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import os
WARNING (theano.tensor.blas): Using NumPy C-API based implementation for BLAS functions.
#create gempy model
geo_model = gp.create_model('Model1')
/opt/conda/lib/python3.7/site-packages/theano/gpuarray/dnn.py:184: UserWarning: Your cuDNN version is more recent than Theano. If you encounter problems, try updating Theano or downgrading cuDNN to a version >= v5 and <= v7.
warnings.warn("Your cuDNN version is more recent than "
#create grid
gp.init_data(geo_model, [0, 2000., 0, 2000., 0, 750.],[50, 50, 50],
path_o = 'simple_fault_model_orientations.csv',
path_i = 'simple_fault_model_points.csv',
default_values = True)
Active grids: ['regular']
Model1 2020-10-02 18:58
#get unsorted surfaces
geo_model.surfaces
#T_42c1e1c4_04e1_11eb_b26f_f176fcf55738row0_col3 {
background-color: #015482;
} #T_42c1e1c4_04e1_11eb_b26f_f176fcf55738row1_col3 {
background-color: #9f0052;
} #T_42c1e1c4_04e1_11eb_b26f_f176fcf55738row2_col3 {
background-color: #ffbe00;
} #T_42c1e1c4_04e1_11eb_b26f_f176fcf55738row3_col3 {
background-color: #728f02;
} #T_42c1e1c4_04e1_11eb_b26f_f176fcf55738row4_col3 {
background-color: #443988;
} #T_42c1e1c4_04e1_11eb_b26f_f176fcf55738row5_col3 {
background-color: #ff3f20;
}</style><table data-preserve-html-node="true" id="T_42c1e1c4_04e1_11eb_b26f_f176fcf55738" ><thead data-preserve-html-node="true"> <tr data-preserve-html-node="true"> <th data-preserve-html-node="true" class="blank level0" ></th> <th data-preserve-html-node="true" class="col_heading level0 col0" >surface</th> <th data-preserve-html-node="true" class="col_heading level0 col1" >series</th> <th data-preserve-html-node="true" class="col_heading level0 col2" >order_surfaces</th> <th data-preserve-html-node="true" class="col_heading level0 col3" >color</th> <th data-preserve-html-node="true" class="col_heading level0 col4" >id</th> </tr></thead><tbody data-preserve-html-node="true">
<tr data-preserve-html-node="true">
<th data-preserve-html-node="true" id="T_42c1e1c4_04e1_11eb_b26f_f176fcf55738level0_row0" class="row_heading level0 row0" >0</th>
<td data-preserve-html-node="true" id="T_42c1e1c4_04e1_11eb_b26f_f176fcf55738row0_col0" class="data row0 col0" >Shale</td>
<td data-preserve-html-node="true" id="T_42c1e1c4_04e1_11eb_b26f_f176fcf55738row0_col1" class="data row0 col1" >Default series</td>
<td data-preserve-html-node="true" id="T_42c1e1c4_04e1_11eb_b26f_f176fcf55738row0_col2" class="data row0 col2" >1</td>
<td data-preserve-html-node="true" id="T_42c1e1c4_04e1_11eb_b26f_f176fcf55738row0_col3" class="data row0 col3" >#015482</td>
<td data-preserve-html-node="true" id="T_42c1e1c4_04e1_11eb_b26f_f176fcf55738row0_col4" class="data row0 col4" >1</td>
</tr>
<tr data-preserve-html-node="true">
<th data-preserve-html-node="true" id="T_42c1e1c4_04e1_11eb_b26f_f176fcf55738level0_row1" class="row_heading level0 row1" >1</th>
<td data-preserve-html-node="true" id="T_42c1e1c4_04e1_11eb_b26f_f176fcf55738row1_col0" class="data row1 col0" >Sandstone_1</td>
<td data-preserve-html-node="true" id="T_42c1e1c4_04e1_11eb_b26f_f176fcf55738row1_col1" class="data row1 col1" >Default series</td>
<td data-preserve-html-node="true" id="T_42c1e1c4_04e1_11eb_b26f_f176fcf55738row1_col2" class="data row1 col2" >2</td>
<td data-preserve-html-node="true" id="T_42c1e1c4_04e1_11eb_b26f_f176fcf55738row1_col3" class="data row1 col3" >#9f0052</td>
<td data-preserve-html-node="true" id="T_42c1e1c4_04e1_11eb_b26f_f176fcf55738row1_col4" class="data row1 col4" >2</td>
</tr>
<tr data-preserve-html-node="true">
<th data-preserve-html-node="true" id="T_42c1e1c4_04e1_11eb_b26f_f176fcf55738level0_row2" class="row_heading level0 row2" >2</th>
<td data-preserve-html-node="true" id="T_42c1e1c4_04e1_11eb_b26f_f176fcf55738row2_col0" class="data row2 col0" >Siltstone</td>
<td data-preserve-html-node="true" id="T_42c1e1c4_04e1_11eb_b26f_f176fcf55738row2_col1" class="data row2 col1" >Default series</td>
<td data-preserve-html-node="true" id="T_42c1e1c4_04e1_11eb_b26f_f176fcf55738row2_col2" class="data row2 col2" >3</td>
<td data-preserve-html-node="true" id="T_42c1e1c4_04e1_11eb_b26f_f176fcf55738row2_col3" class="data row2 col3" >#ffbe00</td>
<td data-preserve-html-node="true" id="T_42c1e1c4_04e1_11eb_b26f_f176fcf55738row2_col4" class="data row2 col4" >3</td>
</tr>
<tr data-preserve-html-node="true">
<th data-preserve-html-node="true" id="T_42c1e1c4_04e1_11eb_b26f_f176fcf55738level0_row3" class="row_heading level0 row3" >3</th>
<td data-preserve-html-node="true" id="T_42c1e1c4_04e1_11eb_b26f_f176fcf55738row3_col0" class="data row3 col0" >Sandstone_2</td>
<td data-preserve-html-node="true" id="T_42c1e1c4_04e1_11eb_b26f_f176fcf55738row3_col1" class="data row3 col1" >Default series</td>
<td data-preserve-html-node="true" id="T_42c1e1c4_04e1_11eb_b26f_f176fcf55738row3_col2" class="data row3 col2" >4</td>
<td data-preserve-html-node="true" id="T_42c1e1c4_04e1_11eb_b26f_f176fcf55738row3_col3" class="data row3 col3" >#728f02</td>
<td data-preserve-html-node="true" id="T_42c1e1c4_04e1_11eb_b26f_f176fcf55738row3_col4" class="data row3 col4" >4</td>
</tr>
<tr data-preserve-html-node="true">
<th data-preserve-html-node="true" id="T_42c1e1c4_04e1_11eb_b26f_f176fcf55738level0_row4" class="row_heading level0 row4" >4</th>
<td data-preserve-html-node="true" id="T_42c1e1c4_04e1_11eb_b26f_f176fcf55738row4_col0" class="data row4 col0" >Main_Fault</td>
<td data-preserve-html-node="true" id="T_42c1e1c4_04e1_11eb_b26f_f176fcf55738row4_col1" class="data row4 col1" >Default series</td>
<td data-preserve-html-node="true" id="T_42c1e1c4_04e1_11eb_b26f_f176fcf55738row4_col2" class="data row4 col2" >5</td>
<td data-preserve-html-node="true" id="T_42c1e1c4_04e1_11eb_b26f_f176fcf55738row4_col3" class="data row4 col3" >#443988</td>
<td data-preserve-html-node="true" id="T_42c1e1c4_04e1_11eb_b26f_f176fcf55738row4_col4" class="data row4 col4" >5</td>
</tr>
<tr data-preserve-html-node="true">
<th data-preserve-html-node="true" id="T_42c1e1c4_04e1_11eb_b26f_f176fcf55738level0_row5" class="row_heading level0 row5" >5</th>
<td data-preserve-html-node="true" id="T_42c1e1c4_04e1_11eb_b26f_f176fcf55738row5_col0" class="data row5 col0" >basement</td>
<td data-preserve-html-node="true" id="T_42c1e1c4_04e1_11eb_b26f_f176fcf55738row5_col1" class="data row5 col1" >Basement</td>
<td data-preserve-html-node="true" id="T_42c1e1c4_04e1_11eb_b26f_f176fcf55738row5_col2" class="data row5 col2" >1</td>
<td data-preserve-html-node="true" id="T_42c1e1c4_04e1_11eb_b26f_f176fcf55738row5_col3" class="data row5 col3" >#ff3f20</td>
<td data-preserve-html-node="true" id="T_42c1e1c4_04e1_11eb_b26f_f176fcf55738row5_col4" class="data row5 col4" >6</td>
</tr>
</tbody></table>
#get information about surface points
gp.get_data(geo_model, 'surface_points').head()
|
X |
Y |
Z |
smooth |
surface |
0 |
1000 |
50 |
450.000000 |
0.000002 |
Shale |
1 |
1000 |
150 |
433.333333 |
0.000002 |
Shale |
2 |
1000 |
300 |
433.333333 |
0.000002 |
Shale |
3 |
1000 |
500 |
466.666667 |
0.000002 |
Shale |
4 |
1000 |
1000 |
533.333333 |
0.000002 |
Shale |
#get information about orientations
gp.get_data(geo_model, 'orientations').head()
|
X |
Y |
Z |
G_x |
G_y |
G_z |
smooth |
surface |
0 |
1000 |
1000 |
300 |
0.316229 |
1.000019e-12 |
0.948683 |
0.01 |
Shale |
1 |
400 |
1000 |
420 |
0.316229 |
1.000019e-12 |
0.948683 |
0.01 |
Sandstone_2 |
2 |
500 |
1000 |
300 |
-0.948683 |
9.998257e-13 |
0.316229 |
0.01 |
Main_Fault |
#define stack from layers
gp.map_stack_to_surfaces(geo_model,
{"Fault_Series":"Main_Fault",
"Strat_Series":('Sandstone_2','Siltstone','Shale','Sandstone_1','basement')},
remove_unused_series=True)
#T_42e2112e_04e1_11eb_b26f_f176fcf55738row0_col3 {
background-color: #443988;
} #T_42e2112e_04e1_11eb_b26f_f176fcf55738row1_col3 {
background-color: #015482;
} #T_42e2112e_04e1_11eb_b26f_f176fcf55738row2_col3 {
background-color: #9f0052;
} #T_42e2112e_04e1_11eb_b26f_f176fcf55738row3_col3 {
background-color: #ffbe00;
} #T_42e2112e_04e1_11eb_b26f_f176fcf55738row4_col3 {
background-color: #728f02;
} #T_42e2112e_04e1_11eb_b26f_f176fcf55738row5_col3 {
background-color: #ff3f20;
}</style><table data-preserve-html-node="true" id="T_42e2112e_04e1_11eb_b26f_f176fcf55738" ><thead data-preserve-html-node="true"> <tr data-preserve-html-node="true"> <th data-preserve-html-node="true" class="blank level0" ></th> <th data-preserve-html-node="true" class="col_heading level0 col0" >surface</th> <th data-preserve-html-node="true" class="col_heading level0 col1" >series</th> <th data-preserve-html-node="true" class="col_heading level0 col2" >order_surfaces</th> <th data-preserve-html-node="true" class="col_heading level0 col3" >color</th> <th data-preserve-html-node="true" class="col_heading level0 col4" >id</th> </tr></thead><tbody data-preserve-html-node="true">
<tr data-preserve-html-node="true">
<th data-preserve-html-node="true" id="T_42e2112e_04e1_11eb_b26f_f176fcf55738level0_row0" class="row_heading level0 row0" >4</th>
<td data-preserve-html-node="true" id="T_42e2112e_04e1_11eb_b26f_f176fcf55738row0_col0" class="data row0 col0" >Main_Fault</td>
<td data-preserve-html-node="true" id="T_42e2112e_04e1_11eb_b26f_f176fcf55738row0_col1" class="data row0 col1" >Fault_Series</td>
<td data-preserve-html-node="true" id="T_42e2112e_04e1_11eb_b26f_f176fcf55738row0_col2" class="data row0 col2" >1</td>
<td data-preserve-html-node="true" id="T_42e2112e_04e1_11eb_b26f_f176fcf55738row0_col3" class="data row0 col3" >#443988</td>
<td data-preserve-html-node="true" id="T_42e2112e_04e1_11eb_b26f_f176fcf55738row0_col4" class="data row0 col4" >1</td>
</tr>
<tr data-preserve-html-node="true">
<th data-preserve-html-node="true" id="T_42e2112e_04e1_11eb_b26f_f176fcf55738level0_row1" class="row_heading level0 row1" >0</th>
<td data-preserve-html-node="true" id="T_42e2112e_04e1_11eb_b26f_f176fcf55738row1_col0" class="data row1 col0" >Shale</td>
<td data-preserve-html-node="true" id="T_42e2112e_04e1_11eb_b26f_f176fcf55738row1_col1" class="data row1 col1" >Strat_Series</td>
<td data-preserve-html-node="true" id="T_42e2112e_04e1_11eb_b26f_f176fcf55738row1_col2" class="data row1 col2" >1</td>
<td data-preserve-html-node="true" id="T_42e2112e_04e1_11eb_b26f_f176fcf55738row1_col3" class="data row1 col3" >#015482</td>
<td data-preserve-html-node="true" id="T_42e2112e_04e1_11eb_b26f_f176fcf55738row1_col4" class="data row1 col4" >2</td>
</tr>
<tr data-preserve-html-node="true">
<th data-preserve-html-node="true" id="T_42e2112e_04e1_11eb_b26f_f176fcf55738level0_row2" class="row_heading level0 row2" >1</th>
<td data-preserve-html-node="true" id="T_42e2112e_04e1_11eb_b26f_f176fcf55738row2_col0" class="data row2 col0" >Sandstone_1</td>
<td data-preserve-html-node="true" id="T_42e2112e_04e1_11eb_b26f_f176fcf55738row2_col1" class="data row2 col1" >Strat_Series</td>
<td data-preserve-html-node="true" id="T_42e2112e_04e1_11eb_b26f_f176fcf55738row2_col2" class="data row2 col2" >2</td>
<td data-preserve-html-node="true" id="T_42e2112e_04e1_11eb_b26f_f176fcf55738row2_col3" class="data row2 col3" >#9f0052</td>
<td data-preserve-html-node="true" id="T_42e2112e_04e1_11eb_b26f_f176fcf55738row2_col4" class="data row2 col4" >3</td>
</tr>
<tr data-preserve-html-node="true">
<th data-preserve-html-node="true" id="T_42e2112e_04e1_11eb_b26f_f176fcf55738level0_row3" class="row_heading level0 row3" >2</th>
<td data-preserve-html-node="true" id="T_42e2112e_04e1_11eb_b26f_f176fcf55738row3_col0" class="data row3 col0" >Siltstone</td>
<td data-preserve-html-node="true" id="T_42e2112e_04e1_11eb_b26f_f176fcf55738row3_col1" class="data row3 col1" >Strat_Series</td>
<td data-preserve-html-node="true" id="T_42e2112e_04e1_11eb_b26f_f176fcf55738row3_col2" class="data row3 col2" >3</td>
<td data-preserve-html-node="true" id="T_42e2112e_04e1_11eb_b26f_f176fcf55738row3_col3" class="data row3 col3" >#ffbe00</td>
<td data-preserve-html-node="true" id="T_42e2112e_04e1_11eb_b26f_f176fcf55738row3_col4" class="data row3 col4" >4</td>
</tr>
<tr data-preserve-html-node="true">
<th data-preserve-html-node="true" id="T_42e2112e_04e1_11eb_b26f_f176fcf55738level0_row4" class="row_heading level0 row4" >3</th>
<td data-preserve-html-node="true" id="T_42e2112e_04e1_11eb_b26f_f176fcf55738row4_col0" class="data row4 col0" >Sandstone_2</td>
<td data-preserve-html-node="true" id="T_42e2112e_04e1_11eb_b26f_f176fcf55738row4_col1" class="data row4 col1" >Strat_Series</td>
<td data-preserve-html-node="true" id="T_42e2112e_04e1_11eb_b26f_f176fcf55738row4_col2" class="data row4 col2" >4</td>
<td data-preserve-html-node="true" id="T_42e2112e_04e1_11eb_b26f_f176fcf55738row4_col3" class="data row4 col3" >#728f02</td>
<td data-preserve-html-node="true" id="T_42e2112e_04e1_11eb_b26f_f176fcf55738row4_col4" class="data row4 col4" >5</td>
</tr>
<tr data-preserve-html-node="true">
<th data-preserve-html-node="true" id="T_42e2112e_04e1_11eb_b26f_f176fcf55738level0_row5" class="row_heading level0 row5" >5</th>
<td data-preserve-html-node="true" id="T_42e2112e_04e1_11eb_b26f_f176fcf55738row5_col0" class="data row5 col0" >basement</td>
<td data-preserve-html-node="true" id="T_42e2112e_04e1_11eb_b26f_f176fcf55738row5_col1" class="data row5 col1" >Strat_Series</td>
<td data-preserve-html-node="true" id="T_42e2112e_04e1_11eb_b26f_f176fcf55738row5_col2" class="data row5 col2" >5</td>
<td data-preserve-html-node="true" id="T_42e2112e_04e1_11eb_b26f_f176fcf55738row5_col3" class="data row5 col3" >#ff3f20</td>
<td data-preserve-html-node="true" id="T_42e2112e_04e1_11eb_b26f_f176fcf55738row5_col4" class="data row5 col4" >6</td>
</tr>
</tbody></table>
#get stack information
geo_model.stack
|
order_series |
BottomRelation |
isActive |
isFault |
isFinite |
Fault_Series |
1 |
Erosion |
False |
False |
False |
Strat_Series |
2 |
Erosion |
False |
False |
False |
#define fault
geo_model.set_is_fault(['Fault_Series'])
Fault colors changed. If you do not like this behavior, set change_color to False.
|
order_series |
BottomRelation |
isActive |
isFault |
isFinite |
Fault_Series |
1 |
Fault |
True |
True |
False |
Strat_Series |
2 |
Erosion |
True |
False |
False |
#review fault information
geo_model.faults.faults_relations_df
|
Fault_Series |
Strat_Series |
Fault_Series |
False |
True |
Strat_Series |
False |
False |
#review fault information
geo_model.faults
|
order_series |
BottomRelation |
isActive |
isFault |
isFinite |
Fault_Series |
1 |
Fault |
True |
True |
False |
Strat_Series |
2 |
Erosion |
True |
False |
False |
#get grid geometry as array
geo_model.grid
Grid Object. Values:
array([[ 20. , 20. , 7.5],
[ 20. , 20. , 22.5],
[ 20. , 20. , 37.5],
...,
[1980. , 1980. , 712.5],
[1980. , 1980. , 727.5],
[1980. , 1980. , 742.5]])
#plot surface points and orientations
plot = gp.plot_2d(geo_model, show_lith=False, show_boundaries=False)
plt.show()