def _xcorr_interp(ccc, dt):
if ccc.shape[<NUM_LIT:0>] == <NUM_LIT:1>:<EOL><INDENT>cc = ccc[<NUM_LIT:0>]<EOL><DEDENT>else:<EOL><INDENT>cc = ccc<EOL><DEDENT>cc_curvature = np.concatenate((np.zeros(<NUM_LIT:1>), np.diff(cc, <NUM_LIT:2>), np.zeros(<NUM_LIT:1>)))<EOL>cc_t = np.arange(<NUM_LIT:0>, len(cc) * dt, dt)<EOL>peak_index = cc.argmax()<EOL>first_sample = peak_index<EOL>while first_sample > <NUM_LIT:0> and cc_curvature[first_sample - <NUM_LIT:1>] <= <NUM_LIT:0>:<EOL><INDENT>first_sample -= <NUM_LIT:1><EOL><DEDENT>last_sample = peak_index<EOL>while last_sample < len(cc) - <NUM_LIT:1> and cc_curvature[last_sample + <NUM_LIT:1>] <= <NUM_LIT:0>:<EOL><INDENT>last_sample += <NUM_LIT:1><EOL><DEDENT>num_samples = last_sample - first_sample + <NUM_LIT:1><EOL>if num_samples < <NUM_LIT:3>:<EOL><INDENT>msg = "<STR_LIT>" +"<STR_LIT>" % num_samples<EOL>raise IndexError(msg)<EOL><DEDENT>if num_samples < <NUM_LIT:5>:<EOL><INDENT>msg = "<STR_LIT>" +"<STR_LIT>" % num_samples<EOL>warnings.warn(msg)<EOL><DEDENT>coeffs, residual = scipy.polyfit(<EOL>cc_t[first_sample:last_sample + <NUM_LIT:1>],<EOL>cc[first_sample:last_sample + <NUM_LIT:1>], deg=<NUM_LIT:2>, full=True)[:<NUM_LIT:2>]<EOL>if coeffs[<NUM_LIT:0>] >= <NUM_LIT:0>:<EOL><INDENT>msg = "<STR_LIT>"<EOL>warnings.warn(msg)<EOL><DEDENT>if residual > <NUM_LIT:0.1>:<EOL><INDENT>msg = "<STR_LIT>" +"<STR_LIT>" % residual<EOL>warnings.warn(msg)<EOL><DEDENT>shift = -coeffs[<NUM_LIT:1>] / <NUM_LIT> / coeffs[<NUM_LIT:0>]<EOL>coeff = (<NUM_LIT:4> * coeffs[<NUM_LIT:0>] * coeffs[<NUM_LIT:2>] - coeffs[<NUM_LIT:1>] ** <NUM_LIT:2>) / (<NUM_LIT:4> * coeffs[<NUM_LIT:0>])<EOL>return shift, coeff<EOL>
Intrpolate around the maximum correlation value for sub-sample precision.

:param ccc: Cross-correlation array
:type ccc: numpy.ndarray
:param dt: sample interval
:type dt: float

:return: Position of interpolated maximum in seconds from start of ccc
:rtype: float