I am using
index = (np.abs(array - value)).argmin()
to find the index in an array with the smallest absolute difference to a value.
How