Closed victortm closed 4 years ago
Could you provide a minimal example to reproduce the error?
Of course.
There you have some samples I'm working with:
Ignore ID parameter.
And this is how I'm calling the function:
In your example all data is in the same location. So the bining of the data for the variogram estimation results in degenerate Intervals. I get the same error with:
from pykrige import OrdinaryKriging as OK
lon = [-3.1, -3.1, -3.1]
lat = [40.0, 40.0, 40.0]
val = [1.1, 1.2, 1.3]
kr = OK(lon, lat, val, coordinates_type="geographic")
Traceback (most recent call last):
File "test.py", line 6, in <module>
kr = OK(lon, lat, val, coordinates_type="geographic")
File "/usr/local/lib/python3.6/dist-packages/pykrige/ok.py", line 253, in __init__
weight, self.coordinates_type)
File "/usr/local/lib/python3.6/dist-packages/pykrige/core.py", line 482, in _initialize_variogram_model
variogram_function, weight)
File "/usr/local/lib/python3.6/dist-packages/pykrige/core.py", line 580, in _calculate_variogram_model
args=(lags, semivariance, variogram_function, weight))
File "/usr/local/lib/python3.6/dist-packages/scipy/optimize/_lsq/least_squares.py", line 786, in least_squares
raise ValueError("`x0` is infeasible.")
ValueError: `x0` is infeasible.
Your data-locations need to be pairwise different!
Thanks, now works!
Solved.
Hi,
I'm trying to get a variogram using pykrige.ok.OrdinaryKriging function but I'm getting the next error:
I'm passing float values and longitude/latitude coordinates in decimal degrees.
I don't know if it could be related to this issue but I've found something that doesn't make so much sense to me in the documentation:
When longitude has West component, the result is negative, so is out of that [0,360] longitude range specified in the doc. Feel free to correct me if I'm wrong.
Thanks in advance and best regards