Make sure calculating Ml only from reliable onset times.

This commit is contained in:
Ludger Küperkoch 2017-11-09 10:30:01 +01:00
parent f01860b6f1
commit 615ca54640
2 changed files with 14 additions and 8 deletions

View File

@ -346,6 +346,7 @@ def autoPyLoT(input_dict=None, parameter=None, inputfile=None, fnames=None, even
WAscaling[2])) WAscaling[2]))
evt = local_mag.updated_event(magscaling) evt = local_mag.updated_event(magscaling)
net_ml = local_mag.net_magnitude(magscaling) net_ml = local_mag.net_magnitude(magscaling)
if net_ml:
print("Network local magnitude: %4.1f" % net_ml.mag) print("Network local magnitude: %4.1f" % net_ml.mag)
print("Network local magnitude scaled with:") print("Network local magnitude scaled with:")
print("%f * Ml + %f" % (magscaling[0], magscaling[1])) print("%f * Ml + %f" % (magscaling[0], magscaling[1]))
@ -421,6 +422,7 @@ def autoPyLoT(input_dict=None, parameter=None, inputfile=None, fnames=None, even
WAscaling[2])) WAscaling[2]))
evt = local_mag.updated_event(magscaling) evt = local_mag.updated_event(magscaling)
net_ml = local_mag.net_magnitude(magscaling) net_ml = local_mag.net_magnitude(magscaling)
if net_ml:
print("Network local magnitude: %4.1f" % net_ml.mag) print("Network local magnitude: %4.1f" % net_ml.mag)
print("Network local magnitude scaled with:") print("Network local magnitude scaled with:")
print("%f * Ml + %f" % (magscaling[0], magscaling[1])) print("%f * Ml + %f" % (magscaling[0], magscaling[1]))

View File

@ -15,7 +15,7 @@ from pylot.core.pick.utils import getsignalwin, crossings_nonzero_all, \
from pylot.core.util.utils import common_range, fit_curve from pylot.core.util.utils import common_range, fit_curve
from scipy import integrate, signal from scipy import integrate, signal
from scipy.optimize import curve_fit from scipy.optimize import curve_fit
import pdb
def richter_magnitude_scaling(delta): def richter_magnitude_scaling(delta):
distance = np.array([0, 10, 20, 25, 30, 35, 40, 45, 50, 60, 70, 75, 85, 90, 100, 110, distance = np.array([0, 10, 20, 25, 30, 35, 40, 45, 50, 60, 70, 75, 85, 90, 100, 110,
120, 130, 140, 150, 160, 170, 180, 190, 200, 210, 230, 240, 250, 120, 130, 140, 150, 160, 170, 180, 190, 200, 210, 230, 240, 250,
@ -266,6 +266,10 @@ class LocalMagnitude(Magnitude):
for a in self.arrivals: for a in self.arrivals:
if a.phase not in 'sS': if a.phase not in 'sS':
continue continue
# make sure calculating Ml only from reliable onsets
# NLLoc: time_weight = 0 => do not use onset!
if a.time_weight == 0:
continue
pick = a.pick_id.get_referred_object() pick = a.pick_id.get_referred_object()
station = pick.waveform_id.station_code station = pick.waveform_id.station_code
wf = select_for_phase(self.stream.select( wf = select_for_phase(self.stream.select(
@ -365,7 +369,7 @@ class MomentMagnitude(Magnitude):
if a.phase not in 'pP': if a.phase not in 'pP':
continue continue
# make sure calculating Mo only from reliable onsets # make sure calculating Mo only from reliable onsets
# NLLOc: time_weight = 0 => do not use onset! # NLLoc: time_weight = 0 => do not use onset!
if a.time_weight == 0: if a.time_weight == 0:
continue continue
pick = a.pick_id.get_referred_object() pick = a.pick_id.get_referred_object()