Skip to content

Commit

Permalink
prevent float int funkyness (#694)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoranAngevaare authored May 16, 2022
1 parent 6aa0a4d commit 4969594
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions strax/processing/hitlets.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
def create_hitlets_from_hits(hits,
save_outside_hits,
channel_range,
chunk_start=0,
chunk_end=np.inf,):
chunk_start=None,
chunk_end=None,):
"""
Function which creates hitlets from a bunch of hits.
Expand All @@ -29,6 +29,14 @@ def create_hitlets_from_hits(hits,
:return: Hitlets with temporary fields (data, max_goodness_of_split...)
"""
# There is no such thing as an int('inf'), let's take the min/max
# for an 64bit-int. Floats would give funny business in
# _concat_overlapping_hits! github.com/AxFoundation/strax/pull/694
if chunk_start is None:
chunk_start = np.iinfo(np.int64).min
if chunk_end is None:
chunk_end = np.iinfo(np.int64).max

# Merge concatenate overlapping within a channel. This is important
# in case hits were split by record boundaries. In case we
# accidentally concatenate two PMT signals we split them later again.
Expand Down

0 comments on commit 4969594

Please sign in to comment.