From 51f4082e048d71bf893ef84d39869c9ffa33dc5a Mon Sep 17 00:00:00 2001 From: Sebastian Wehling-Benatelli Date: Fri, 23 Sep 2016 15:21:34 +0200 Subject: [PATCH] [fix] imported Magnitude overwrite prevented by renamed import; changed wrong function call --- pylot/core/analysis/magnitude.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pylot/core/analysis/magnitude.py b/pylot/core/analysis/magnitude.py index 8c3612a0..cb1ace0f 100644 --- a/pylot/core/analysis/magnitude.py +++ b/pylot/core/analysis/magnitude.py @@ -9,7 +9,7 @@ import os import matplotlib.pyplot as plt import numpy as np from obspy.core import Stream, UTCDateTime -from obspy.core.event import Magnitude +from obspy.core.event import Magnitude as Obspymagnitude from obspy.geodetics import degrees2kilometers from pylot.core.pick.utils import getsignalwin, crossings_nonzero_all, select_for_phase @@ -688,7 +688,7 @@ def calc_richter_magnitude(e, wf, metadata, amp_win): # using standard Gutenberg-Richter relation # TODO make the ML calculation more flexible by allowing # use of custom relation functions - mag = np.log10(wapp) + gutenberg_richter_relation(delta) + mag = np.log10(wapp) + richter_magnitude_scaling(delta) mags[station] = mag mag = np.median([M for M in mags.values()]) # give some information on the processing @@ -696,7 +696,7 @@ def calc_richter_magnitude(e, wf, metadata, amp_win): print('stations used:\n') for s in mags.keys(): print('\t{0}'.format(s)) - return Magnitude(mag=mag, magnitude_type='ML') + return Obspymagnitude(mag=mag, magnitude_type='ML') else: return None @@ -725,6 +725,6 @@ def calc_moment_magnitude(e, wf, metadata, vp, Qp, rho): print('number of stations used: {0}\n'.format(len(mags.values()))) print('stations used:\n') for s in mags.keys(): print('\t{0}'.format(s)) - return Magnitude(mag=mag, magnitude_type='Mw') + return Obspymagnitude(mag=mag, magnitude_type='Mw') else: return None