4.6.5.1.1. eqcorrscan.core.template_gen.template_gen

eqcorrscan.core.template_gen.template_gen(picks, st, length, swin='all', prepick=0.05, all_horiz=False, delayed=True, plot=False, min_snr=None, debug=0)[source]

Master function to generate a multiplexed template for a single event.

Function to generate a cut template as obspy.core.stream.Stream from a given set of picks and data. Should be given pre-processed data (downsampled and filtered).

Parameters:
  • picks (list) Picks to extract data around, where each pick in the list is an obspy.core.event.origin.Pick object.
  • st (obspy.core.stream.Stream) Stream to extract templates from
  • length (float) Length of template in seconds
  • swin (str) 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
  • 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.
  • debug (int) Debug output level from 0-5.
Returns:

Newly cut template.

Return type:

obspy.core.stream.Stream

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.