Ensure arrays are doubles before passing to KDTree