Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x0 is infeasible. #271

Open
jaha2600 opened this issue Mar 20, 2023 · 0 comments
Open

x0 is infeasible. #271

jaha2600 opened this issue Mar 20, 2023 · 0 comments

Comments

@jaha2600
Copy link

I am trying to use pykrige to create an Ordainary Kriged map from a point shapefile.
There are a few rows in the point shapefile that have 'inf' values that I remove at the start of the script, leaving a complete point shapefile.

I import the shapefile and boundary shapefile, create testing and training datasets, and create a 100 by 100 grid succesfully.
However, when I go to create the Ordainary Kriging object I get the below error:

Could I get any advice as to why this is happening?
I attach my complete code to the message.

ValueError Traceback (most recent call last)
Cell In[89], line 3
1 #%%
2 # Generate ordinary kriging object
----> 3 OK = OrdinaryKriging(
4 np.array(x_rain_wgs),
5 np.array(y_rain_wgs),
6 value_rain,
7 variogram_model = "linear",
8 verbose = False,
9 enable_plotting = False,
10 coordinates_type = "euclidean",
11 )
13 # Evaluate the method on grid
14 Z_pk_krig, sigma_squared_p_krig = OK.execute("grid", XX_pk_krig, YY_pk_krig)

File ~/miniconda3/envs/pykrige/lib/python3.11/site-packages/pykrige/ok.py:321, in OrdinaryKriging.init(self, x, y, z, variogram_model, variogram_parameters, v
kriging.txt
ariogram_function, nlags, weight, anisotropy_scaling, anisotropy_angle, verbose, enable_plotting, enable_statistics, coordinates_type, exact_values, pseudo_inv, pseudo_inv_type)
312 print("Initializing variogram model...")
314 vp_temp = _make_variogram_parameter_list(
315 self.variogram_model, variogram_parameters
316 )
317 (
318 self.lags,
319 self.semivariance,
...
--> 818 raise ValueError("x0 is infeasible.")
820 x_scale = check_x_scale(x_scale, x0)
822 ftol, xtol, gtol = check_tolerance(ftol, xtol, gtol, method)

ValueError: x0 is infeasible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant