Skip to content

PCHIP Interpolation of 1D datasets #1945

@NAThompson

Description

@NAThompson

Currently, H5Web support both constant interpolation and linear interpolation. However, in many cases data is nonuniformly sampled at distances that make linear interpolation look quite bad. One example is high-order ODE steppers, which yield ODE solution skeletons which are very sparse.

It would be nice to have a smooth interpolant for such data. Cleve Moler describes a very nice one here which he calls PCHIP. This interpolant is C^1, and never leaves the data bounds. It does this by ascribing to the datapoints derivatives chosen by this formula:

Image

This is implemented in the attached patchfile:

pchip.patch

Here is a short screen recording demonstrating the use:

Screen.Recording.2026-01-15.at.12.47.02.mov

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions