Reset some former changes, net_magnitude still buggy, as it returns Nonetype if no reliable picks are available!
This commit is contained in:
parent
615ca54640
commit
55101c9e9e
16
autoPyLoT.py
16
autoPyLoT.py
@ -338,6 +338,7 @@ def autoPyLoT(input_dict=None, parameter=None, inputfile=None, fnames=None, even
|
|||||||
local_mag = LocalMagnitude(corr_dat, evt,
|
local_mag = LocalMagnitude(corr_dat, evt,
|
||||||
parameter.get('sstop'),
|
parameter.get('sstop'),
|
||||||
WAscaling, True, iplot)
|
WAscaling, True, iplot)
|
||||||
|
# update pick with local magnitude property values
|
||||||
for stats, amplitude in local_mag.amplitudes.items():
|
for stats, amplitude in local_mag.amplitudes.items():
|
||||||
picks[stats]['S']['Ao'] = amplitude.generic_amplitude
|
picks[stats]['S']['Ao'] = amplitude.generic_amplitude
|
||||||
print("Local station magnitudes scaled with:")
|
print("Local station magnitudes scaled with:")
|
||||||
@ -346,10 +347,9 @@ 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]))
|
|
||||||
else:
|
else:
|
||||||
print("autoPyLoT: No NLLoc-location file available!")
|
print("autoPyLoT: No NLLoc-location file available!")
|
||||||
print("No source parameter estimation possible!")
|
print("No source parameter estimation possible!")
|
||||||
@ -413,6 +413,7 @@ def autoPyLoT(input_dict=None, parameter=None, inputfile=None, fnames=None, even
|
|||||||
local_mag = LocalMagnitude(corr_dat, evt,
|
local_mag = LocalMagnitude(corr_dat, evt,
|
||||||
parameter.get('sstop'),
|
parameter.get('sstop'),
|
||||||
WAscaling, True, iplot)
|
WAscaling, True, iplot)
|
||||||
|
# update pick with local magnitude property values
|
||||||
for stats, amplitude in local_mag.amplitudes.items():
|
for stats, amplitude in local_mag.amplitudes.items():
|
||||||
if stats in picks:
|
if stats in picks:
|
||||||
picks[stats]['S']['Ao'] = amplitude.generic_amplitude
|
picks[stats]['S']['Ao'] = amplitude.generic_amplitude
|
||||||
@ -422,10 +423,9 @@ 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]))
|
|
||||||
else:
|
else:
|
||||||
print("autoPyLoT: No NLLoc-location file available! Stop iteration!")
|
print("autoPyLoT: No NLLoc-location file available! Stop iteration!")
|
||||||
locflag = 9
|
locflag = 9
|
||||||
|
@ -132,7 +132,7 @@ class Magnitude(object):
|
|||||||
station_count=len(self.magnitudes),
|
station_count=len(self.magnitudes),
|
||||||
azimuthal_gap=self.origin_id.get_referred_object().quality.azimuthal_gap)
|
azimuthal_gap=self.origin_id.get_referred_object().quality.azimuthal_gap)
|
||||||
else:
|
else:
|
||||||
# no saling necessary
|
# no scaling necessary
|
||||||
mag = ope.Magnitude(
|
mag = ope.Magnitude(
|
||||||
mag=np.median([M.mag for M in self.magnitudes.values()]),
|
mag=np.median([M.mag for M in self.magnitudes.values()]),
|
||||||
magnitude_type=self.type,
|
magnitude_type=self.type,
|
||||||
|
Loading…
Reference in New Issue
Block a user