Skip to content

Commit

Permalink
correct plot_b_series_constant_nm
Browse files Browse the repository at this point in the history
  • Loading branch information
aronsho committed Feb 16, 2025
1 parent 29ef088 commit 8cfb299
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions seismostats/plots/statistical.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,15 +177,16 @@ def plot_b_series_constant_nm(
# runnning window of n_m magnitudes
mags_window = mags[ii:ii + n_m]
times_window = times[ii:ii + n_m]
mc_window = mc[ii:ii + n_m]

# sort the magnitudes and times
# sort the magnitudes by time
idx = np.argsort(times_window)
mags_window = mags_window[idx]
times_window = times_window[idx]
mc_window = mc_window[idx]

# estimate the b-value
estimator.calculate(
mags_window, mc=mc[ii], delta_m=delta_m, *args, **kwargs)
mags_window, mc=max(mc_window), delta_m=delta_m, *args, **kwargs)
if estimator.n < min_num:
b_values[idx_start + ii] = np.nan
std_bs[idx_start + ii] = np.nan
Expand Down

0 comments on commit 8cfb299

Please sign in to comment.