import numpy as np
import plotly.graph_objects as go
import IPython
import gstlearn as gl
import gstlearn.plot as gp
import gstlearn.plot3D as gop
import matplotlib.pyplot as plt
model = gl.Model.createFromParam(gl.ECov.BESSEL_K,param=0.5,range=50,space=gl.SpaceRN(3))
grid = gl.DbGrid.create(nx = [40,30,20])
iuid = gl.simtub(None,dbout=grid,model=model)
grid.display()
Data Base Grid Characteristics ============================== Data Base Summary ----------------- File is organized as a regular grid Space dimension = 3 Number of Columns = 5 Total number of samples = 24000 Grid characteristics: --------------------- Origin : 0.000 0.000 0.000 Mesh : 1.000 1.000 1.000 Number : 40 30 20 Variables --------- Column = 0 - Name = rank - Locator = NA Column = 1 - Name = x1 - Locator = x1 Column = 2 - Name = x2 - Locator = x2 Column = 3 - Name = x3 - Locator = x3 Column = 4 - Name = Simu - Locator = z1
def get_lims_colors(surfacecolor):# color limits for a slice
return np.min(surfacecolor), np.max(surfacecolor)
def colorax(vmin, vmax):
return dict(cmin=vmin,
cmax=vmax)
res = grid["Simu"].reshape(grid.getNXs())
sminz, smaxz = get_lims_colors(res)
data = [gop.SliceOnDbGrid(grid,"Simu",0,12),
gop.SliceOnDbGrid(grid,"Simu",2,11),
gop.SliceOnDbGrid(grid,"Simu",1,3)
]
fig1 = go.Figure(data=data)
f = fig1.show()
ax = grid.plot("Simu",posX=0,posY=2)
ax.geometry(dims=[7,7])