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

Gridded Cubic Splines (WIP) #193

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

alexmorley
Copy link

@alexmorley alexmorley commented Feb 19, 2018

Very much work in progress! Allows cubic spline interpolation for a uneven grid.

Currently just a 1-D implementation with natural spline boundary conditions that I made for an Empirical Mode Decomposition package I am writing (seemed a shame to have to rely on Fortran's DIERCKX).

To Do (probably in the next week or two):

  • Add periodic, not-a-knot and quadratic boundary conditions
  • Re-write using generated functions for perf + multi-dimensional interpolations
  • Tests!
  • Anything else?

Submitting PR now to avoid duplication or if anyone fancies to help 😄

@tbeason
Copy link

tbeason commented Mar 7, 2018

Very interested to know how this is coming along.

Edit: I tested it out. Once I figured out that the correct call was Gridded(Cubic(Reflect())), everything seemed to work ok. In my current setting, performance diff vs gridded linear is not noticeable.

@tbeason
Copy link

tbeason commented Mar 8, 2018

I take it back. I didn't see you said that your implementation was for Natural boundary conditions. Gridded(Cubic(Natural())) does not work. Only Gridded(Cubic(Reflect())) gives me anything, which is weird. It looks like you defined some methods for each, but not all methods for either.

@lungben
Copy link

lungben commented Mar 1, 2020

This functionality would be great!
Any update on this?

@timholy
Copy link
Member

timholy commented Mar 1, 2020

It did not make it in before the giant rewrite in #226. It would have to be totally redone. But it should be much easier now that we're not using generated functions for everything. Want to take a crack at it, @lungben? Basically everything that gets added here is added by someone who needs it, and you're the latest!

@lungben
Copy link

lungben commented Mar 1, 2020

@timholy thanks for the update!
I will take a look, but it probably will take a while and I probably will have to ask stupid questions ;-)

@timholy
Copy link
Member

timholy commented Mar 1, 2020

That would be fine! The place to start is the new WeightedIndex infrastructure. That, prefiltering, and the code to calculate the right indexing/weighting are really the pillars of the package.

@lungben
Copy link

lungben commented May 23, 2020

I did not had the time yet to get into this topic, and probably will not have the time for it in the near future.
Sorry for that!

@NikoBiele
Copy link

I already have a working implementation of a smooth cubic convolution algorithm in Julia. I would like to contribute this implementation with a pull request to this repository. The algorithm works both for 1D and 2D and was given by Robert G. Keys (1981). Importantly it relies on an interpolation kernel and does not rely on solving a linear system like splines do. Its order of accuracy is between that of linear interpolation and cubic splines. I think it aligns well with the focus on performance of this repo. :)
1D_cubicConvolution
2D_cubicConvolution

@mkitti
Copy link
Collaborator

mkitti commented Aug 26, 2024

I would be happy to review the pull request. I suggest starting a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
up for grabs Looking for a volunteer to implement this feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants