Skip to content

Commit

Permalink
removelines: avoid log(0) warning
Browse files Browse the repository at this point in the history
  • Loading branch information
dstndstn committed Aug 3, 2022
1 parent 55a59b5 commit 08f63b7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions util/removelines.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@

# Returns a numpy array of booleans
def hist_remove_lines(x, binwidth, binoffset, logcut):
bins = -binoffset + np.arange(0, max(x)+binwidth, binwidth)
bins = -binoffset + np.arange(0, max(x)+binwidth+1, binwidth)
(counts, thebins) = np.histogram(x, bins)

# We're ignoring empty bins.
occupied = np.nonzero(counts > 0)[0]
occupied = np.nonzero(counts > 1)[0]
noccupied = len(occupied)
if noccupied == 0:
return np.array([True] * len(x))
Expand Down

0 comments on commit 08f63b7

Please sign in to comment.