In [2]:
import sys, os
sys.path.append("C:\Users\Miguel\workspace\pygeomod\pygeomod")
import geoPyMC
import pymc as pm
import numpy as np
import geogrid
import matplotlib.pyplot as plt
reload (geoPyMC)
%matplotlib inline
In [199]:
# Init
GeoPlot = geoPyMC.GeoPyMC_rep("Example plotting")
# Loading data base
GeoPlot.load_db("C:\Users\Miguel\workspace\Thesis\Thesis\PyMC_geomod\database_paper/", "graben_Graben Soft Const.hdf5",
verbose = 1)
This plots are geomodel dependent. This means that is only posible to visualize if the database contains as trace the geomodels in form of pygeogrids!!!
In [200]:
# Extract GeoModels from database to pygeogrid objects
GeoPlot.extract_GeoMods()
In [5]:
GeoPlot.plot_lith_sect("y",cmap = "coolwarm_r")
In [61]:
GeoPlot.plot_lith_sect("y", multiplots= True, cmap = "coolwarm_r", geomod_coord = True)
In [ ]:
# The example database doesnt have geophysics simulated
GeoPlot.plot_grav_sect()
In [173]:
# Probability of each layer
GeoPlot.calculate_prob_lith()
# Layer probabily instance
GeoPlot.prob_lith
# Entropy
GeoPlot.calcualte_ie_masked()
# There are high probabilities that the colorbar sucks but the values are right
GeoPlot.ie.plot_section('x',cell_pos=3,colorbar = False, alpha = 0.8, cmap = 'coolwarm_r',
figsize=(6,6),interpolation= 'nearest' ,ve = 1, geomod_coord= False, contour = False,
savefig = True, fig_filename = "Entropy Sandstone")
In [ ]:
GeoPlot.ie.export_to_vtk("example_vtk")
In [138]:
GeoPlot.total_ie()
Out[138]:
In [238]:
# Import priors (exported with the method export priors during the simulation)
GeoPlot.import_prior_p(path ="C:\Users\Miguel\workspace\Thesis\Thesis\PyMC_geomod\database_paper\priors.p")
# Select from the data base the variables that can be plotted
GeoPlot._select_trace()
GeoPlot._plot_traces
Out[238]:
For the posterior ploting we need to have loaded the priors (usually from a pickle done during the simulation process)
In [202]:
# Plotting posteriors and priors
GeoPlot.plot_post(burn = 0)
In [232]:
GeoPlot.plot_joint3D(burn = 0)
In [235]:
GeoPlot.plot_traces(burn = 0)
In [255]:
reload (geoPyMC)
# Init
GeoPlot = geoPyMC.GeoPyMC_rep("Example plotting")
# Loading data base
GeoPlot.load_db("C:\Users\Miguel\workspace\Thesis\Thesis\PyMC_geomod\database_paper/", "graben_Graben Soft Const.hdf5",
verbose = 1)
In [253]:
# I think this data base does not have enough values to calculate Geweke
GeoPlot.plot_geweke(burn = 0)
In [256]:
GeoPlot.plot_forest(burn = 0)