Simulations in 3-D¶
In [1]:
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
In [2]:
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
In [3]:
def get_lims_colors(surfacecolor):# color limits for a slice
return np.min(surfacecolor), np.max(surfacecolor)
In [4]:
def colorax(vmin, vmax):
return dict(cmin=vmin,
cmax=vmax)
In [5]:
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()
In [6]:
ax = grid.plot("Simu",posX=0,posY=2)
ax.geometry(dims=[7,7])
In [ ]: