5.2.8.1.3. eqcorrscan.utils.mag_calc.calc_max_curv¶
- eqcorrscan.utils.mag_calc.calc_max_curv(magnitudes, bin_size=0.5, plotvar=False)[source]¶
Calculate the magnitude of completeness using the maximum curvature method.
- Parameters:
magnitudes (list or numpy array) – List of magnitudes from which to compute the maximum curvature which will give an estimate of the magnitude of completeness given the assumption of a power-law scaling.
bin_size (float) – Width of magnitude bins used to compute the non-cumulative distribution
plotvar (bool) – Turn plotting on and off
- Return type:
- Returns:
Magnitude at maximum curvature
Note
Should be used as a guide, often under-estimates Mc.
Example
>>> import numpy as np >>> mags = np.arange(3, 6, .1) >>> N = 10 ** (5 - 1 * mags) >>> magnitudes = [0, 2, 3, 2.5, 2.2, 1.0] # Some below completeness >>> for mag, n in zip(mags, N): ... magnitudes.extend([mag for _ in range(int(n))]) >>> calc_max_curv(magnitudes, plotvar=False) 3.0