utils.get_fmd#
- seismostats.utils.get_fmd(magnitudes: ndarray, delta_m: float, bin_position: str = 'center') tuple[ndarray, ndarray, ndarray]#
Calculates event counts per magnitude bin. Note that the returned bins array contains the center point of each bin unless
bin_position = 'left'.- 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).
counts – Counts for each bin.
mags – Array of magnitudes binned to
delta_m.
Examples
>>> from seismostats.utils import get_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_fmd(magnitudes, delta_m, bin_position) >>> bins array([1., 2.]) >>> counts array([4, 3]) >>> mags array([1., 1., 1., 1., 2., 2., 2.])
See also
get_cum_fmd()