Skip to content

Commit

Permalink
Merge pull request #1248 from cta-observatory/r0_to_r0g_noFF_crash
Browse files Browse the repository at this point in the history
Avoid crash in log message if no FF events were found
  • Loading branch information
moralejo authored Apr 19, 2024
2 parents 5b80be8 + 7563739 commit fc4355c
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions lstchain/scripts/lstchain_r0_to_r0g.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,13 +202,14 @@ def main():

# If a relevant fraction of FF-like events were not tagged as FF...:
max_frac = 0.1
if ((num_FF_like_with_no_FF_type / num_FF_like > max_frac) &
(use_flatfield_heuristic == False)):
log.warn('More than %d percent of FF-like events '
'have wrong event_type!', int(100*max_frac))
log.warn('You should use heuristic identification of FF events!')
else:
log.info('R0 to R0G conversion finished successfully!')
if num_FF_like > 0:
if ((num_FF_like_with_no_FF_type / num_FF_like > max_frac) &
(use_flatfield_heuristic == False)):
log.warn('More than %d percent of FF-like events '
'have wrong event_type!', int(100*max_frac))
log.warn('You should use heuristic identification of FF events!')
else:
log.info('R0 to R0G conversion finished successfully!')

def get_event_type(wf_hg, offset, evtype):

Expand Down

0 comments on commit fc4355c

Please sign in to comment.