Note
Go to the end to download the full example code.
A geological model of the Perth basin, Australia¶
import os
# Importing GemPy
import gempy as gp
import gempy_viewer as gpv
# Importing auxiliary libraries
import matplotlib
matplotlib.rcParams['figure.figsize'] = (20.0, 10.0)
os.environ["aesara_FLAGS"] = "mode=FAST_RUN,device=cuda"
cwd = os.getcwd()
if 'examples' not in cwd:
data_path = os.getcwd() + '/examples'
else:
data_path = cwd + '/../..'
geo_model: gp.data.GeoModel = gp.create_geomodel(
project_name='Perth_Basin',
extent=[337000, 400000, 6640000, 6710000, -18000, 1000],
refinement=6,
importer_helper=gp.data.ImporterHelper(
path_to_orientations=data_path + "/data/input_data/perth_basin/Paper_GU2F_sc_faults_topo_Foliations.csv",
path_to_surface_points=data_path + "/data/input_data/perth_basin/Paper_GU2F_sc_faults_topo_Points.csv",
)
)
del_surfaces = ['Cadda', 'Woodada_Kockatea', 'Cattamarra']
for s in del_surfaces:
gp.remove_element_by_name(geo_model, s)
geo_model.structural_frame
gp.map_stack_to_surfaces(
gempy_model=geo_model,
mapping_object={
"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_Darling": ["Darling"],
"fault_Urella_South": ["Urella_South"],
"Sedimentary_Series": ['Cretaceous', 'Yarragadee', 'Eneabba', 'Lesueur', 'Permian']
}
)
Select which series are faults¶
gp.set_is_fault(
geo_model,
fault_groups=[
"fault_Abrolhos_Transfer",
"fault_Coomallo",
"fault_Eneabba_South",
"fault_Hypo_fault_W",
"fault_Hypo_fault_E",
"fault_Urella_North",
"fault_Darling",
"fault_Urella_South"
],
)
gp.set_fault_relation(geo_model, fr)
[[False False False False False False False False True]
[False False False False False False False False True]
[False False False False False False False False True]
[False False False False False False False False True]
[False False False False False False False False True]
[False False False False False False False False True]
[False False False False False False False False True]
[False False False False False False False False True]
[False False False False False False False False False]]
%matplotlib inline
gpv.plot_2d(geo_model, direction=['z'])

<gempy_viewer.modules.plot_2d.visualization_2d.Plot2D object at 0x7f57783b5550>
[-2800. 1000.]
Active grids: GridTypes.OCTREE|TOPOGRAPHY|NONE
Topography(_regular_grid=RegularGrid(resolution=array([192, 256, 64]), extent=array([ 3.37e+05, 4.00e+05, 6.64e+06, 6.71e+06, -1.80e+04, 1.00e+03]), values=array([[ 3.37164062e+05, 6.64013672e+06, -1.78515625e+04],
[ 3.37164062e+05, 6.64013672e+06, -1.75546875e+04],
[ 3.37164062e+05, 6.64013672e+06, -1.72578125e+04],
...,
[ 3.99835938e+05, 6.70986328e+06, 2.57812500e+02],
[ 3.99835938e+05, 6.70986328e+06, 5.54687500e+02],
[ 3.99835938e+05, 6.70986328e+06, 8.51562500e+02]],
shape=(3145728, 3)), mask_topo=array([], shape=(0, 3), dtype=bool), _transform=None, _base_resolution=array([6, 8, 2])), values_2d=array([[[ 3.37000000e+05, 6.64000000e+06, -7.24533876e+02],
[ 3.37000000e+05, 6.64027451e+06, -6.91975885e+02],
[ 3.37000000e+05, 6.64054902e+06, -6.49628543e+02],
...,
[ 3.37000000e+05, 6.70945098e+06, -8.00500255e+02],
[ 3.37000000e+05, 6.70972549e+06, -7.87422259e+02],
[ 3.37000000e+05, 6.71000000e+06, -7.58453496e+02]],
[[ 3.37329843e+05, 6.64000000e+06, -7.08916542e+02],
[ 3.37329843e+05, 6.64027451e+06, -6.65621167e+02],
[ 3.37329843e+05, 6.64054902e+06, -6.46360422e+02],
...,
[ 3.37329843e+05, 6.70945098e+06, -7.99152490e+02],
[ 3.37329843e+05, 6.70972549e+06, -7.78012174e+02],
[ 3.37329843e+05, 6.71000000e+06, -7.50183615e+02]],
[[ 3.37659686e+05, 6.64000000e+06, -6.90007614e+02],
[ 3.37659686e+05, 6.64027451e+06, -6.59237003e+02],
[ 3.37659686e+05, 6.64054902e+06, -6.54247495e+02],
...,
[ 3.37659686e+05, 6.70945098e+06, -7.80942756e+02],
[ 3.37659686e+05, 6.70972549e+06, -7.61042804e+02],
[ 3.37659686e+05, 6.71000000e+06, -7.37092870e+02]],
...,
[[ 3.99340314e+05, 6.64000000e+06, -9.16985702e+02],
[ 3.99340314e+05, 6.64027451e+06, -9.03982997e+02],
[ 3.99340314e+05, 6.64054902e+06, -8.76185422e+02],
...,
[ 3.99340314e+05, 6.70945098e+06, -9.48914474e+02],
[ 3.99340314e+05, 6.70972549e+06, -9.43398018e+02],
[ 3.99340314e+05, 6.71000000e+06, -9.34811451e+02]],
[[ 3.99670157e+05, 6.64000000e+06, -9.29659087e+02],
[ 3.99670157e+05, 6.64027451e+06, -9.06009121e+02],
[ 3.99670157e+05, 6.64054902e+06, -8.78979240e+02],
...,
[ 3.99670157e+05, 6.70945098e+06, -9.59049251e+02],
[ 3.99670157e+05, 6.70972549e+06, -9.53763811e+02],
[ 3.99670157e+05, 6.71000000e+06, -9.43295879e+02]],
[[ 4.00000000e+05, 6.64000000e+06, -9.35136730e+02],
[ 4.00000000e+05, 6.64027451e+06, -9.10199958e+02],
[ 4.00000000e+05, 6.64054902e+06, -9.03445859e+02],
...,
[ 4.00000000e+05, 6.70945098e+06, -9.95556706e+02],
[ 4.00000000e+05, 6.70972549e+06, -9.68392491e+02],
[ 4.00000000e+05, 6.71000000e+06, -9.52701595e+02]]],
shape=(192, 256, 3)), source=None, values=array([[ 3.37000000e+05, 6.64000000e+06, -7.24533876e+02],
[ 3.37000000e+05, 6.64027451e+06, -6.91975885e+02],
[ 3.37000000e+05, 6.64054902e+06, -6.49628543e+02],
...,
[ 4.00000000e+05, 6.70945098e+06, -9.95556706e+02],
[ 4.00000000e+05, 6.70972549e+06, -9.68392491e+02],
[ 4.00000000e+05, 6.71000000e+06, -9.52701595e+02]],
shape=(49152, 3)), resolution=(192, 256), raster_shape=())
gpv.plot_3d(geo_model)

