-
Notifications
You must be signed in to change notification settings - Fork 200
Closed
Description
Hello,
It seems that the exact_values boolean parameter is inverted when doing Ordinary Kriging with the backend = 'C'.
When setting exact_values = True:
x = [2, 7, 15]
y = [10,18,4]
z = [10, 40, 30]
krig = pykrige.ok.OrdinaryKriging(x,y,z, variogram_model = 'exponential',
variogram_parameters = [1,5,0.6],
exact_values = True)
xgrid = np.arange(0.0,20.0)
ygrid = np.arange(0.0,20.0)
init = np.full((20,20), np.nan)
init[y,x] = z
fig, (ax0, ax1, ax2) = plt.subplots(1, 3, figsize = (15,5))
kriged_result_C = krig.execute(style = 'grid', xpoints = xgrid, ypoints = ygrid, backend = 'C')[0].data
kriged_result_C = np.asarray(kriged_result_C)
kriged_result_loop = krig.execute(style = 'grid', xpoints = xgrid, ypoints = ygrid, backend = 'loop')[0].data
kriged_result_loop = np.asarray(kriged_result_loop)
im0 = ax0.imshow(init, vmin=20, vmax=40)
ax0.set_title('No kriging')
im1 = ax1.imshow(kriged_result_C, vmin=20, vmax=40)
ax1.set_title('backend = C')
im2 = ax2.imshow(kriged_result_loop, vmin=20, vmax=40)
ax2.set_title('backend = loop')
fig.colorbar(im2, ax = [ax0,ax1, ax2])Output:
And when setting exact_values = False:
Reactions are currently unavailable

