Removed (temporary?) one function of two for estimating source spectrum to speed up code.

This commit is contained in:
Ludger Küperkoch 2017-04-05 11:41:29 +02:00
parent 3f027bedf5
commit 6c149b7119

View File

@ -528,22 +528,24 @@ def calcsourcespec(wfstream, onset, vp, delta, azimuth, incidence,
# use of implicit scipy otimization function # use of implicit scipy otimization function
fit = synthsourcespec(F, w0in, Fcin) fit = synthsourcespec(F, w0in, Fcin)
[optspecfit, _] = curve_fit(synthsourcespec, F, YYcor, [w0in, Fcin]) [optspecfit, _] = curve_fit(synthsourcespec, F, YYcor, [w0in, Fcin])
w01 = optspecfit[0] w0 = optspecfit[0]
fc1 = optspecfit[1] fc = optspecfit[1]
#w01 = optspecfit[0]
#fc1 = optspecfit[1]
if verbosity: if verbosity:
print ("calcsourcespec: Determined w0-value: %e m/Hz, \n" print ("calcsourcespec: Determined w0-value: %e m/Hz, \n"
"calcsourcespec: Determined corner frequency: %f Hz" % (w01, fc1)) "calcsourcespec: Determined corner frequency: %f Hz" % (w0, fc))
# use of conventional fitting # use of conventional fitting
[w02, fc2] = fitSourceModel(F, YYcor, Fcin, iplot, 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
w0 = np.median([w01, w02]) #w0 = np.median([w01, w02])
fc = np.median([fc1, fc2]) #fc = np.median([fc1, fc2])
if verbosity: #if verbosity:
print("calcsourcespec: Using w0-value = %e m/Hz and fc = %f Hz" % ( # print("calcsourcespec: Using w0-value = %e m/Hz and fc = %f Hz" % (
w0, fc)) # w0, fc))
if iplot > 1: if iplot > 1:
f1 = plt.figure() f1 = plt.figure()