Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent float/int funkyness in hitlet processing #694

Merged
merged 1 commit into from May 16, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 10 additions & 2 deletions strax/processing/hitlets.py
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