def _channel_loop(tr, parameters, max_trigger_length=<NUM_LIT>,<EOL>despike=False, debug=<NUM_LIT:0>):
for par in parameters:<EOL><INDENT>if par['<STR_LIT>'] == tr.stats.station andpar['<STR_LIT>'] == tr.stats.channel:<EOL><INDENT>parameter = par<EOL>break<EOL><DEDENT><DEDENT>else:<EOL><INDENT>msg = '<STR_LIT>' + str(tr.stats.station)<EOL>warnings.warn(msg)<EOL>return []<EOL><DEDENT>triggers = []<EOL>if debug > <NUM_LIT:0>:<EOL><INDENT>print(tr)<EOL><DEDENT>tr.detrend('<STR_LIT>')<EOL>if despike:<EOL><INDENT>median_filter(tr)<EOL><DEDENT>if parameter['<STR_LIT>'] and parameter['<STR_LIT>']:<EOL><INDENT>tr.filter('<STR_LIT>', freqmin=parameter['<STR_LIT>'],<EOL>freqmax=parameter['<STR_LIT>'])<EOL><DEDENT>elif parameter['<STR_LIT>']:<EOL><INDENT>tr.filter('<STR_LIT>', freq=parameter['<STR_LIT>'])<EOL><DEDENT>elif parameter['<STR_LIT>']:<EOL><INDENT>tr.filter('<STR_LIT>', freq=parameter['<STR_LIT>'])<EOL><DEDENT>df = tr.stats.sampling_rate<EOL>cft = recursive_sta_lta(tr.data, int(parameter['<STR_LIT>'] * df),<EOL>int(parameter['<STR_LIT>'] * df))<EOL>if max_trigger_length:<EOL><INDENT>trig_args = {'<STR_LIT>': True}<EOL>trig_args['<STR_LIT>'] = int(max_trigger_length *<EOL>df + <NUM_LIT:0.5>)<EOL><DEDENT>if debug > <NUM_LIT:3>:<EOL><INDENT>plot_trigger(tr, cft, parameter['<STR_LIT>'], parameter['<STR_LIT>'])<EOL><DEDENT>tmp_trigs = trigger_onset(cft, float(parameter['<STR_LIT>']),<EOL>float(parameter['<STR_LIT>']),<EOL>**trig_args)<EOL>for on, off in tmp_trigs:<EOL><INDENT>cft_peak = tr.data[on:off].max()<EOL>cft_std = tr.data[on:off].std()<EOL>on = tr.stats.starttime +float(on) / tr.stats.sampling_rate<EOL>off = tr.stats.starttime +float(off) / tr.stats.sampling_rate<EOL>triggers.append((on.timestamp, off.timestamp,<EOL>tr.id, cft_peak,<EOL>cft_std))<EOL><DEDENT>return triggers<EOL>
Internal loop for parellel processing.

:type tr: obspy.core.trace
:param tr: Trace to look for triggers in.
:type parameters: list
:param parameters: List of TriggerParameter class for trace.
:type max_trigger_length: float
:type despike: bool
:type debug: int

:return: trigger
:rtype: list