[new] added data file and a function that evaluates the Gutenberg-Richter relation for a given distance

This commit is contained in:
Sebastian Wehling-Benatelli 2016-09-22 10:53:09 +02:00
parent a215ba35b1
commit bcb3eca8b2
2 changed files with 61 additions and 2 deletions

View File

@ -0,0 +1,53 @@
0 1.4
10 1.5
20 1.7
25 1.9
30 2.1
35 2.3
40 2.4
45 2.5
50 2.6
60 2.8
70 2.8
75 2.9
85 2.9
90 3.0
100 3.0
110 3.1
120 3.1
130 3.2
140 3.2
150 3.3
160 3.3
170 3.4
180 3.4
190 3.5
200 3.5
210 3.6
230 3.7
240 3.7
250 3.8
260 3.8
270 3.9
280 3.9
290 4.0
300 4.0
310 4.1
320 4.2
330 4.2
340 4.2
350 4.3
360 4.3
370 4.3
380 4.4
390 4.4
400 4.5
430 4.6
470 4.7
510 4.8
560 4.9
600 5.1
700 5.2
800 5.4
900 5.5
1000 5.7

View File

@ -5,7 +5,7 @@ Created autumn/winter 2015.
:author: Ludger Küperkoch / MAGS2 EP3 working group :author: Ludger Küperkoch / MAGS2 EP3 working group
""" """
import os
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
import numpy as np import numpy as np
from obspy.core import Stream, UTCDateTime from obspy.core import Stream, UTCDateTime
@ -15,8 +15,14 @@ from scipy.optimize import curve_fit
from scipy import integrate, signal from scipy import integrate, signal
from pylot.core.io.data import Data from pylot.core.io.data import Data
from pylot.core.util.dataprocessing import restitute_data, read_metadata from pylot.core.util.dataprocessing import restitute_data, read_metadata
from pylot.core.util.utils import common_range from pylot.core.util.utils import common_range, fit_curve
def gutenberg_richter_relation(delta):
relation = np.loadtxt(os.path.join(os.path.expanduser('~'),
'.pylot', 'gutenberg_richter.data'))
# prepare spline interpolation to calculate return value
func, params = fit_curve(relation[:,0], relation[:, 1])
return func(delta, params)
class Magnitude(object): class Magnitude(object):
''' '''