5.11.1.3. eqcorrscan.utils.plotting.detection_multiplot

eqcorrscan.utils.plotting.detection_multiplot(stream, template, times, streamcolour='k', templatecolour='r', save=False, savefile=None, size=(10.5, 7.5), title=None)[source]

Plot a stream of data with a template on top of it at detection times.

Parameters:
  • stream (obspy.core.stream.Stream) Stream of data to be plotted as the background.
  • template (obspy.core.stream.Stream) Template to be plotted on top of the base stream.
  • times (list) list of detection times, one for each event
  • streamcolour (str) String of matplotlib colour types for the stream
  • templatecolour (str) Colour to plot the template in.
  • save (bool) False will plot to screen, true will save plot and not show to screen.
  • savefile (str) Filename to save to, required for save=True
  • size (tuple) Figure size.
  • title (str) Title for plot.
Returns:

matplotlib.figure.Figure

Example

>>> from obspy import read
>>> import os
>>> from eqcorrscan.core import template_gen
>>> from eqcorrscan.utils.plotting import detection_multiplot
>>> from eqcorrscan.utils.sfile_util import readpicks
>>>
>>> test_file = os.path.join('eqcorrscan', 'tests', 'test_data', 'REA',
...                          'TEST_', '01-0411-15L.S201309')
>>> test_wavefile = os.path.join('eqcorrscan', 'tests', 'test_data', 'WAV',
...                              'TEST_',
...                              '2013-09-01-0410-35.DFDPC_024_00')
>>> event = readpicks(test_file)
>>> st = read(test_wavefile)
>>> st = st.filter('bandpass', freqmin=2.0, freqmax=15.0)
>>> for tr in st:
...     tr = tr.trim(tr.stats.starttime + 30, tr.stats.endtime - 30)
...     # Hack around seisan 2-letter channel naming
...     tr.stats.channel = tr.stats.channel[0] + tr.stats.channel[-1]
>>> template = template_gen.template_gen(event.picks, st, 2)
>>> times = [min([pk.time -0.05 for pk in event.picks])]
>>> detection_multiplot(stream=st, template=template,
...                     times=times) 

(Source code, png, hires.png)

../../_images/eqcorrscan-utils-plotting-detection_multiplot-1.png