4.4.1.1. eqcorrscan.core.lag_calc.lag_calc

eqcorrscan.core.lag_calc.lag_calc(detections, detect_data, template_names, templates, shift_len=0.2, min_cc=0.4, cores=1, interpolate=False, plot=False)[source]

Main lag-calculation function for detections of specific events.

Overseer function to take a list of detection objects, cut the data for them to lengths of the same length of the template + shift_len on either side. This will then write out SEISAN s-file or QuakeML for the detections with pick times based on the lag-times found at the maximum correlation, providing that correlation is above the min_cc.

Parameters:
  • detections (list) List of DETECTION objects
  • detect_data (obspy.core.stream.Stream) All the data needed to cut from - can be a gappy Stream
  • template_names (list) List of the template names, used to help identify families of events. Must be in the same order as templates.
  • templates (list) List of the templates, templates are of type: obspy.core.stream.Stream.
  • shift_len (float) Shift length allowed for the pick in seconds, will be plus/minus this amount - default=0.2
  • min_cc (float) Minimum cross-correlation value to be considered a pick, default=0.4
  • cores (int) Number of cores to use in parallel processing, defaults to one.
  • interpolate (bool) Interpolate the correlation function to achieve sub-sample precision.
  • plot (bool) To generate a plot for every detection or not, defaults to False.
Returns:

Catalog of events with picks. No origin information is included, these events can then be written out via obspy.core.event functions, or to seisan Sfiles using Sfile_util and located.

Return type:

obspy.core.event.Catalog

>>> from eqcorrscan.core import lag_calc

Note

Picks output in catalog are generated relative to the template start-time. For example, if you generated your template with a pre_pick time of 0.2 seconds, you should expect picks generated by lag_calc to occur 0.2 seconds before the true phase-pick. This is because we do not currently store template meta-data alongside the templates.

Warning

Because of the above note, origin times will be consistently shifted by the static pre_pick applied to the templates.