@register_array_xcorr('<STR_LIT>')<EOL>def time_multi_normxcorr(templates, stream, pads, threaded=False, *args,<EOL>**kwargs):
used_chans = ~np.isnan(templates).any(axis=<NUM_LIT:1>)<EOL>utilslib = _load_cdll('<STR_LIT>')<EOL>argtypes = [<EOL>np.ctypeslib.ndpointer(dtype=np.float32, ndim=<NUM_LIT:1>,<EOL>flags=native_str('<STR_LIT>')),<EOL>ctypes.c_int, ctypes.c_int,<EOL>np.ctypeslib.ndpointer(dtype=np.float32, ndim=<NUM_LIT:1>,<EOL>flags=native_str('<STR_LIT>')),<EOL>ctypes.c_int,<EOL>np.ctypeslib.ndpointer(dtype=np.float32, ndim=<NUM_LIT:1>,<EOL>flags=native_str('<STR_LIT>'))]<EOL>restype = ctypes.c_int<EOL>if threaded:<EOL><INDENT>func = utilslib.multi_normxcorr_time_threaded<EOL>argtypes.append(ctypes.c_int)<EOL><DEDENT>else:<EOL><INDENT>func = utilslib.multi_normxcorr_time<EOL><DEDENT>func.argtypes = argtypes<EOL>func.restype = restype<EOL>templates_means = templates.mean(axis=<NUM_LIT:1>).astype(np.float32)[:, np.newaxis]<EOL>stream_mean = stream.mean().astype(np.float32)<EOL>templates = templates.astype(np.float32) - templates_means<EOL>stream = stream.astype(np.float32) - stream_mean<EOL>template_len = templates.shape[<NUM_LIT:1>]<EOL>n_templates = templates.shape[<NUM_LIT:0>]<EOL>image_len = stream.shape[<NUM_LIT:0>]<EOL>ccc = np.ascontiguousarray(<EOL>np.empty((image_len - template_len + <NUM_LIT:1>) * n_templates), np.float32)<EOL>t_array = np.ascontiguousarray(templates.flatten(), np.float32)<EOL>time_args = [t_array, template_len, n_templates,<EOL>np.ascontiguousarray(stream, np.float32), image_len, ccc]<EOL>if threaded:<EOL><INDENT>time_args.append(kwargs.get('<STR_LIT>', cpu_count()))<EOL><DEDENT>func(*time_args)<EOL>ccc[np.isnan(ccc)] = <NUM_LIT:0.0><EOL>ccc = ccc.reshape((n_templates, image_len - template_len + <NUM_LIT:1>))<EOL>for i in range(len(pads)):<EOL><INDENT>ccc[i] = np.append(ccc[i], np.zeros(pads[i]))[pads[i]:]<EOL><DEDENT>templates += templates_means<EOL>stream += stream_mean<EOL>return ccc, used_chans<EOL>
Compute cross-correlations in the time-domain using C routine.

: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
:param threaded: Whether to use the threaded routine or not
:type threaded: bool

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