<gempy_viewer.modules.plot_3d.vista.GemPyToVista object at 0x7f5778018830>
gp.compute_model(
gempy_model=geo_model,
engine_config= gp.data.GemPyEngineConfig(
backend=gp.data.AvailableBackends.PYTORCH,
dtype="float64",
)
)
Setting Backend To: AvailableBackends.PYTORCH
GPU requested but unavailable; falling back to CPU (GEMPY_GPU_FALLBACK=True)
Setting Backend To: AvailableBackends.PYTORCH
Chunking done: 10 chunks
Chunking done: 11 chunks
Chunking done: 7 chunks
Chunking done: 10 chunks
Chunking done: 9 chunks
Chunking done: 7 chunks
Chunking done: 7 chunks
Chunking done: 7 chunks
Chunking done: 8 chunks
Chunking done: 7 chunks
Chunking done: 61 chunks
Chunking done: 36 chunks
Chunking done: 48 chunks
Chunking done: 45 chunks
Chunking done: 36 chunks
Chunking done: 36 chunks
Chunking done: 36 chunks
Chunking done: 42 chunks
Chunking done: 36 chunks
Chunking done: 317 chunks
Chunking done: 19 chunks
Chunking done: 25 chunks
Chunking done: 23 chunks
Chunking done: 19 chunks
Chunking done: 19 chunks
Chunking done: 19 chunks
Chunking done: 22 chunks
Chunking done: 19 chunks
Chunking done: 163 chunks
Chunking done: 26 chunks
gpv.plot_2d(geo_model, cell_number="mid")

<gempy_viewer.modules.plot_2d.visualization_2d.Plot2D object at 0x7f57780e1cd0>
gpv.plot_2d(geo_model, cell_number="mid", series_n=-1, show_scalar=True)

<gempy_viewer.modules.plot_2d.visualization_2d.Plot2D object at 0x7f57801a1150>
gpv.plot_2d(geo_model, cell_number=[12], direction=["y"], show_data=True, show_topography=True)

<gempy_viewer.modules.plot_2d.visualization_2d.Plot2D object at 0x7f57783b5050>
sphinx_gallery_thumbnail_number = 6
gpv.plot_3d(geo_model, show_topography=True)

<gempy_viewer.modules.plot_3d.vista.GemPyToVista object at 0x7f57780c2eb0>
Total running time of the script: (1 minutes 33.817 seconds)