Skip to content

custom interpolation #3622

Closed
Closed
@RubendeBruin

Description

@RubendeBruin

I need to interpolate (wave) forces on a ship between headings and/or frequencies.

heading and frequency are both dimensions.
force is a phase + amplitude pair.

What I would normally do is linear interpolation of the force amplitude and linear interpolation of the unwrapped phase.
Interpolation of the amplitude works fine, but interpolation of the phase is troublesome because I can not unwrap the phases in two dimensions (heading and frequency) at the same time.

A solution that I can think of is storing the phase as a complex number, interpolate that, and then get the phase of the interpolated value. But calculating the angle (phase) from the interpolated values would be slow and it feels like a workaround rather than a good solution.

It would be great if I could pass a custom interpolation function to the interpolate method to use instead of scipy.interpolate.interp1d. But as far as I can see this is not (yet) an option.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions