utils.get_cum_fmd#

seismostats.utils.get_cum_fmd(mags: ndarray, delta_m: float, bin_position: str = 'center') tuple[ndarray, ndarray, ndarray]#

Calculates cumulative event counts across all magnitude units (summed from the right). Note that the returned bins array contains the center point of each bin unless bin_position = 'left' is used.

Parameters:
  • mags – Array of magnitudes.

  • delta_m – Discretization of the magnitudes.

  • bin_position – Position of the bin, options are ‘center’ and ‘left’. Accordingly, left edges of bins or center points are returned.

Returns:
  • bins – Array of bin centers (left to right).

  • c_counts – Cumulative counts for each bin.

  • mags – Array of magnitudes binned to delta_m.

Examples

>>> from seismostats.utils import get_cum_fmd
>>> magnitudes = [0.9, 1.1, 1.2, 1.3, 2.1, 2.2, 2.3]
>>> delta_m = 1.0
>>> bin_position = "center"
>>> bins, counts, mags = get_cum_fmd(magnitudes, delta_m, bin_position)
>>> bins
array([1., 2.])
>>> counts
array([7, 3])
>>> mags
array([1., 1., 1., 2., 2., 2., 2.])

See also

get_fmd()