-
Notifications
You must be signed in to change notification settings - Fork 26
Support unequally spaced grids #1
Comments
Agreed, it would be useful functionality, although I don't personally have any need for it (at least not in the immediate future). I haven't thought it through in detail, but I suspect the computations have extra steps. If so, it would be best (for reasons of performance) to separate this functionality from the evenly-spaced algorithms. |
This now has limited support via the |
I've run into a problem with
|
Ok, I think I've fixed this. Pull request coming shortly... |
+1, unevenly spaced grid interpolation would be great. |
I added a type that is similar to MATLAB's interp1d function. It only supports linear interpolation. https://github.com/CorySimon/Grid.jl/blob/interp1d/src/interp1d.jl How can I overload the interp1d.interpolate function so that it can take an array as well? Without the commented out portion, it just sees the interp1d.interpolate(x::Array) function and not the Float64 one. What do you think? You can use this by:
|
Have you seen Create a grid like this: x = cumsum(rand(100)/10)
y = sin(x)
g = Grid.InterpIrregular(x, y, Grid.BCnan, Grid.InterpLinear) And then you can index into x2 = .1:.1:maximum(x)
y2 = g[x2] I think this issue could probably be closed. Note, though, that this package is slated to be replaced by Interpolations.jl, which still needs some irregular interpolation love. |
@mbauman Thanks, we should add this example to the README.md; I wasn't aware of this... |
Similar to the
interp
functions in Matlab, it would be good to specify unequally spaced (Cartesian) grids.The text was updated successfully, but these errors were encountered: