5.11.1.20. eqcorrscan.utils.plotting.xcorr_plot

eqcorrscan.utils.plotting.xcorr_plot(template, image, shift=None, cc=None, cc_vec=None, save=False, savefile=None)[source]

Plot a template overlying an image aligned by correlation.

Parameters:
  • template (numpy.ndarray) Short template image
  • image (numpy.ndarray) Long master image
  • shift (int) Shift to apply to template relative to image, in samples
  • cc (float) Cross-correlation at shift
  • cc_vec (numpy.ndarray) Cross-correlation vector.
  • save (bool) Whether to save the plot or not.
  • savefile (str) File name to save to
Returns:

matplotlib.figure.Figure

Example

>>> from obspy import read
>>> from eqcorrscan.utils.plotting import xcorr_plot
>>> from eqcorrscan.utils.stacking import align_traces
>>> st = read().detrend('simple').filter('bandpass', freqmin=2, freqmax=15)
>>> shifts, ccs = align_traces([st[0], st[1]], 40)
>>> shift = shifts[1] * st[1].stats.sampling_rate
>>> cc = ccs[1]
>>> xcorr_plot(template=st[1].data, image=st[0].data, shift=shift,
...            cc=cc) 
../../_images/xcorr_plot.png