# 4.6.5. template_gen

Functions to generate template waveforms and information to go with them for the application of cross-correlation of seismic data for the detection of repeating events.

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.

Note

If swin=all, then all picks will be used, not just phase-picks (e.g. it will use amplitude picks). If you do not want this then we suggest that you remove any picks you do not want to use in your templates before using the event.

Note

All functions use obspy filters, which are implemented such that if both highcut and lowcut are set a bandpass filter will be used, but of highcut is not set (None) then a highpass filter will be used and if only the highcut is set then a lowpass filter will be used.

copyright: | EQcorrscan developers.
license: | GNU Lesser General Public License, Version 3 (https://www.gnu.org/copyleft/lesser.html)

## 4.6.5.1. Classes & Functions

`template_gen` | Master function to generate a multiplexed template for a single event.
`extract_from_stack` | Extract a multiplexed template from a stack of detections.
`from_client` | Generate multiplexed template from FDSN client.
`from_contbase` | Generate multiplexed template from a Nordic file using continuous data.
`from_meta_file` | Generate a multiplexed template from a local file.
`from_sac` | Generate a multiplexed template from a list of SAC files.
`from_seishub` | Generate multiplexed template from SeisHub database.
`from_sfile` | Generate multiplexed template from a Nordic (Seisan) s-file.
`multi_template_gen` | Generate multiple templates from one stream of data.