# 4.6.5.1.4. eqcorrscan.core.template_gen.from_contbase

`eqcorrscan.core.template_gen.``from_contbase`(sfile, contbase_list, lowcut, highcut, samp_rate, filt_order, length, prepick, swin, all_horiz=False, delayed=True, plot=False, debug=0, return_event=False, min_snr=None)

  Generate multiplexed template from a Nordic file using continuous data.

  Function to read in picks from s-file then generate the template from the picks within this and the wavefiles from the continuous database of day-long files. Included is a section to sanity check that the files are daylong and that they start at the start of the day. You should ensure this is the case otherwise this may alter your data if your data are daylong but the headers are incorrectly set.

  Parameters: | sfile (str) sfilename must be the path to a seisan nordic type s-file containing waveform and pick information, all other arguments can be numbers save for swin which must be either P, S or all (case-sensitive). contbase_list (list) List of tuples of the form (‘path’, ‘type’, ‘network’). Where path is the path to the continuous database, type is the directory structure, which can be either Yyyyy/Rjjj.01, which is the standard IRIS Year, julian day structure, or, yyyymmdd which is a single directory for every day. 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. 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) Turns template plotting on or off. 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: | Newly cut template.
  Return type: | `obspy.core.stream.Stream`