def _interp_gap(data, peak_loc, interp_len):
start_loc = peak_loc - int(<NUM_LIT:0.5> * interp_len)<EOL>end_loc = peak_loc + int(<NUM_LIT:0.5> * interp_len)<EOL>if start_loc < <NUM_LIT:0>:<EOL><INDENT>start_loc = <NUM_LIT:0><EOL><DEDENT>if end_loc > len(data) - <NUM_LIT:1>:<EOL><INDENT>end_loc = len(data) - <NUM_LIT:1><EOL><DEDENT>fill = np.linspace(data[start_loc], data[end_loc], end_loc - start_loc)<EOL>data[start_loc:end_loc] = fill<EOL>return data<EOL>
Internal function for filling gap with linear interpolation

:type data: numpy.ndarray
:param data: data to remove peak in
:type peak_loc: int
:param peak_loc: peak location position
:type interp_len: int
:param interp_len: window to interpolate

:returns: Trace works in-place
:rtype: :class:`obspy.core.trace.Trace`