5.13.1.16. eqcorrscan.utils.plotting.SVD_plot

eqcorrscan.utils.plotting.SVD_plot(SVStreams, SValues, stachans, title=False, save=False, savefile=None)[source]

Plot singular vectors from the eqcorrscan.utils.clustering routines.

One plot for each channel.

Parameters:
  • SVStreams (list) – See eqcorrscan.utils.clustering.SVD_2_stream() - these should be ordered by power, e.g. first singular vector in the first stream.
  • SValues (list) – List of floats of the singular values corresponding to the SVStreams
  • stachans (list) – List of station.channel
  • 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, will label additionally according to station and channel.
Returns:

matplotlib.figure.Figure

Example

>>> from obspy import read
>>> import glob
>>> from eqcorrscan.utils.plotting import SVD_plot
>>> from eqcorrscan.utils.clustering import svd, svd_to_stream
>>> wavefiles = glob.glob('eqcorrscan/tests/test_data/WAV/TEST_/*')
>>> streams = [read(w) for w in wavefiles[1:10]]
>>> stream_list = []
>>> for st in streams:
...     tr = st.select(station='GCSZ', channel='EHZ')
...     tr = tr.detrend('simple').resample(100).filter('bandpass',
...                                                    freqmin=2,
...                                                    freqmax=8)
...     stream_list.append(tr)
>>> uvec, sval, svec, stachans = svd(stream_list=stream_list)
>>> SVstreams = svd_to_stream(uvectors=uvec, stachans=stachans, k=3,
...                           sampling_rate=100)
>>> SVD_plot(SVStreams=SVstreams, SValues=sval,
...          stachans=stachans) 

(Source code, png, hires.png)

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