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()
# plot results, overlaid
sd.plot(overlay=True)
# plot coherences
sd.plot_coherences(display="full")
# plot coherences, overlaid
sd.plot_coherences(display="overlay")
# plot coherences, sparse
sd.plot_coherences(display="sparse")
# plot coherences, minimal space
sd.plot_coherences(display="minimal")