Simulations in 3-D¶

InĀ [1]:
import numpy as np
import plotly.graph_objects as go
import gstlearn as gl
import gstlearn.plot as gp
import gstlearn.plot3D as gop
InĀ [2]:
model = gl.Model.createFromParam(
    gl.ECov.MATERN, param=0.5, range=50, space=gl.SpaceRN.create(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]:
gp.plot(grid, "Simu", posX=0, posY=2)
gp.geometry(dims=[7, 7])
No description has been provided for this image