# 4.6.5.1.9. eqcorrscan.core.template_gen.multi_template_gen

`eqcorrscan.core.template_gen.``multi_template_gen`(catalog, st, length, swin='all', prepick=0.05, all_horiz=False, delayed=True, plot=False, debug=0, return_event=False, min_snr=None)

  Generate multiple templates from one stream of data.

  Thin wrapper around _template_gen to generate multiple templates from one stream of continuous data. Takes processed (filtered and resampled) seismic data!

  Parameters: | catalog (obspy.core.event.Catalog) Events to extract templates for st (obspy.core.stream.Stream) Processed stream to extract from, e.g. filtered and re-sampled to what you want using pre_processing.dayproc. length (float) Length of template in seconds swin (string) P, S or all, defaults to all prepick (float) Length in seconds to extract before the pick time default is 0.05 seconds. all_horiz (bool) To use both horizontal channels even if there is only a pick on one of them. Defaults to False. delayed (bool) If True, each channel will begin relative to it’s own pick-time, if set to False, each channel will begin at the same time. plot (bool) To plot the template or not, default is True debug (int) Debug output level from 0-5. return_event (bool) Whether to return the event and process length or not. min_snr (float) Minimum signal-to-noise ratio for a channel to be included in the template, where signal-to-noise ratio is calculated as the ratio of the maximum amplitude in the template window to the rms amplitude in the whole window given.
  Returns: | List of `obspy.core.stream.Stream` templates.
  Return type: | list

  Warning

  Data must be processed before using this function - highcut, lowcut and filt_order are only used to generate the meta-data for the templates.

  Note

  By convention templates are generated with P-phases on the vertical channel and S-phases on the horizontal channels, normal seismograph naming conventions are assumed, where Z denotes vertical and N, E, R, T, 1 and 2 denote horizontal channels, either oriented or not. To this end we will only use Z channels if they have a P-pick, and will use one or other horizontal channels only if there is an S-pick on it.

  Warning

  If there is no phase_hint included in picks, and swin=all, all channels with picks will be used.