@register_array_xcorr('<STR_LIT>')<EOL>def numpy_normxcorr(templates, stream, pads, *args, **kwargs):
import bottleneck<EOL>from scipy.signal.signaltools import _centered<EOL>used_chans = ~np.isnan(templates).any(axis=<NUM_LIT:1>)<EOL>stream = stream.astype(np.float64)<EOL>templates = templates.astype(np.float64)<EOL>template_length = templates.shape[<NUM_LIT:1>]<EOL>stream_length = len(stream)<EOL>fftshape = next_fast_len(template_length + stream_length - <NUM_LIT:1>)<EOL>stream_mean_array = bottleneck.move_mean(<EOL>stream, template_length)[template_length - <NUM_LIT:1>:]<EOL>stream_std_array = bottleneck.move_std(<EOL>stream, template_length)[template_length - <NUM_LIT:1>:]<EOL>stream_std_array[stream_std_array == <NUM_LIT:0>] = np.nan<EOL>norm = ((templates - templates.mean(axis=-<NUM_LIT:1>, keepdims=True)) / (<EOL>templates.std(axis=-<NUM_LIT:1>, keepdims=True) * template_length))<EOL>norm_sum = norm.sum(axis=-<NUM_LIT:1>, keepdims=True)<EOL>stream_fft = np.fft.rfft(stream, fftshape)<EOL>template_fft = np.fft.rfft(np.flip(norm, axis=-<NUM_LIT:1>), fftshape, axis=-<NUM_LIT:1>)<EOL>res = np.fft.irfft(template_fft * stream_fft,<EOL>fftshape)[:, <NUM_LIT:0>:template_length + stream_length - <NUM_LIT:1>]<EOL>res = ((_centered(res, stream_length - template_length + <NUM_LIT:1>)) -<EOL>norm_sum * stream_mean_array) / stream_std_array<EOL>res[np.isnan(res)] = <NUM_LIT:0.0><EOL>for i, pad in enumerate(pads):  <EOL><INDENT>res[i] = np.append(res[i], np.zeros(pad))[pad:]<EOL><DEDENT>return res.astype(np.float32), used_chans<EOL>
Compute the normalized cross-correlation using numpy and bottleneck.

:param templates: 2D Array of templates
:type templates: np.ndarray
:param stream: 1D array of continuous data
:type stream: np.ndarray
:param pads: List of ints of pad lengths in the same order as templates
:type pads: list

:return: np.ndarray of cross-correlations
:return: np.ndarray channels used