From 9aba69686df83f4f83d11c216b8af706e679842e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludger=20K=C3=BCperkoch?= Date: Mon, 19 Jun 2017 11:37:08 +0200 Subject: [PATCH] Richter magnitude scaling is hard-wired, should not be handled internal. First step to flexible local- magnitude estimation. --- pylot/core/analysis/magnitude.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pylot/core/analysis/magnitude.py b/pylot/core/analysis/magnitude.py index dd5e2d6b..5e568fbc 100644 --- a/pylot/core/analysis/magnitude.py +++ b/pylot/core/analysis/magnitude.py @@ -17,10 +17,14 @@ from pylot.core.pick.utils import getsignalwin, crossings_nonzero_all, \ from pylot.core.util.utils import common_range, fit_curve def richter_magnitude_scaling(delta): - relation = np.loadtxt(os.path.join(os.path.expanduser('~'), - '.pylot', 'richter_scaling.data')) + distance = np.arange(0, 1000, 10) + richter_scaling = array([1.4, 1.5, 1.7, 1.9, 2.1, 2.3, 2.4, 2.5, 2.6, 2.8, 2.8, 2.9, + 2.9, 3.0, 3.1, 3.1, 3.2, 3.2, 3.3, 3.3, 3.4, 3.4, 3.5, 3.5, + 3.6, 3.7, 3.7, 3.8, 3.8, 3.9, 3.9, 4.0, 4.0, 4.1, 4.2, 4.2, + 4.2, 4.2, 4.3, 4.3, 4.3, 4.4, 4.4, 4.5, 4.6, 4.7, 4.8, 4.9, + 5.1, 5.2, 5.4, 5.5, 5.7]) # prepare spline interpolation to calculate return value - func, params = fit_curve(relation[:, 0], relation[:, 1]) + func, params = fit_curve(distance, richter_scaling) return func(delta, params)