# 4.6.5.1.7. eqcorrscan.core.template_gen.from_seishub

`eqcorrscan.core.template_gen.``from_seishub`(catalog, url, lowcut, highcut, samp_rate, filt_order, length, prepick, swin, process_len=86400, data_pad=90, all_horiz=False, delayed=True, plot=False, debug=0, return_event=False, min_snr=None)

  Generate multiplexed template from SeisHub database.

  Function to generate templates from a SeisHub database. Must be given an obspy.Catalog class and the SeisHub url as input. The function returns a list of obspy.Stream classes containting steams for each desired template.

  Parameters: | catalog (`obspy.core.event.Catalog`) Catalog class containing desired template events url (str) url of SeisHub database instance lowcut (float) Low cut (Hz), if set to None will not apply a lowcut. highcut (float) High cut (Hz), if set to None will not apply a highcut. samp_rate (float) New sampling rate in Hz. filt_order (int) Filter level (number of corners). length (float) Extract length in seconds. prepick (float) Pre-pick time in seconds swin (str) Either ‘all’, ‘P’ or ‘S’, to select which phases to output. process_len (int) Length of data in seconds to download and process. data_pad (int) Length of data (in seconds) required before and after any event for processing, use to reduce edge-effects of filtering on the templates. 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) Plot templates or not. debug (int) Level of debugging output, higher=more 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` of newly cut templates
  Return type: | list

  Note

  process_len should be set to the same length as used when computing detections using match_filter.match_filter, e.g. if you read in day-long data fro match_filter, process_len should be 86400.

  Warning

  Not tested in continuous integration (due to lack of seishub client), let us know of any failures.