def find_template_1D(t, s): c = sp.correlate2d(s, t, mode='valid') raw_index = np.argmax(c) return raw_index