core.match_filter.detection¶
Functions for network matched-filter detection of seismic data.
Designed to cross-correlate templates generated by template_gen function with data and output the detections.
- copyright:
EQcorrscan developers.
- license:
GNU Lesser General Public License, Version 3 (https://www.gnu.org/copyleft/lesser.html)
- class eqcorrscan.core.match_filter.detection.Detection(template_name, detect_time, no_chans, detect_val, threshold, typeofdet, threshold_type, threshold_input, chans=None, event=None, id=None, strict=True)[source]¶
Single detection from detection routines in eqcorrscan. Information required for a full detection based on cross-channel correlation sums.
- Parameters:
template_name (str) – The name of the template for which this detection was made.
detect_time (obspy.core.utcdatetime.UTCDateTime) – Time of detection as an obspy UTCDateTime object
no_chans (int) – The number of channels for which the cross-channel correlation sum was calculated over.
detect_val (float) – The raw value of the cross-channel correlation sum for this detection.
threshold (float) – The value of the threshold used for this detection, will be the raw threshold value related to the cccsum.
typeofdet (str) – Type of detection, STA, corr, bright
threshold_type (str) – Type of threshold used for detection
threshold_input (float) – Threshold set for detection, relates to threshold according to the threshold_type.
chans (list) – List of stations for the detection
event (obspy.core.event.event.Event) – Obspy Event object for this detection, note that this is lost when writing to a
Detection
objects to csv files usingeqcorrscan.core.match_filter.Detection.write()
id (str) – Identification for detection (should be unique).
Methods
copy
()Returns a copy of the detection.
extract_stream
(stream, length, prepick[, ...])Extract a cut stream of a given length around the detection.
write
(fname[, append])Write detection to csv formatted file.
- __init__(template_name, detect_time, no_chans, detect_val, threshold, typeofdet, threshold_type, threshold_input, chans=None, event=None, id=None, strict=True)[source]¶
Main class of Detection.
- extract_stream(stream, length, prepick, all_vert=False, all_horiz=False, vertical_chans=['Z'], horizontal_chans=['E', 'N', '1', '2'])[source]¶
Extract a cut stream of a given length around the detection.
Functions¶
- eqcorrscan.core.match_filter.detection.read_detections(fname, encoding='UTF8')[source]¶
Read detections from a file to a list of Detection objects.
- Parameters:
- Returns:
list of
eqcorrscan.core.match_filter.Detection
- Return type:
list
Note
eqcorrscan.core.match_filter.detection.Detection
’s returned do not contain Detection.event
- eqcorrscan.core.match_filter.detection.write_catalog(detections, fname, format='QUAKEML')[source]¶
Write events contained within detections to a catalog file.
- eqcorrscan.core.match_filter.detection.get_catalog(detections)[source]¶
Generate an
obspy.core.event.Catalog
from list ofDetection
’s.- Parameters:
detections (list) – list of
eqcorrscan.core.match_filter.Detection
- Returns:
Catalog of detected events.
- Return type:
Warning
Will only work if the detections have an event associated with them. This will not be the case if detections have been written to csv format using
eqcorrscan.core.match_filter.Detection.write()
and read back in.