How to do meshfree 3D krige interpolation? #342
-
I have about 100,000 meshfree points in 3D coordinate. The examples just show the codes to generate a structured mesh filed to interpolation. So I wanna know how to interpolate in meshfree format or unstructured mesh format. And what tools are need to get unstructured mesh. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hey there, to have an unstructured target grid, just call the import numpy as np
import gstools as gs
# conditioning data
cond_x = [0.3, 1.9, 1.1, 3.3, 4.7]
cond_y = [1.2, 0.6, 3.2, 4.4, 3.8]
cond_val = [0.47, 0.56, 0.74, 1.47, 1.74]
cond_pos = [cond_x, cond_y]
# unstructued points of target grid in (0, 6) x (0, 6)
x = np.random.RandomState(19970221).rand(1000) * 6.
y = np.random.RandomState(20011012).rand(1000) * 6.
model = gs.Gaussian(
dim=2, len_scale=1, anis=0.2, angles=-0.5, var=0.5, nugget=0.1
)
krig = gs.krige.Ordinary(model, cond_pos=cond_pos, cond_val=cond_val)
field, var = krig.unstructured(pos=(x, y)) # or krig(pos=(x, y), mesh_type="unstructured") Hope this answers your question! Cheers, |
Beta Was this translation helpful? Give feedback.
Hey there, to have an unstructured target grid, just call the
unstructured
method or passmesh_type="unstructured"
to the kriging call (actually not needed, since this is the default mesh type):