gates = np.log10(np.array([0, 500, 3000, 7000, np.inf])) contains -inf and inf, would that be the problem?
gates = np.log10(np.array([0, 500, 3000, 7000, np.inf]))
-inf
inf