redback.utils.find_nearest

redback.utils.find_nearest(array, value)[source]

Find the nearest value in an array to a given value.

Parameters:
  • array – array to search

  • value – value to search for

Returns:

array element closest to value and index of that element