code: def _find_append_zero_crossings(x, y):
      r
      crossings = find_intersections(x[1:], y[1:], np.zeros_like(y[1:]) * y.units)
      x = concatenate((x, crossings[0]))
      y = concatenate((y, crossings[1]))
      sort_idx = np.argsort(x)
      x = x[sort_idx]
      y = y[sort_idx]
      keep_idx = np.ediff1d(x, to_end=[1]) > 0
      x = x[keep_idx]
      y = y[keep_idx]
      return x, y