grid_spline: simplify get_indices from c file