In [1]:
# Importing GemPy
import gempy as gp
# Embedding matplotlib figures in the notebooks
%matplotlib inline
# Importing auxiliary libraries
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
In [2]:
np.random.seed(1515)
pd.set_option('precision', 2)
In [3]:
# %%
# Data Preparation
data_path = 'https://raw.githubusercontent.com/cgre-aachen/gempy_data/master/'
geo_data = gp.create_data('viz_2d', [0, 1000, 0, 1000, 0, 1000], resolution=[10, 10, 10],
path_o=data_path + "/data/input_data/jan_models/model5_orientations.csv",
path_i=data_path + "/data/input_data/jan_models/model5_surface_points.csv")
In [4]:
gp.plot_2d(geo_data)
Out[4]:
In [5]:
geo_data.set_topography()
Out[5]:
In [6]:
section_dict = {'section1':([0,0],[1000,1000],[100,80]),
'section2':([800,0],[800,1000],[150,100]),
'section3':([50,200],[100,500],[200,150])}
In [7]:
geo_data.set_section_grid(section_dict)
Out[7]:
In [8]:
gp.plot.plot_section_traces(geo_data)
Out[8]:
In [9]:
gp.set_interpolator(geo_data)
Out[9]:
In [10]:
gp.map_series_to_surfaces(geo_data,
{"Fault_Series":'fault',
"Strat_Series": ('rock2','rock1')})
geo_data.set_is_fault(['Fault_Series'])
Out[10]:
In [11]:
geo_data.get_active_grids()
Out[11]:
In [12]:
gp.compute_model(geo_data);
In [13]:
gp.plot_2d(geo_data, section_names=['section1'])
Out[13]:
In [14]:
%matplotlib qt5
p = gp.plot_2d(geo_data, section_names=[], direction=None, show=False)
In [15]:
sec_name = 'section1'
a = p.add_section(sec_name)
In [16]:
p.plot_data(a, sec_name, projection_distance=200)
In [17]:
p.plot_contacts(a, sec_name)
In [18]:
p.plot_lith(a, sec_name)
p.plot_topography(a, sec_name)
In [19]:
p.fig
Out[19]:
In [20]:
sec_name = 'section1'
sec_name_2 = 'section3'
p2 = gp.plot_2d(geo_data, n_axis = 3, figsize=(15,15), # General fig options
section_names=[sec_name,'topography'], cell_number=[3], # Defining the sections
show_data=False, show_lith=False, show_scalar=False, show_boundaries=False)
In [21]:
# Create the section. This loacte the axes and give the right
# aspect ratio and labels
s1 = p2.add_section(sec_name_2, ax_pos=224)
In [22]:
###### Axes 0
p2.plot_contacts(s1, sec_name_2)
p2.plot_lith(s1, sec_name_2)
p2.plot_data(s1, sec_name_2, projection_distance=200)
p2.plot_topography(s1, sec_name_2)
# # Axes 1
p2.plot_contacts(p2.axes[0], cell_number=3)
p2.plot_scalar_field(p2.axes[0], cell_number=3, series_n=1)
# Axes2.
p2.plot_lith(p2.axes[1], 'topography')
p2.plot_contacts(p2.axes[1], 'topography')
In [23]:
p2.fig
Out[23]:
In [24]:
p2.plot_section_traces(p2.axes[1])
If nothing is passed, a Plot2D object is created and therefore you are in the same situation as above:
In [25]:
# By default we plot a cross-section mainly for backwards compatibility
p3 = gp.plot_2d(geo_data, direction=None)
Alternatively you can pass section_names, cell_numbers + direction or any combination of the above:
In [26]:
%matplotlib inline
_ = gp.plot_2d(geo_data, section_names=['topography'])
Out[26]:
In [27]:
_ = gp.plot_2d(geo_data, section_names=['section1'])
Out[27]:
In [28]:
_ = gp.plot_2d(geo_data, section_names=['section1', 'section2'])
Out[28]:
In [31]:
_ = gp.plot_2d(geo_data, figsize=(15,15), section_names=['section1', 'section2', 'topography'],
cell_number='mid')