Skip to content
This repository has been archived by the owner on Dec 20, 2024. It is now read-only.

Commit

Permalink
FIX: Nonnegative meands >=0
Browse files Browse the repository at this point in the history
  • Loading branch information
effigies committed Jun 8, 2024
1 parent 7449297 commit e1777cc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/eddymotion/estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@ def _advanced_clip(data, p_min=35, p_max=99.98, nonnegative=True, dtype="int16",
# Calculate stats on denoised version, to preempt outliers from biasing
denoised = ndimage.median_filter(data, footprint=ball(3))

a_min = np.percentile(denoised[denoised > 0] if nonnegative else denoised, p_min)
a_max = np.percentile(denoised[denoised > 0] if nonnegative else denoised, p_max)
a_min = np.percentile(denoised[denoised >= 0] if nonnegative else denoised, p_min)
a_max = np.percentile(denoised[denoised >= 0] if nonnegative else denoised, p_max)

# Clip and cast
data = np.clip(data, a_min=a_min, a_max=a_max)
Expand Down

0 comments on commit e1777cc

Please sign in to comment.