[feature request] fast interpolation in uniformly-spaced data
See original GitHub issueWhen working with uniformly-spaced data, it is possible to skip the initial search operation that an interpolation algorithm would ordinarily have to perform. This tends to speed things up significantly. It would be nice to have some specialized interpolators in SciPy that do linear interpolation and spline interpolation on uniformly-spaced data. The following sample code does linear interpolation without search:
# Interpolate linearly, taking advantage of the fact that
# the values in `f` are uniformly spaced.
quo, rem= np.divmod(x, step)
fraction= rem / step
# Although the quotient values returned by `numpy.divmod` are integers, the
# array dtype is 'f4'. ==> We must force the dtype to 'i4' so that the
# quotient values can be used for indexing:
quo= quo.astype('i4')
result= fraction * r[quo+1] + (1-fraction) * r[quo]
Issue Analytics
- State:
- Created 4 years ago
- Comments:16 (12 by maintainers)
Top Results From Across the Web
Fast Linear Interpolation - ACM Digital Library
We present fast implementations of linear interpolation operators for piecewise linear functions and multi-dimensional look-up tables.
Read more >Interpolation and Smoothing - Maple Help - Maplesoft
The x-data points are taken uniformly in the range, as the integers from 1 to 15. But they could just as well be...
Read more >What is interpolate and pre-averaging | Igor Pro by WaveMetrics
When you have this evenly spaced data set, you can continue with only the yi wave and set its scaling to start at...
Read more >A Fast Global Interpolation Method for Digital Terrain Model ...
One promising feature of LiDAR point clouds is the high-density with a large amount of data points. However, this imposes a great challenge...
Read more >FAST LINEAR INTERPOLATION FOR PIECEWISE-LINEAR ...
We present fast implementations of linear interpolation operators for piecewise ... uniformly-spaced LUTs to better cover irregular keypoints.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
In all of my use cases, I define the interpolating function and then apply it exactly once, so it would be helpful if there were a way to pass a flag that says, “The caller promises that the independent variable is uniformly spaced.”
On Mon, Jun 3, 2019 at 9:38 PM Huize Wang notifications@github.com wrote:
Over the last 40 years, most of the data with which I’ve worked has been uniformly spaced in the independent variables. So, I’m inclined to think that this case is not that specialized.
On Wed, May 15, 2019 at 12:33 AM Evgeni Burovski notifications@github.com wrote: