mountaindust / Planktos

ABM framework for dispersal modeling
https://planktos.readthedocs.io
GNU General Public License v3.0
5 stars 3 forks source link

Provide better than linear flow velocity interpolation #26

Closed mountaindust closed 3 months ago

mountaindust commented 3 years ago

As mentioned in #13, it would be good to have the option for tricubic interpolation as credited to Lekien and Marsden (2005). There's a good looking tricubic algorithm at eqtools, and quadcubic is available through ARBInterp. The former is written in C, the latter in NumPy. It's probably best to start with eqtools, combined with linear interpolation in time, and then provide ARBInterp's quadcubic as an option.

mountaindust commented 3 years ago

The game plan is now to do a cubic interpolation in time followed by a tricubic interpolation in space at each time. This also has some side benefits, such as easy access to the derivative of the flow field with respect to time for #29.

mountaindust commented 3 years ago

Temporal interpolation is now done as of 796c68a

mountaindust commented 3 months ago

This has apparently been done for us as of SciPy 1.9! scipy.interpolate.RegularGridInterpolator (and therefore interpn) now supports cubic and quintic methods. Since a method can already be passed to environment. interpolate_flow which is then passed to interpn, there is nothing more to do here. Linear will remain the default method.