kbarbary / Dierckx.jl

Julia package for 1-d and 2-d splines
Other
157 stars 30 forks source link

extrapolation #62

Open joaogoliveira1 opened 4 years ago

joaogoliveira1 commented 4 years ago

Hey,

Are there any plans to include extrapolation options in 2D like in 1D? Thanks

joaogoliveira1 commented 4 years ago

For those struggling with this limitation, I used the following quick solution for my case:

  1. I am working with a function defined over two real variables
  2. for one of them, by the nature of the problem I know that I will not have to evaluate the function above the maximum point of the grid, which means that it does not matter if the extrapolation is flat
  3. For the other variable, I did a linear approximation of the function at the end-point, for which I only need the derivative and the function evaluated at the end-point.
kbarbary commented 4 years ago

Unfortunately, I believe the underlying Fortran library only supports extrapolation for 1-d splines, and I don't think it would be trivial to tack on the handling at the Julia level in Spline2D evaluation.

Thank you for posting your workaround for others!