You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
For now you probably want to apply your chosen interpolation method using xarray.apply_ufunc. The documentation on wrapping custom computation using apply_ufunc is here. (You might also be interested on an upcoming tutorial on exactly this topic too.)
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.
The text was updated successfully, but these errors were encountered: