4.2.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)[source]¶ 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 look in template defaults file
- lowcut High cut (Hz), if set to None will look in template defaults file
- samp_rate (float) New sampling rate in Hz, if set to None will look in template defaults file
- filt_order (int) Filter level, if set to None will look in template defaults file
- length (float) Extract length in seconds, if None will look in template defaults file.
- 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.
- debug (int) Level of debugging output, higher=more
- plot (bool) Turns template plotting on or off.
- 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.
Returns: obspy.Stream Newly cut template