CsatiZoltan / CristalX

Identification and analysis of polycrystalline microstructures
https://cristalx.readthedocs.io
GNU Lesser General Public License v3.0
6 stars 7 forks source link

Faster interpolation #29

Open CsatiZoltan opened 4 years ago

CsatiZoltan commented 4 years ago

A recurring task in this project is to interpolate scattered data on a grid. The function griddata returns nan for the locations being outside the convex hull of the input data, for all but the nearest neighbor interpolant. A brute-force method to obtain interpolated values at those external points too is to perform two interpolations: one with the requested interpolant (linear, cubic, etc.) and one with the nearest neighbor. Then use the nearest neighbour interpolated values for the data points where the other interpolants return nan. A possibly faster way could be to perform the nearest neighbor interpolation only at the external points. Two approaches in mind: