Some debugging.

This commit is contained in:
Ludger Küperkoch 2019-11-19 15:12:10 +01:00
parent 5a2aeeb70d
commit 3be78ec576

View File

@ -625,7 +625,7 @@ def calcsourcespec(wfstream, onset, vp, delta, azimuth, incidence,
"calcsourcespec: Determined corner frequency: %f Hz" % (w01, fc1)) "calcsourcespec: Determined corner frequency: %f Hz" % (w01, fc1))
# use of conventional fitting # use of conventional fitting
[w02, fc2] = fitSourceModel(F, YYcor, Fcin, 2, verbosity) [w02, fc2] = fitSourceModel(F, YYcor, Fcin, iplot, verbosity)
# get w0 and fc as median of both # get w0 and fc as median of both
# source spectrum fits # source spectrum fits
@ -652,7 +652,7 @@ def calcsourcespec(wfstream, onset, vp, delta, azimuth, incidence,
plt.xlabel('Time since %s' % zdat[0].stats.starttime) plt.xlabel('Time since %s' % zdat[0].stats.starttime)
plt.ylabel('Displacement [mm]') plt.ylabel('Displacement [mm]')
if iplot >= 1: if iplot > 1:
plt.subplot(2, 1, 2) plt.subplot(2, 1, 2)
p1, = plt.loglog(f, Y.real, 'k') p1, = plt.loglog(f, Y.real, 'k')
p2, = plt.loglog(F, YY.real) p2, = plt.loglog(F, YY.real)
@ -780,8 +780,8 @@ def fitSourceModel(f, S, fc0, iplot, verbosity=False):
w0 = max(S) w0 = max(S)
if verbosity: if verbosity:
print( print(
"fitSourceModel: best fc: {0} Hz, best w0: {1} m/Hz".format(fc, w0)) "fitSourceModel: best fc: {0} Hz, best w0: {1} m/Hz".format(Fc, w0))
if iplot > 0: if iplot >= 1:
plt.figure() # iplot) plt.figure() # iplot)
plt.loglog(f, S, 'k') plt.loglog(f, S, 'k')
plt.loglog([f[0], Fc], [w0, w0], 'g') plt.loglog([f[0], Fc], [w0, w0], 'g')