Sequential Gaussian Simulations¶
Dataset¶
The 2D Walker Lake dataset will be used for demonstration purposes.
In [1]:
Copied!
import numpy as np
import geolime as geo
import plotly.io as pio
pio.renderers.default = "sphinx_gallery"
import numpy as np
import geolime as geo
import plotly.io as pio
pio.renderers.default = "sphinx_gallery"
Dataset preprocessing¶
In [2]:
Copied!
data = geo.datasets.load("walker_lake/walker_lake_sample.csv")
data.head()
data = geo.datasets.load("walker_lake/walker_lake_sample.csv")
data.head()
Out[2]:
x | y | z | v | u | t | |
---|---|---|---|---|---|---|
0 | 11.0 | 8.0 | 0.0 | 0.0 | NaN | 2 |
1 | 8.0 | 30.0 | 0.0 | 0.0 | NaN | 2 |
2 | 9.0 | 48.0 | 0.0 | 224.4 | NaN | 2 |
3 | 8.0 | 69.0 | 0.0 | 434.4 | NaN | 2 |
4 | 9.0 | 90.0 | 0.0 | 412.1 | NaN | 2 |
In [3]:
Copied!
point_cloud = geo.PointCloud(name='WalkerLake', xyz=data[['x', 'y', 'z']])
point_cloud.set_property(name='V', data=data['v'])
point_cloud = geo.PointCloud(name='WalkerLake', xyz=data[['x', 'y', 'z']])
point_cloud.set_property(name='V', data=data['v'])
In [4]:
Copied!
vx = geo.Voxel(
name='WalkerLake',
shape=[26, 30],
axis=[[10., 0., 0.], [0., 10., 0.]],
)
vx = geo.Voxel(
name='WalkerLake',
shape=[26, 30],
axis=[[10., 0., 0.], [0., 10., 0.]],
)
Simulations¶
Parameters¶
In [5]:
Copied!
covariance = (
7000 * geo.Nugget(dimension=2)
+ 88000 * geo.Spherical(
dimension=2,
metric=geo.Metric(angles=160,scales=[45,45])
)
)
neighborhood = geo.MinMaxPointsNeighborhood(
dimension=2,
min_n=1,
max_n=25,
metric=geo.Metric(angles=90,scales=[40.,40.])
)
covariance = (
7000 * geo.Nugget(dimension=2)
+ 88000 * geo.Spherical(
dimension=2,
metric=geo.Metric(angles=160,scales=[45,45])
)
)
neighborhood = geo.MinMaxPointsNeighborhood(
dimension=2,
min_n=1,
max_n=25,
metric=geo.Metric(angles=90,scales=[40.,40.])
)
Initialize Solver¶
In [6]:
Copied!
sgs_estimator = geo.SGS(
covariance_model=covariance,
neighborhood_model=neighborhood,
axes = [geo.Coord.U, geo.Coord.V]
)
sgs_estimator = geo.SGS(
covariance_model=covariance,
neighborhood_model=neighborhood,
axes = [geo.Coord.U, geo.Coord.V]
)
Solving¶
In [7]:
Copied!
sgs_estimator.solve(
obj=point_cloud,
obj_region=None,
obj_attribute='V',
support=vx,
support_region=None,
support_attribute='sgs',
simulations_number=400
)
sgs_estimator.solve(
obj=point_cloud,
obj_region=None,
obj_attribute='V',
support=vx,
support_region=None,
support_attribute='sgs',
simulations_number=400
)
Simulating grade: 100%|██████████████████████████████████| Time: 0:00:12
Plotting Results¶
Mean of the results is store as an attribute and can be display.
In [8]:
Copied!
geo.plot(vx, property="sgs_mean", agg_method="mean", width=600, height=650)
geo.plot(vx, property="sgs_mean", agg_method="mean", width=600, height=650)
Separate realization can also be displayed.
In [9]:
Copied!
geo.plot(vx, property="sgs_1", agg_method="mean", width=600, height=650)
geo.plot(vx, property="sgs_1", agg_method="mean", width=600, height=650)
Last update:
2023-10-30