3
$\begingroup$

I am interpolating a 2D dataset on a hemisphere, and I am currently using scipy.Rbf that I like for its simplicity.

I am defining the norm of the interpolator with the haversine formula in order to respect the fact that I am on a hemisphere, and doing a cubic interpolation in order to have a $C^2$ function at the end, but the problem is that I also want to avoid overshoot, meaning that no interpolated point can be higher than the maximum known value or lower than the minimum known value (more precisely, it can be lower than the minimum known value but always greater than zero, but the first requirement would be enough).

The best solution would be to have directly a function that I can give to scipy.Rbf that can handle these conditions, but if it's not possible, I may try a different algorithm.

$\endgroup$
4
  • 2
    $\begingroup$ What do you mean for overshoot? $\endgroup$
    – Cesareo
    Commented Dec 23, 2022 at 14:48
  • $\begingroup$ No interpolated value can be higher than the maximum known value or lower than the minimum known value. $\endgroup$
    – Balfar
    Commented Jan 2, 2023 at 13:14
  • $\begingroup$ It sounds as if you don't need an interpolator but an approximating function, am I understanding it right? $\endgroup$
    – nicoguaro
    Commented Jan 2, 2023 at 21:29
  • $\begingroup$ Not exactly. Let's say that I have a set of points $\{\{0, 0\}, \{\pi/4, 0\}, \{\pi/4, \pi/2\}, \{\pi/4, \pi\}, \{\pi/4, 3\pi/2\}, ...\}$ where the first value in each duet is the $\theta$ coordinate and the second is the $\phi$ coordinate, and for each point I know its value $\{5000, 2000, ...\}$. I may now want to know what will be the values for new points $\{\{\pi/4, \pi/3\}, ...\}$. I want to do an interpolation on these points, that will always give me positive values less than the maximum known value, and that will create a set of points that is $C^2$. $\endgroup$
    – Balfar
    Commented Jan 3, 2023 at 12:51

1 Answer 1

1
$\begingroup$

You may have a look at Monoton Preserving Cubic $C^1$ or Quintic Hermite $C^2$ interpolants, here. A 1D version is available via pchip method in Matlab, here. See also the 2D makima variant here (not fully monoton). An extension to sphere surfaces may require some effort, however still feasible.

$\endgroup$
2
  • $\begingroup$ Hermite interpolants are not $C^1$ for 2-manifolds, in general. They might have continuous partial derivatives, that is a necessary but not sufficient condition. $\endgroup$
    – nicoguaro
    Commented Jan 3, 2023 at 20:48
  • $\begingroup$ @nicoguaro Sure, possible for partial derivatives in N-D only. The answer should perhaps rather be understood as a hint. $\endgroup$
    – ConvexHull
    Commented Jan 4, 2023 at 10:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.