SpectralDensity example code

from obspy.core.stream import read
from obspy.core.inventory import read_inventory
from tiskitpy import SpectralDensity

# read data and inventory
stream = read('data/XS.S11D.LH.2016.12.11.mseed', 'MSEED')
inv = read_inventory('data/XS.S11_decimated.station.xml', 'STATIONXML')

# Calculate Spectral Density
sd = SpectralDensity.from_stream(stream, inv=inv)
[INFO] z_threshold=3 rejected 4% of windows (3/84)
print(sd)
SpectralDensity object:
    channel_names=['XS.S11D..LDH', 'XS.S11D..LH1', 'XS.S11D..LH2', 'XS.S11D..LHZ']
    channel_units=['Pa', 'm/s^2', 'm/s^2', 'm/s^2']
    512 frequencies, from 0.000977 to 0.5Hz
    n_windows=81
    window_type=prol1pi
# plot results
sd.plot()
../_images/1_SpectralDensity_plot.png
# plot results, overlaid
sd.plot(overlay=True)
../_images/1_SpectralDensity_plot_overlay.png
# plot coherences
sd.plot_coherences(display="full")
../_images/1_SpectralDensity_coher_full.png
# plot coherences, overlaid
sd.plot_coherences(display="overlay")
../_images/1_SpectralDensity_coher_overlay.png
# plot coherences, sparse
sd.plot_coherences(display="sparse")
../_images/1_SpectralDensity_coher_sparse.png
# plot coherences, minimal space
sd.plot_coherences(display="minimal")
../_images/1_SpectralDensity_coher_minimal.png