Skip to content

Commit 5784f67

Browse files
committed
1240 fix
1 parent e97e3eb commit 5784f67

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/spyglass/utils/nwb_helper_fn.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,9 +313,11 @@ def estimate_sampling_rate(
313313
# we histogram with 100 bins out to 3 * mean, which should be fine for any
314314
# reasonable number of samples
315315
hist, bins = np.histogram(
316-
smooth_diff, bins=100, range=[0, 3 * np.mean(smooth_diff)]
316+
np.log10(smooth_diff),
317+
bins=100,
318+
range=[-5, np.log10(3 * np.mean(smooth_diff))],
317319
)
318-
mode = bins[np.where(hist == np.max(hist))][0]
320+
mode = 10 ** bins[np.where(hist == np.max(hist))][0]
319321

320322
adjacent = sample_diff < mode * multiplier
321323

0 commit comments

Comments
 (0)