Hi,
I’m having trouble using ppsd, I think it might be something to do with the poles and zeros information which I enter manually. Is it possible to use a RESP file to enter this information? or am I doing something else wrong, my code is below.
thanks,
David
from obspy.core import read
from obspy.signal import cosTaper, PPSD
import numpy as np
import matplotlib.pyplot as plt
Load data
stream = read(’…/data/UEASK_Z_252.mseed’)
time = np.arange(0,
stream[0].stats.npts / stream[0].stats.sampling_rate,
stream[0].stats.delta)
raw = stream[0]
Basic processing
##stream[0].data = stream[0].data - stream[0].data.mean()
##stream[0].data = stream[0].data * cosTaper(len(stream[0].data), 0.05)
proc = stream[0]
response = {‘gain’: 5912.0,
‘poles’: [(1005.31+0j),
(502.655+0j),
(-1130.97+0j),
(-0.074016+0.074016j),
(-0.074016-0.074016j)],
‘sensitivity’: 2916630000.0,
‘zeros’: [0j, 0j]}
ppsd = PPSD(proc.stats, response)
print ppsd.id
print ppsd.times[:2]
ppsd.add(raw)
ppsd.plot()