PPSD Spectrogram error.

Dear all,

I have a problem calculating the spectrogram, I am using ppsd.plot_spectrogram() command to create it, but the terminal gives me an error: AttributeError: ‘PPSD’ object has no attribute ‘plot_spectrogram’.

I have the last version of obspy (1.0.3) and I am trying to run the source codes of this web page. https://docs.obspy.org/master/tutorial/code_snippets/probabilistic_power_spectral_density.html

Does anyone know what is the problem?

Cheers,

Juan

Test

from obspy import read

from obspy.signal import PPSD

from obspy.io.xseed import Parser

st = read(“https://examples.obspy.org/BW.KW1…EHZ.D.2011.037”)

parser = Parser(“https://examples.obspy.org/dataless.seed.BW_KW1”)

ppsd = PPSD(st[0].stats, metadata=parser)

ppsd.add(st)

st = read(“https://examples.obspy.org/BW.KW1…EHZ.D.2011.038”)

ppsd.add(st)

ppsd.plot()

ppsd.plot_spectrogram()

Hi Juan,

the plot_spectrogram() method is not yet in a released ObsPy version. You’ll have to update to the latest master on Github to use it.

Cheers!

Lion