#!/usr/bin/env python # coding: utf-8 # In[1]: # These two lines are necessary only if GemPy is not installed import sys, os sys.path.append("../..") # Importing GemPy import gempy as gp # Embedding matplotlib figures in the notebooks get_ipython().run_line_magic('matplotlib', 'inline') # Importing auxiliary libraries import numpy as np import matplotlib.pyplot as plt # In[2]: from gempy.plot import visualization_2d_pro as vv # ## Model interpolation # In[3]: # Data Preparation path_to_data = os.pardir+"/data/input_data/jan_models/" geo_data = gp.create_data([0,1000,0,1000,0,1000],resolution=[10,10,10], path_o = path_to_data + "model5_orientations.csv", path_i = path_to_data + "model5_surface_points.csv") # In[4]: gp.plot.plot_data(geo_data) # In[5]: geo_data.set_topography() # 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) # In[8]: geo_data.grid.sections # In[9]: gp.set_interpolation_data(geo_data, theano_optimizer='fast_compile', verbose=[]) # In[10]: gp.map_series_to_surfaces(geo_data, {"Fault_Series":'fault', "Strat_Series": ('rock2','rock1')}) geo_data.set_is_fault(['Fault_Series']) # In[11]: geo_data.grid.active_grids # In[12]: gp.compute_model(geo_data); # In[13]: gp.plot.plot_section(geo_data, 0) # In[14]: gp.plot.plot_section_by_name(geo_data, 'section3', show_all_data=True) # ### Plot2d-Pro: Granular interface: # #### One plot # In[38]: from importlib import reload reload(vv) p = vv.Plot2D(geo_data) p.create_figure((7, 7)) # In[39]: p.fig # In[40]: sec_name = 'section1' a = p.add_section(sec_name) # In[ ]: p. # In[44]: p.plot_data(a, sec_name, projection_distance=200) p.fig # In[43]: p.plot_contacts(a, sec_name) p.fig # In[ ]: p.plot_lith(a, sec_name) p.plot_topography(a, sec_name) # In[41]: p.fig # In[ ]: # #### Several plots # In[15]: from importlib import reload reload(vv) p = vv.Plot2D(geo_data) p.create_figure((13, 13)) #p.fig.show() sec_name = 'section1' sec_name_2 = 'section1' # Create the section. This loacte the axes and give the right # aspect ratio and labels a = p.add_section(sec_name, ax_pos=121) b = p.add_section(cell_number=3, ax_pos=222) t = p.add_section('topography', ax_pos= 224) # In[16]: # Axes 0 p.plot_contacts(a, sec_name) p.plot_lith(a, sec_name) p.plot_data(a, sec_name, projection_distance=200) p.plot_topography(a, sec_name) # # Axes 1 p.plot_contacts(b, cell_number=3) p.plot_lith(b, cell_number=3) p.plot_scalar_field(b, cell_number=3, sn=1) p.plot_topography(b, cell_number=2) # #axes2. p.plot_lith(t, 'topography') p.plot_scalar_field(t, 'topography', sn=1) p.plot_data(t, 'topography') p.plot_contacts(t, 'topography') #p.fig.tight_layout() # In[17]: p.fig # ##### Plotting traces: # In[18]: from importlib import reload reload(vv) p = vv.Plot2D(geo_data) p.create_figure((13, 13)) #p.fig.show() # In[19]: a1 = p.add_section('topography') p.plot_section_traces(a1) # In[20]: p.fig # ### Plot API # In[38]: from gempy.plot import plot_api as pa from importlib import reload reload(pa) # If nothing is passed, a Plot2D object is created and therefore you are in the same situation as above: # In[39]: p2 = pa.plot_2d(geo_data) # Alternatively you can pass section_names, cell_numbers + direction or any combination of the above: # In[40]: pa.plot_2d(geo_data, section_names=['topography']) # In[41]: pa.plot_2d(geo_data, section_names=['section1']) # In[42]: pa.plot_2d(geo_data, section_names=['section1', 'section2']) # In[43]: pa.plot_2d(geo_data, section_names=['section1', 'section2'], cell_number='mid') # In[60]: 2**20 # In[ ]: