-
Notifications
You must be signed in to change notification settings - Fork 191
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
BUG: write_asc_grid function does not run as expected #197
Comments
Hey there, I see the problem: PyKrige/pykrige/kriging_tools.py Line 74 in 09fe018
This should be implemented with a safer comparison of floats. Could you give a minimal example to reproduce this behavior? maybe you could also correct the values for Cheers, Sebastian |
from pykrige import kriging_tools as kt
from pykrige.ok import OrdinaryKriging
import numpy as np
from hdhm.grid import RasterGrid
data = np.array(
[
[253387, 3496927, 2],
[300000, 3529426, 10],
[256087, 3536927, 6],
]
)
file_path = "huaihe/dem.txt"
grid, x, y, cell, no_data = kt.read_asc_grid(file_path)
OK = OrdinaryKriging(
data[:, 0],
data[:, 1],
data[:, 2],
variogram_model="linear",
verbose=False,
enable_plotting=False,
)
dem = RasterGrid(file_path)
z, ss = OK.execute("grid", x, y)
kt.write_asc_grid(x, y, z, filename="amos.asc", style=2) |
I'm trying to convert result[z] to asc file by using
Thanks for your response. |
But remember that just because of the |
kriging_tools.py line 73
I got abs((x[-1] - x[0]) / (x.shape[0] - 1)) calculated as 0.999999999999998 , while dx calculated as 1, so the function didn't work.
Is there any way to overcome this problem
The text was updated successfully, but these errors were encountered: