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

Error in griddata_example #3

Open
pal23232 opened this issue Dec 5, 2017 · 1 comment
Open

Error in griddata_example #3

pal23232 opened this issue Dec 5, 2017 · 1 comment

Comments

@pal23232
Copy link

pal23232 commented Dec 5, 2017

Hi,

When I try running the sample code (verbatim) in griddata_example, I get the following error:
I am using python 2.7 and numpy 1.13.3

`IndexError Traceback (most recent call last)
in ()
28 zi = griddata(x,y,z,xi,yi,interp='linear')
29 fn = Interpolator(points, z)
---> 30 zi_idw = fn(interp_points, method='idw', nnear=10) #using inverse distance wieghting with a nieghborhood of 10 points
31
32

/usr/local/lib/python2.7/site-packages/smear/interpolate.pyc in call(self, xi, method, nnear, eps, threshold, **kwargs)
29
30 n_interp = 0
---> 31 above_threshold = interpolated_values[~below_threshold,:]
32 interpolator_fn = getattr(self, '_' + method)
33 for dist, ix in zip(dist[~below_threshold], ix[~below_threshold]):

IndexError: too many indices for array`

@dharhas
Copy link
Owner

dharhas commented Dec 6, 2017

This is not a mature package. I haven't worked on it in 5 years. It might be a bug or a change in api of one of the dependencies. From setup.py it looks like it should work with numpy 1.4.0 so I would try that first.

There is a possibility that in the future I might clean this code up, make it more usable and python 3 compatible, but currently I'm working in another field.

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

2 participants