[Tutor] obspy.imaging.spectrogram

Guro Anne Brækken guroanne at gmail.com
Thu Jun 18 04:53:34 EDT 2020


Hi there,

Is there anyone out there who would know how to output the data from the
obspy function spectrogram (and not only an image file)?

Problem:
1.read in one seismic trace (SEGY format) - OK
2. calculate and plot the spectrogram using obspy.imaging.spectrogram - OK
3. output the image of the spectrogram as a PNG file - OK
4. output the data points in SEGY format - NOT POSSIBLE ??

My code is the following:
st=obspy.read(\seismic\trace.segy)
st_spec=st.spectrogram(log=True, wlen=0.02, samp_rate=32000, per_lap=0.9,
outfile="st_spec_image")
st_spec.write('st_spec_data', format='SEGY')

I am running the code with Anaconda navigator and python 3.7.6

I hope this was clear. Looking forward to hearing about programmers'
experiences with this issue!

Kind regards,
Guro Anne Braekken


More information about the Tutor mailing list