def construct(self, method, lowcut, highcut, samp_rate, filt_order,<EOL>prepick, save_progress=False, **kwargs):
templates, catalog, process_lengths = template_gen.template_gen(<EOL>method=method, lowcut=lowcut, highcut=highcut,<EOL>filt_order=filt_order, samp_rate=samp_rate, prepick=prepick,<EOL>return_event=True, save_progress=save_progress, **kwargs)<EOL>for template, event, process_len in zip(templates, catalog,<EOL>process_lengths):<EOL><INDENT>t = Template()<EOL>for tr in template:<EOL><INDENT>if not np.any(tr.data.astype(np.float16)):<EOL><INDENT>warnings.warn('<STR_LIT>'<EOL>'<STR_LIT>' % tr.id)<EOL>template.remove(tr)<EOL><DEDENT><DEDENT>if len(template) == <NUM_LIT:0>:<EOL><INDENT>print('<STR_LIT>')<EOL>continue<EOL><DEDENT>t.st = template<EOL>t.name = template.sort(['<STR_LIT>'])[<NUM_LIT:0>].stats.starttime.strftime('<STR_LIT>')<EOL>t.lowcut = lowcut<EOL>t.highcut = highcut<EOL>t.filt_order = filt_order<EOL>t.samp_rate = samp_rate<EOL>t.process_length = process_len<EOL>t.prepick = prepick<EOL>event.comments.append(Comment(<EOL>text="<STR_LIT>" + t.name,<EOL>creation_info=CreationInfo(agency='<STR_LIT>',<EOL>author=getpass.getuser())))<EOL>t.event = event<EOL>self.templates.append(t)<EOL><DEDENT>return self<EOL>
Generate a Tribe of Templates.

See :mod:`eqcorrscan.core.template_gen` for available methods.

:param method: Method of Tribe generation.
:param kwargs: Arguments for the given method.
:type lowcut: float
:param lowcut:
    Low cut (Hz), if set to None will not apply a lowcut
:type highcut: float
:param highcut:
    High cut (Hz), if set to None will not apply a highcut.
:type samp_rate: float
:param samp_rate:
    New sampling rate in Hz.
:type filt_order: int
:param filt_order:
    Filter level (number of corners).
:type prepick: float
:param prepick: Pre-pick time in seconds
:type save_progress: bool
:param save_progress:
    Whether to save the resulting party at every data step or not.
    Useful for long-running processes.

.. Note::
    Methods: `from_contbase`, `from_sfile` and `from_sac` are not
    supported by Tribe.construct and must use Template.construct.

.. Note::
    The Method `multi_template_gen` is not supported because the
    processing parameters for the stream are not known. Use
    `from_meta_file` instead.

.. Note:: Templates will be named according to their start-time.