[enhancement] make use of the new methods introduced in [900c7af931]

This commit is contained in:
Sebastian Wehling-Benatelli 2016-09-29 11:55:08 +02:00
parent 900c7af931
commit 34c1e80e78

View File

@ -14,7 +14,6 @@ import pylot.core.loc.nll as nll
from pylot.core.analysis.magnitude import MomentMagnitude, RichterMagnitude
from pylot.core.io.data import Data
from pylot.core.io.inputs import AutoPickParameter
from pylot.core.io.phases import add_amplitudes
from pylot.core.pick.autopick import autopickevent, iteratepicker
from pylot.core.util.dataprocessing import restitute_data, read_metadata, \
remove_underscores
@ -159,15 +158,15 @@ def autoPyLoT(inputfile):
moment_mag = MomentMagnitude(corr_dat, evt, parameter.get('vp'),
parameter.get('Qp'),
parameter.get('rho'), True, 0)
# update pick with moment property values (w0, fc, Mo)
for station, props in moment_mag.moment_props.items():
picks[station]['P'].update(props)
evt = moment_mag.updated_event()
local_mag = RichterMagnitude(corr_dat, evt,
parameter.get('sstop'), True, 0)
for station, amplitude in local_mag.amplitudes.items():
picks[station]['S']['Ao'] = amplitude
evt = add_amplitudes(evt, local_mag.amplitudes)
netML = local_mag.net_magnitude()
netMw = moment_mag.net_magnitude()
mags = [netML, netMw]
evt.magnitudes += mags
picks[station]['S']['Ao'] = amplitude.generic_amplitude
evt = local_mag.updated_event()
else:
print("autoPyLoT: No NLLoc-location file available!")
print("No source parameter estimation possible!")
@ -209,17 +208,17 @@ def autoPyLoT(inputfile):
moment_mag = MomentMagnitude(corr_dat, evt, parameter.get('vp'),
parameter.get('Qp'),
parameter.get('rho'), True, 0)
# update pick with moment property values (w0, fc, Mo)
for station, props in moment_mag.moment_props.items():
picks[station]['P'].update(props)
evt = moment_mag.updated_event()
local_mag = RichterMagnitude(corr_dat, evt,
parameter.get('sstop'), True, 0)
for station, amplitude in local_mag.amplitudes.items():
picks[station]['S']['Ao'] = amplitude
evt = add_amplitudes(evt, local_mag.amplitudes)
netML = local_mag.net_magnitude()
# get network moment magntiude
netMw = moment_mag.net_magnitude()
mags = [netML, netMw]
evt.magnitudes += mags
print("Network moment magnitude: %4.1f" % netMw.mag)
picks[station]['S']['Ao'] = amplitude.generic_amplitude
evt = local_mag.updated_event()
net_mw = moment_mag.net_magnitude()
print("Network moment magnitude: %4.1f" % net_mw.mag)
else:
print("autoPyLoT: No NLLoc-location file available! Stop iteration!")
##########################################################