select_i_closest
- PlasmaCalcs.tools.array_select.select_i_closest(listlike, x, force_relative=None)
returns the index of the value closest to x. If x iterable, [select_i_closest(y) for y in x]
raise ValueError if that is impossible (e.g. if force_relative=’equal’ and no value == x).- force_relative: None, ‘before’, ‘after’, ‘equal’, or ‘isclose’
- whether to also force a certain relationship between result and x:result <= x (if ‘before),result >= x (if ‘after’),result == x (if ‘equal’),np.isclose(result, x, atol=0) (if ‘isclose’).