Bugfix in calcsourcespec: If no rotation of traces is possible, use component 3 instead of component z.

This commit is contained in:
Ludger Küperkoch 2016-10-27 15:50:24 +02:00
parent 42268cd3e9
commit 41eebfbcda

View File

@ -451,19 +451,20 @@ def calcsourcespec(wfstream, onset, vp, delta, azimuth, incidence,
LQT = wfstream.rotate('ZNE->LQT', azimuth, incidence) LQT = wfstream.rotate('ZNE->LQT', azimuth, incidence)
ldat = LQT.select(component="L") ldat = LQT.select(component="L")
if len(ldat) == 0: if len(ldat) == 0:
# if horizontal channels are 2 and 3 # if horizontal channels are 1 and 2
# no azimuth information is available and thus no # no azimuth information is available and thus no
# rotation is possible! # rotation is possible!
if verbosity: if verbosity:
print("calcsourcespec: Azimuth information is missing, " print("calcsourcespec: Azimuth information is missing, "
"no rotation of components possible!") "no rotation of components possible!")
ldat = LQT.select(component="Z") # instead, use component 3
ldat = LQT.select(component="3")
# integrate to displacement # integrate to displacement
# unrotated vertical component (for comparison) # unrotated vertical component (for comparison)
inttrz = signal.detrend(integrate.cumtrapz(zdat[0].data, None, dt)) inttrz = signal.detrend(integrate.cumtrapz(zdat[0].data, None, dt))
# rotated component Z => L # rotated component Z => L
print ldat
Ldat = signal.detrend(integrate.cumtrapz(ldat[0].data, None, dt)) Ldat = signal.detrend(integrate.cumtrapz(ldat[0].data, None, dt))
# get window after P pulse for # get window after P pulse for