def _median_window(window, window_start, multiplier, starttime, sampling_rate,<EOL>debug=<NUM_LIT:0>):
MAD = np.median(np.abs(window))<EOL>thresh = multiplier * MAD<EOL>if debug >= <NUM_LIT:2>:<EOL><INDENT>print('<STR_LIT>' + str(thresh) +<EOL>'<STR_LIT>' + str(MAD) +<EOL>'<STR_LIT>' + str(np.max(window)))<EOL><DEDENT>peaks = find_peaks2_short(arr=window,<EOL>thresh=thresh, trig_int=<NUM_LIT:5>, debug=<NUM_LIT:0>)<EOL>if debug >= <NUM_LIT:4> and peaks:<EOL><INDENT>peaks_plot(window, starttime, sampling_rate,<EOL>save=False, peaks=peaks)<EOL><DEDENT>if peaks:<EOL><INDENT>peaks = [(peak[<NUM_LIT:0>], peak[<NUM_LIT:1>] + window_start) for peak in peaks]<EOL><DEDENT>else:<EOL><INDENT>peaks = []<EOL><DEDENT>return peaks<EOL>
Internal function to aid parallel processing

:type window: numpy.ndarry
:param window: Data to look for peaks in.
:type window_start: int
:param window_start: Index of window start point in larger array, used \
    for peak indexing.
:type multiplier: float
:param multiplier: Multiple of MAD to use as threshold
:type starttime: obspy.core.utcdatetime.UTCDateTime
:param starttime: Starttime of window, used in debug plotting.
:type sampling_rate: float
:param sampling_rate in Hz, used for debug plotting
:type debug: int
:param debug: debug level, if want plots, >= 4.

:returns: peaks
:rtype: list