Skip to content

Commit

Permalink
return correct number of objects
Browse files Browse the repository at this point in the history
  • Loading branch information
fschlueter committed Dec 2, 2024
1 parent c010d0f commit 89a791a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions NuRadioReco/utilities/trace_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,12 +258,18 @@ def delay_trace(trace, sampling_frequency, time_delay, crop_trace=True):
dt_start: float (optional)
The delta t of the trace start time. Only returned if crop_trace is True.
"""
# Do nothing if time_delay is 0
if not time_delay:
# If time delay is 0
if isinstance(trace, NuRadioReco.framework.base_trace.BaseTrace):
return trace.get_trace(), 0
if crop_trace:
return trace.get_trace(), 0
else:
return trace.get_trace()
else:
return trace, 0
if crop_trace:
return trace, 0
else:
return trace

if isinstance(trace, NuRadioReco.framework.base_trace.BaseTrace):
spectrum = trace.get_frequency_spectrum()
Expand Down

0 comments on commit 89a791a

Please sign in to comment.