[change] use read in metadata information instead of reading metadata each time invoked

This commit is contained in:
Sebastian Wehling-Benatelli 2016-09-20 09:58:33 +02:00
parent 7e76bf7577
commit df002ce9ac

View File

@ -306,7 +306,8 @@ def calcMoMw(wfstream, w0, rho, vp, delta, inv):
return Mo, Mw
def calcsourcespec(wfstream, onset, inventory, vp, delta, azimuth, incidence, qp, iplot):
def calcsourcespec(wfstream, onset, metadata, vp, delta, azimuth, incidence,
qp, iplot):
'''
Subfunction to calculate the source spectrum and to derive from that the plateau
(usually called omega0) and the corner frequency assuming Aki's omega-square
@ -353,7 +354,9 @@ def calcsourcespec(wfstream, onset, inventory, vp, delta, azimuth, incidence, qp
data = Data()
wf_copy = wfstream.copy()
[cordat, restflag] = restitute_data(wf_copy, inventory)
invtype, inventory = metadata
[cordat, restflag] = restitute_data(wf_copy, invtype, inventory)
if restflag is True:
zdat = cordat.select(component="Z")
if len(zdat) == 0: